Files
sendico/frontend/pshared/lib/data/dto/payment/operation.dart
2026-03-11 20:04:10 +01:00

64 lines
1.7 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/money.dart';
part 'operation.g.dart';
@JsonSerializable()
class PaymentOperationDTO {
final String? stepRef;
final String? operationRef;
final String? gateway;
final String? code;
final String? state;
final String? label;
final PaymentOperationMoneyDTO? money;
final String? failureCode;
final String? failureReason;
final String? startedAt;
final String? completedAt;
const PaymentOperationDTO({
this.stepRef,
this.operationRef,
this.gateway,
this.code,
this.state,
this.label,
this.money,
this.failureCode,
this.failureReason,
this.startedAt,
this.completedAt,
});
factory PaymentOperationDTO.fromJson(Map<String, dynamic> json) =>
_$PaymentOperationDTOFromJson(json);
Map<String, dynamic> toJson() => _$PaymentOperationDTOToJson(this);
}
@JsonSerializable()
class PaymentOperationMoneyDTO {
final PaymentOperationMoneySnapshotDTO? planned;
final PaymentOperationMoneySnapshotDTO? executed;
const PaymentOperationMoneyDTO({this.planned, this.executed});
factory PaymentOperationMoneyDTO.fromJson(Map<String, dynamic> json) =>
_$PaymentOperationMoneyDTOFromJson(json);
Map<String, dynamic> toJson() => _$PaymentOperationMoneyDTOToJson(this);
}
@JsonSerializable()
class PaymentOperationMoneySnapshotDTO {
final MoneyDTO? amount;
final MoneyDTO? convertedAmount;
const PaymentOperationMoneySnapshotDTO({this.amount, this.convertedAmount});
factory PaymentOperationMoneySnapshotDTO.fromJson(
Map<String, dynamic> json,
) => _$PaymentOperationMoneySnapshotDTOFromJson(json);
Map<String, dynamic> toJson() =>
_$PaymentOperationMoneySnapshotDTOToJson(this);
}