Initial commit: unionflow-mobile-apps
Application Flutter complète (sans build artifacts). Signed-off-by: lions dev Team
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
/// Use case: Enregistrer un paiement pour une contribution
|
||||
library pay_contribution;
|
||||
|
||||
import 'package:injectable/injectable.dart';
|
||||
import '../../data/models/contribution_model.dart';
|
||||
import '../repositories/contribution_repository.dart';
|
||||
|
||||
/// Use case pour enregistrer un paiement de cotisation
|
||||
@injectable
|
||||
class PayContribution {
|
||||
final IContributionRepository _repository;
|
||||
|
||||
PayContribution(this._repository);
|
||||
|
||||
/// Exécute le use case
|
||||
///
|
||||
/// [cotisationId] - UUID de la cotisation à payer
|
||||
/// [montant] - Montant du paiement
|
||||
/// [datePaiement] - Date du paiement
|
||||
/// [methodePaiement] - Méthode de paiement (WAVE, ESPECES, VIREMENT, etc.)
|
||||
/// [numeroPaiement] - Numéro de transaction (optionnel)
|
||||
/// [referencePaiement] - Référence du paiement (optionnel)
|
||||
///
|
||||
/// Retourne la contribution mise à jour avec le paiement enregistré
|
||||
/// Lève une exception en cas d'erreur de validation ou d'enregistrement
|
||||
Future<ContributionModel> call({
|
||||
required String cotisationId,
|
||||
required double montant,
|
||||
required DateTime datePaiement,
|
||||
required String methodePaiement,
|
||||
String? numeroPaiement,
|
||||
String? referencePaiement,
|
||||
}) async {
|
||||
return _repository.enregistrerPaiement(
|
||||
cotisationId,
|
||||
montant: montant,
|
||||
datePaiement: datePaiement,
|
||||
methodePaiement: methodePaiement,
|
||||
numeroPaiement: numeroPaiement,
|
||||
referencePaiement: referencePaiement,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user