temp build
This commit is contained in:
@@ -1,21 +1,62 @@
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/models/payment/type.dart';
|
||||
|
||||
import 'package:pshared/models/payment/methods/data.dart';
|
||||
import 'package:pshared/models/permissions/bound.dart';
|
||||
import 'package:pshared/models/permissions/bound/storable.dart';
|
||||
import 'package:pshared/models/storable.dart';
|
||||
|
||||
class PaymentMethod {
|
||||
PaymentMethod({
|
||||
required this.id,
|
||||
required this.label,
|
||||
required this.details,
|
||||
required this.type,
|
||||
this.isEnabled = true,
|
||||
|
||||
class PaymentMethod implements PermissionBoundStorable, Describable {
|
||||
final Storable storable;
|
||||
final PermissionBound permissionBound;
|
||||
final Describable describable;
|
||||
final String recipientRef;
|
||||
final PaymentMethodData data;
|
||||
final bool isArchived;
|
||||
final bool isMain;
|
||||
|
||||
const PaymentMethod({
|
||||
required this.storable,
|
||||
required this.permissionBound,
|
||||
required this.describable,
|
||||
required this.recipientRef,
|
||||
required this.data,
|
||||
this.isArchived = false,
|
||||
this.isMain = false,
|
||||
});
|
||||
|
||||
final String id;
|
||||
final String label;
|
||||
final String details;
|
||||
final PaymentType type;
|
||||
PaymentType get type => data.type;
|
||||
|
||||
bool isEnabled;
|
||||
bool isMain;
|
||||
}
|
||||
@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;
|
||||
|
||||
@override
|
||||
String get name => describable.name;
|
||||
@override
|
||||
String? get description => describable.description;
|
||||
|
||||
PaymentMethod copyWith({
|
||||
PaymentMethodData? data,
|
||||
bool? isArchived,
|
||||
bool? isMain,
|
||||
Describable? describable,
|
||||
}) => PaymentMethod(
|
||||
storable: storable,
|
||||
permissionBound: permissionBound,
|
||||
recipientRef: recipientRef,
|
||||
data: data ?? this.data,
|
||||
isArchived: isArchived ?? this.isArchived,
|
||||
isMain: isMain ?? this.isMain,
|
||||
describable: describable ?? this.describable,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user