added comment for payment, changed intent and added amount ui in operations
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:pshared/data/dto/payment/operation.dart';
|
||||
import 'package:pshared/data/mapper/money.dart';
|
||||
import 'package:pshared/models/payment/execution_operation.dart';
|
||||
|
||||
|
||||
extension PaymentOperationDTOMapper on PaymentOperationDTO {
|
||||
PaymentExecutionOperation toDomain() => PaymentExecutionOperation(
|
||||
stepRef: stepRef,
|
||||
@@ -10,7 +11,8 @@ extension PaymentOperationDTOMapper on PaymentOperationDTO {
|
||||
code: code,
|
||||
state: state,
|
||||
label: label,
|
||||
money: money?.toDomain(),
|
||||
amount: amount?.toDomain(),
|
||||
convertedAmount: convertedAmount?.toDomain(),
|
||||
failureCode: failureCode,
|
||||
failureReason: failureReason,
|
||||
startedAt: _parseDateTime(startedAt),
|
||||
@@ -26,7 +28,8 @@ extension PaymentExecutionOperationMapper on PaymentExecutionOperation {
|
||||
code: code,
|
||||
state: state,
|
||||
label: label,
|
||||
money: money?.toDTO(),
|
||||
amount: amount?.toDTO(),
|
||||
convertedAmount: convertedAmount?.toDTO(),
|
||||
failureCode: failureCode,
|
||||
failureReason: failureReason,
|
||||
startedAt: startedAt?.toUtc().toIso8601String(),
|
||||
@@ -34,38 +37,6 @@ extension PaymentExecutionOperationMapper on PaymentExecutionOperation {
|
||||
);
|
||||
}
|
||||
|
||||
extension PaymentOperationMoneyDTOMapper on PaymentOperationMoneyDTO {
|
||||
PaymentExecutionOperationMoney toDomain() => PaymentExecutionOperationMoney(
|
||||
planned: planned?.toDomain(),
|
||||
executed: executed?.toDomain(),
|
||||
);
|
||||
}
|
||||
|
||||
extension PaymentExecutionOperationMoneyMapper
|
||||
on PaymentExecutionOperationMoney {
|
||||
PaymentOperationMoneyDTO toDTO() => PaymentOperationMoneyDTO(
|
||||
planned: planned?.toDTO(),
|
||||
executed: executed?.toDTO(),
|
||||
);
|
||||
}
|
||||
|
||||
extension PaymentOperationMoneySnapshotDTOMapper
|
||||
on PaymentOperationMoneySnapshotDTO {
|
||||
PaymentExecutionOperationMoneySnapshot toDomain() =>
|
||||
PaymentExecutionOperationMoneySnapshot(
|
||||
amount: amount?.toDomain(),
|
||||
convertedAmount: convertedAmount?.toDomain(),
|
||||
);
|
||||
}
|
||||
|
||||
extension PaymentExecutionOperationMoneySnapshotMapper
|
||||
on PaymentExecutionOperationMoneySnapshot {
|
||||
PaymentOperationMoneySnapshotDTO toDTO() => PaymentOperationMoneySnapshotDTO(
|
||||
amount: amount?.toDTO(),
|
||||
convertedAmount: convertedAmount?.toDTO(),
|
||||
);
|
||||
}
|
||||
|
||||
DateTime? _parseDateTime(String? value) {
|
||||
final normalized = value?.trim();
|
||||
if (normalized == null || normalized.isEmpty) return null;
|
||||
|
||||
@@ -10,6 +10,7 @@ extension PaymentDTOMapper on PaymentDTO {
|
||||
Payment toDomain() => Payment(
|
||||
paymentRef: paymentRef,
|
||||
state: state,
|
||||
comment: comment,
|
||||
source: source?.toDomain(),
|
||||
destination: destination?.toDomain(),
|
||||
orchestrationState: paymentOrchestrationStateFromValue(state),
|
||||
@@ -26,6 +27,7 @@ extension PaymentMapper on Payment {
|
||||
PaymentDTO toDTO() => PaymentDTO(
|
||||
paymentRef: paymentRef,
|
||||
state: state ?? paymentOrchestrationStateToValue(orchestrationState),
|
||||
comment: comment,
|
||||
source: source?.toDTO(),
|
||||
destination: destination?.toDTO(),
|
||||
failureCode: failureCode,
|
||||
|
||||
Reference in New Issue
Block a user