Final commit.
This commit is contained in:
38
lib/domain/entity/payment_method.dart
Normal file
38
lib/domain/entity/payment_method.dart
Normal file
@ -0,0 +1,38 @@
|
||||
/// Zahlungs-Stammdatensatz — spiegelt das Backend-Aggregat `PaymentMethod`.
|
||||
///
|
||||
/// `code` ist der stabile Programm-Identifier (z. B. `"cash"`,
|
||||
/// `"invoice"`); UI-Code kann darüber spezielle Methoden referenzieren,
|
||||
/// ohne die UUID kennen zu müssen. `active = false` ist Soft-Delete —
|
||||
/// die Methode bleibt für historische Lieferungen referenzierbar,
|
||||
/// taucht aber in der Auswahl bei neuen Lieferungen nicht mehr auf.
|
||||
class PaymentMethod {
|
||||
const PaymentMethod({
|
||||
required this.id,
|
||||
required this.code,
|
||||
required this.name,
|
||||
required this.active,
|
||||
required this.createdAt,
|
||||
});
|
||||
|
||||
final String id;
|
||||
final String code;
|
||||
final String name;
|
||||
final bool active;
|
||||
final DateTime createdAt;
|
||||
|
||||
PaymentMethod copyWith({
|
||||
String? id,
|
||||
String? code,
|
||||
String? name,
|
||||
bool? active,
|
||||
DateTime? createdAt,
|
||||
}) {
|
||||
return PaymentMethod(
|
||||
id: id ?? this.id,
|
||||
code: code ?? this.code,
|
||||
name: name ?? this.name,
|
||||
active: active ?? this.active,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user