Files
sendico/frontend/pshared/lib/data/dto/ledger/balance.dart
2026-01-22 14:15:14 +01:00

28 lines
702 B
Dart

import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/money.dart';
part 'balance.g.dart';
@JsonSerializable(
includeIfNull: false, // <- omitempty behavior
explicitToJson: true, // <- nested DTOs call toJson()
)
class LedgerBalanceDTO {
final String ledgerAccountRef;
final MoneyDTO? balance;
final int version;
final DateTime? lastUpdated;
const LedgerBalanceDTO({
required this.ledgerAccountRef,
this.balance,
required this.version,
this.lastUpdated,
});
factory LedgerBalanceDTO.fromJson(Map<String, dynamic> json) => _$LedgerBalanceDTOFromJson(json);
Map<String, dynamic> toJson() => _$LedgerBalanceDTOToJson(this);
}