import 'package:pshared/data/dto/payment/quote_aggregate.dart';
import 'package:pshared/data/mapper/payment/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(),
  );
}
