Fixed compilation
This commit is contained in:
27
frontend/pshared/lib/data/dto/ledger/balance.dart
Normal file
27
frontend/pshared/lib/data/dto/ledger/balance.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user