+source +destination in payments

This commit is contained in:
Stephan D
2026-03-10 19:15:20 +01:00
parent 9c2b3bf8bd
commit e5b4de5d48
16 changed files with 716 additions and 56 deletions

View File

@@ -1,15 +1,16 @@
import 'package:pshared/data/dto/payment/payment.dart';
import 'package:pshared/data/mapper/payment/operation.dart';
import 'package:pshared/data/mapper/payment/quote.dart';
import 'package:pshared/data/mapper/payment/response_endpoint.dart';
import 'package:pshared/models/payment/payment.dart';
import 'package:pshared/models/payment/state.dart';
extension PaymentDTOMapper on PaymentDTO {
Payment toDomain() => Payment(
paymentRef: paymentRef,
idempotencyKey: idempotencyKey,
state: state,
source: source?.toDomain(),
destination: destination?.toDomain(),
orchestrationState: paymentOrchestrationStateFromValue(state),
failureCode: failureCode,
failureReason: failureReason,
@@ -23,8 +24,9 @@ extension PaymentDTOMapper on PaymentDTO {
extension PaymentMapper on Payment {
PaymentDTO toDTO() => PaymentDTO(
paymentRef: paymentRef,
idempotencyKey: idempotencyKey,
state: state ?? paymentOrchestrationStateToValue(orchestrationState),
source: source?.toDTO(),
destination: destination?.toDTO(),
failureCode: failureCode,
failureReason: failureReason,
operations: operations.map((item) => item.toDTO()).toList(),