39 lines
1.0 KiB
Dart
39 lines
1.0 KiB
Dart
/// 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,
|
|
);
|
|
}
|
|
}
|