Final commit.

This commit is contained in:
Dennis Nemec
2026-06-01 17:12:28 +02:00
parent 3ecbc82885
commit a9bf8ecdd1
385 changed files with 29081 additions and 12089 deletions

View File

@ -0,0 +1,36 @@
import 'package:hl_lieferservice/domain/entity/payment_method.dart';
/// Port für Zahlungsmethoden — globale Stammdaten.
///
/// Im Gegensatz zu `CarsRepository` keine Account-Filter: die Methoden
/// sind firmenweit, alle Fahrer sehen dieselbe Liste.
///
/// Lösch-Verhalten: `delete` wirft eine `PaymentMethodsRepositoryException`
/// mit konkretem `409`-Fall, wenn die Methode noch von Lieferungen
/// referenziert wird (Backend hat dafür den FK-RESTRICT). Für „weiches
/// Entfernen" gibt es `update(active: false)`.
abstract interface class PaymentMethodsRepository {
Future<List<PaymentMethod>> list({bool includeInactive = false});
Future<PaymentMethod> create({
required String code,
required String name,
});
Future<PaymentMethod> update({
required String id,
String? name,
bool? active,
});
Future<void> delete(String id);
}
class PaymentMethodsRepositoryException implements Exception {
const PaymentMethodsRepositoryException(this.message, [this.cause]);
final String message;
final Object? cause;
@override
String toString() => 'PaymentMethodsRepositoryException: $message';
}