Files
sendico/frontend/pshared/lib/models/payment/payment_method.dart
Stephan D bf85ca062c
All checks were successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
restucturization of recipients payment methods
2025-12-04 14:42:25 +01:00

47 lines
1.2 KiB
Dart

import 'package:pshared/models/payment/methods/data.dart';
import 'package:pshared/models/payment/type.dart';
import 'package:pshared/models/permissions/bound.dart';
import 'package:pshared/models/storable.dart';
class PaymentMethodModel implements PermissionBound, Storable {
final Storable storable;
final PermissionBound permissionBound;
final String recipientRef;
final PaymentMethodData data;
final bool isArchived;
const PaymentMethodModel({
required this.storable,
required this.permissionBound,
required this.recipientRef,
required this.data,
this.isArchived = false,
});
PaymentType get type => data.type;
@override
String get id => storable.id;
@override
DateTime get createdAt => storable.createdAt;
@override
DateTime get updatedAt => storable.updatedAt;
@override
String get organizationRef => permissionBound.organizationRef;
@override
String get permissionRef => permissionBound.permissionRef;
PaymentMethodModel copyWith({
PaymentMethodData? data,
bool? isArchived,
}) => PaymentMethodModel(
storable: storable,
permissionBound: permissionBound,
recipientRef: recipientRef,
data: data ?? this.data,
isArchived: isArchived ?? this.isArchived,
);
}