Fixed compilation

This commit is contained in:
Stephan D
2026-01-22 14:15:14 +01:00
parent 8456263dd8
commit 32e8376700
41 changed files with 549 additions and 190 deletions

View File

@@ -0,0 +1,47 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/describable.dart';
import 'package:pshared/data/dto/ledger/balance.dart';
part 'account.g.dart';
@JsonSerializable(includeIfNull: false, explicitToJson: true)
class LedgerAccountDTO {
final String ledgerAccountRef;
final String organizationRef;
final String? ownerRef;
final String accountCode;
final String accountType;
final String currency;
final String status;
final bool allowNegative;
final bool isSettlement;
final Map<String, String>? metadata;
final DateTime? createdAt;
final DateTime? updatedAt;
final DescribableDTO describable;
final LedgerBalanceDTO? balance;
const LedgerAccountDTO({
required this.ledgerAccountRef,
required this.organizationRef,
this.ownerRef,
required this.accountCode,
required this.accountType,
required this.currency,
required this.status,
required this.allowNegative,
required this.isSettlement,
this.metadata,
this.createdAt,
this.updatedAt,
required this.describable,
this.balance,
});
factory LedgerAccountDTO.fromJson(Map<String, dynamic> json) => _$LedgerAccountDTOFromJson(json);
Map<String, dynamic> toJson() => _$LedgerAccountDTOToJson(this);
}

View 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);
}

View File

@@ -1,6 +1,6 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/payment/money.dart';
import 'package:pshared/data/dto/money.dart';
part 'fee_line.g.dart';

View File

@@ -1,6 +1,6 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/payment/money.dart';
import 'package:pshared/data/dto/money.dart';
part 'fx_quote.g.dart';

View File

@@ -3,7 +3,7 @@ import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/payment/endpoint.dart';
import 'package:pshared/data/dto/payment/intent/customer.dart';
import 'package:pshared/data/dto/payment/intent/fx.dart';
import 'package:pshared/data/dto/payment/money.dart';
import 'package:pshared/data/dto/money.dart';
part 'payment.g.dart';

View File

@@ -1,6 +1,6 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/payment/money.dart';
import 'package:pshared/data/dto/money.dart';
part 'network_fee.g.dart';

View File

@@ -2,7 +2,7 @@ import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/payment/fee_line.dart';
import 'package:pshared/data/dto/payment/fx_quote.dart';
import 'package:pshared/data/dto/payment/money.dart';
import 'package:pshared/data/dto/money.dart';
import 'package:pshared/data/dto/payment/network_fee.dart';
part 'payment_quote.g.dart';

View File

@@ -1,6 +1,6 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/payment/money.dart';
import 'package:pshared/data/dto/money.dart';
part 'quote_aggregate.g.dart';