import 'package:pshared/data/dto/payment/payment.dart';
import 'package:pshared/data/mapper/payment/payment_quote.dart';
import 'package:pshared/models/payment/payment.dart';


extension PaymentDTOMapper on PaymentDTO {
  Payment toDomain() => Payment(
        paymentRef: paymentRef,
        idempotencyKey: idempotencyKey,
        state: state,
        failureCode: failureCode,
        failureReason: failureReason,
        lastQuote: lastQuote?.toDomain(),
      );
}

extension PaymentMapper on Payment {
  PaymentDTO toDTO() => PaymentDTO(
        paymentRef: paymentRef,
        idempotencyKey: idempotencyKey,
        state: state,
        failureCode: failureCode,
        failureReason: failureReason,
        lastQuote: lastQuote?.toDTO(),
      );
}
