removed legacy from bff
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/money.dart';
|
||||
|
||||
part 'network_fee.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class NetworkFeeDTO {
|
||||
final MoneyDTO? networkFee;
|
||||
final String? estimationContext;
|
||||
|
||||
const NetworkFeeDTO({
|
||||
this.networkFee,
|
||||
this.estimationContext,
|
||||
});
|
||||
|
||||
factory NetworkFeeDTO.fromJson(Map<String, dynamic> json) => _$NetworkFeeDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$NetworkFeeDTOToJson(this);
|
||||
}
|
||||
@@ -1,35 +1,21 @@
|
||||
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/money.dart';
|
||||
import 'package:pshared/data/dto/payment/network_fee.dart';
|
||||
import 'package:pshared/data/dto/payment/quote_amounts.dart';
|
||||
import 'package:pshared/data/dto/payment/quote_fees.dart';
|
||||
|
||||
part 'payment_quote.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class PaymentQuoteDTO {
|
||||
final String? quoteRef;
|
||||
final MoneyDTO? debitAmount;
|
||||
final MoneyDTO? debitSettlementAmount;
|
||||
final MoneyDTO? expectedSettlementAmount;
|
||||
final MoneyDTO? expectedFeeTotal;
|
||||
final List<FeeLineDTO>? feeLines;
|
||||
final NetworkFeeDTO? networkFee;
|
||||
final QuoteAmountsDTO? amounts;
|
||||
final QuoteFeesDTO? fees;
|
||||
final FxQuoteDTO? fxQuote;
|
||||
|
||||
const PaymentQuoteDTO({
|
||||
this.quoteRef,
|
||||
this.debitAmount,
|
||||
this.debitSettlementAmount,
|
||||
this.expectedSettlementAmount,
|
||||
this.expectedFeeTotal,
|
||||
this.feeLines,
|
||||
this.networkFee,
|
||||
this.fxQuote,
|
||||
});
|
||||
const PaymentQuoteDTO({this.quoteRef, this.amounts, this.fees, this.fxQuote});
|
||||
|
||||
factory PaymentQuoteDTO.fromJson(Map<String, dynamic> json) => _$PaymentQuoteDTOFromJson(json);
|
||||
factory PaymentQuoteDTO.fromJson(Map<String, dynamic> json) =>
|
||||
_$PaymentQuoteDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$PaymentQuoteDTOToJson(this);
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/money.dart';
|
||||
|
||||
part 'quote_aggregate.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class PaymentQuoteAggregateDTO {
|
||||
final List<MoneyDTO>? debitAmounts;
|
||||
final List<MoneyDTO>? expectedSettlementAmounts;
|
||||
final List<MoneyDTO>? expectedFeeTotals;
|
||||
final List<MoneyDTO>? networkFeeTotals;
|
||||
|
||||
const PaymentQuoteAggregateDTO({
|
||||
this.debitAmounts,
|
||||
this.expectedSettlementAmounts,
|
||||
this.expectedFeeTotals,
|
||||
this.networkFeeTotals,
|
||||
});
|
||||
|
||||
factory PaymentQuoteAggregateDTO.fromJson(Map<String, dynamic> json) => _$PaymentQuoteAggregateDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$PaymentQuoteAggregateDTOToJson(this);
|
||||
}
|
||||
22
frontend/pshared/lib/data/dto/payment/quote_amounts.dart
Normal file
22
frontend/pshared/lib/data/dto/payment/quote_amounts.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/money.dart';
|
||||
|
||||
part 'quote_amounts.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class QuoteAmountsDTO {
|
||||
final MoneyDTO? sourcePrincipal;
|
||||
final MoneyDTO? sourceDebitTotal;
|
||||
final MoneyDTO? destinationSettlement;
|
||||
|
||||
const QuoteAmountsDTO({
|
||||
this.sourcePrincipal,
|
||||
this.sourceDebitTotal,
|
||||
this.destinationSettlement,
|
||||
});
|
||||
|
||||
factory QuoteAmountsDTO.fromJson(Map<String, dynamic> json) =>
|
||||
_$QuoteAmountsDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$QuoteAmountsDTOToJson(this);
|
||||
}
|
||||
16
frontend/pshared/lib/data/dto/payment/quote_fees.dart
Normal file
16
frontend/pshared/lib/data/dto/payment/quote_fees.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/payment/fee_line.dart';
|
||||
|
||||
part 'quote_fees.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class QuoteFeesDTO {
|
||||
final List<FeeLineDTO>? lines;
|
||||
|
||||
const QuoteFeesDTO({this.lines});
|
||||
|
||||
factory QuoteFeesDTO.fromJson(Map<String, dynamic> json) =>
|
||||
_$QuoteFeesDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$QuoteFeesDTOToJson(this);
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/payment/quote_aggregate.dart';
|
||||
import 'package:pshared/data/dto/payment/payment_quote.dart';
|
||||
|
||||
part 'quotes.g.dart';
|
||||
@@ -9,14 +8,12 @@ part 'quotes.g.dart';
|
||||
class PaymentQuotesDTO {
|
||||
final String quoteRef;
|
||||
final String? idempotencyKey;
|
||||
final PaymentQuoteAggregateDTO? aggregate;
|
||||
final List<PaymentQuoteDTO>? quotes;
|
||||
final List<PaymentQuoteDTO>? items;
|
||||
|
||||
const PaymentQuotesDTO({
|
||||
required this.quoteRef,
|
||||
this.idempotencyKey,
|
||||
this.aggregate,
|
||||
this.quotes,
|
||||
this.items,
|
||||
});
|
||||
|
||||
factory PaymentQuotesDTO.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import 'package:pshared/data/dto/payment/network_fee.dart';
|
||||
import 'package:pshared/data/mapper/money.dart';
|
||||
import 'package:pshared/models/payment/fees/network.dart';
|
||||
|
||||
|
||||
extension NetworkFeeDTOMapper on NetworkFeeDTO {
|
||||
NetworkFee toDomain() => NetworkFee(
|
||||
networkFee: networkFee?.toDomain(),
|
||||
estimationContext: estimationContext,
|
||||
);
|
||||
}
|
||||
|
||||
extension NetworkFeeMapper on NetworkFee {
|
||||
NetworkFeeDTO toDTO() => NetworkFeeDTO(
|
||||
networkFee: networkFee?.toDTO(),
|
||||
estimationContext: estimationContext,
|
||||
);
|
||||
}
|
||||
@@ -1,21 +1,15 @@
|
||||
import 'package:pshared/data/dto/payment/payment_quote.dart';
|
||||
import 'package:pshared/data/mapper/payment/fees/line.dart';
|
||||
import 'package:pshared/data/mapper/payment/fx_quote.dart';
|
||||
import 'package:pshared/data/mapper/money.dart';
|
||||
import 'package:pshared/data/mapper/payment/network_fee.dart';
|
||||
import 'package:pshared/data/mapper/payment/quote/amounts.dart';
|
||||
import 'package:pshared/data/mapper/payment/quote/fees.dart';
|
||||
import 'package:pshared/models/payment/quote/quote.dart';
|
||||
|
||||
|
||||
extension PaymentQuoteDTOMapper on PaymentQuoteDTO {
|
||||
PaymentQuote toDomain({String? idempotencyKey}) => PaymentQuote(
|
||||
quoteRef: quoteRef,
|
||||
idempotencyKey: idempotencyKey,
|
||||
debitAmount: debitAmount?.toDomain(),
|
||||
debitSettlementAmount: debitSettlementAmount?.toDomain(),
|
||||
expectedSettlementAmount: expectedSettlementAmount?.toDomain(),
|
||||
expectedFeeTotal: expectedFeeTotal?.toDomain(),
|
||||
feeLines: feeLines?.map((line) => line.toDomain()).toList(),
|
||||
networkFee: networkFee?.toDomain(),
|
||||
amounts: amounts?.toDomain(),
|
||||
fees: fees?.toDomain(),
|
||||
fxQuote: fxQuote?.toDomain(),
|
||||
);
|
||||
}
|
||||
@@ -23,12 +17,8 @@ extension PaymentQuoteDTOMapper on PaymentQuoteDTO {
|
||||
extension PaymentQuoteMapper on PaymentQuote {
|
||||
PaymentQuoteDTO toDTO() => PaymentQuoteDTO(
|
||||
quoteRef: quoteRef,
|
||||
debitAmount: debitAmount?.toDTO(),
|
||||
debitSettlementAmount: debitSettlementAmount?.toDTO(),
|
||||
expectedSettlementAmount: expectedSettlementAmount?.toDTO(),
|
||||
expectedFeeTotal: expectedFeeTotal?.toDTO(),
|
||||
feeLines: feeLines?.map((line) => line.toDTO()).toList(),
|
||||
networkFee: networkFee?.toDTO(),
|
||||
amounts: amounts?.toDTO(),
|
||||
fees: fees?.toDTO(),
|
||||
fxQuote: fxQuote?.toDTO(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import 'package:pshared/data/dto/payment/quote_aggregate.dart';
|
||||
import 'package:pshared/data/mapper/money.dart';
|
||||
import 'package:pshared/models/payment/quote/aggregate.dart';
|
||||
|
||||
|
||||
extension PaymentQuoteAggregateDTOMapper on PaymentQuoteAggregateDTO {
|
||||
PaymentQuoteAggregate toDomain() => PaymentQuoteAggregate(
|
||||
debitAmounts: debitAmounts?.map((amount) => amount.toDomain()).toList(),
|
||||
expectedSettlementAmounts: expectedSettlementAmounts?.map((amount) => amount.toDomain()).toList(),
|
||||
expectedFeeTotals: expectedFeeTotals?.map((amount) => amount.toDomain()).toList(),
|
||||
networkFeeTotals: networkFeeTotals?.map((amount) => amount.toDomain()).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
extension PaymentQuoteAggregateMapper on PaymentQuoteAggregate {
|
||||
PaymentQuoteAggregateDTO toDTO() => PaymentQuoteAggregateDTO(
|
||||
debitAmounts: debitAmounts?.map((amount) => amount.toDTO()).toList(),
|
||||
expectedSettlementAmounts: expectedSettlementAmounts?.map((amount) => amount.toDTO()).toList(),
|
||||
expectedFeeTotals: expectedFeeTotals?.map((amount) => amount.toDTO()).toList(),
|
||||
networkFeeTotals: networkFeeTotals?.map((amount) => amount.toDTO()).toList(),
|
||||
);
|
||||
}
|
||||
19
frontend/pshared/lib/data/mapper/payment/quote/amounts.dart
Normal file
19
frontend/pshared/lib/data/mapper/payment/quote/amounts.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:pshared/data/dto/payment/quote_amounts.dart';
|
||||
import 'package:pshared/data/mapper/money.dart';
|
||||
import 'package:pshared/models/payment/quote/amounts.dart';
|
||||
|
||||
extension QuoteAmountsDTOMapper on QuoteAmountsDTO {
|
||||
QuoteAmounts toDomain() => QuoteAmounts(
|
||||
sourcePrincipal: sourcePrincipal?.toDomain(),
|
||||
sourceDebitTotal: sourceDebitTotal?.toDomain(),
|
||||
destinationSettlement: destinationSettlement?.toDomain(),
|
||||
);
|
||||
}
|
||||
|
||||
extension QuoteAmountsMapper on QuoteAmounts {
|
||||
QuoteAmountsDTO toDTO() => QuoteAmountsDTO(
|
||||
sourcePrincipal: sourcePrincipal?.toDTO(),
|
||||
sourceDebitTotal: sourceDebitTotal?.toDTO(),
|
||||
destinationSettlement: destinationSettlement?.toDTO(),
|
||||
);
|
||||
}
|
||||
13
frontend/pshared/lib/data/mapper/payment/quote/fees.dart
Normal file
13
frontend/pshared/lib/data/mapper/payment/quote/fees.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:pshared/data/dto/payment/quote_fees.dart';
|
||||
import 'package:pshared/data/mapper/payment/fees/line.dart';
|
||||
import 'package:pshared/models/payment/quote/fees.dart';
|
||||
|
||||
extension QuoteFeesDTOMapper on QuoteFeesDTO {
|
||||
QuoteFees toDomain() =>
|
||||
QuoteFees(lines: lines?.map((line) => line.toDomain()).toList());
|
||||
}
|
||||
|
||||
extension QuoteFeesMapper on QuoteFees {
|
||||
QuoteFeesDTO toDTO() =>
|
||||
QuoteFeesDTO(lines: lines?.map((line) => line.toDTO()).toList());
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
import 'package:pshared/data/dto/payment/quotes.dart';
|
||||
import 'package:pshared/data/mapper/payment/quote.dart';
|
||||
import 'package:pshared/data/mapper/payment/quote/aggregate.dart';
|
||||
import 'package:pshared/models/payment/quote/quotes.dart';
|
||||
|
||||
extension PaymentQuotesDTOMapper on PaymentQuotesDTO {
|
||||
PaymentQuotes toDomain({String? idempotencyKey}) => PaymentQuotes(
|
||||
quoteRef: quoteRef,
|
||||
idempotencyKey: idempotencyKey ?? this.idempotencyKey,
|
||||
aggregate: aggregate?.toDomain(),
|
||||
quotes: quotes?.map((quote) => quote.toDomain()).toList(),
|
||||
items: items?.map((quote) => quote.toDomain()).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -16,7 +14,6 @@ extension PaymentQuotesMapper on PaymentQuotes {
|
||||
PaymentQuotesDTO toDTO() => PaymentQuotesDTO(
|
||||
quoteRef: quoteRef,
|
||||
idempotencyKey: idempotencyKey,
|
||||
aggregate: aggregate?.toDTO(),
|
||||
quotes: quotes?.map((quote) => quote.toDTO()).toList(),
|
||||
items: items?.map((quote) => quote.toDTO()).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user