67 lines
2.2 KiB
Dart
67 lines
2.2 KiB
Dart
/// Interface du repository des contributions (Clean Architecture)
|
|
library contribution_repository_interface;
|
|
|
|
import '../../data/models/contribution_model.dart';
|
|
import '../../data/repositories/contribution_repository.dart' show ContributionPageResult, WavePaiementInitResult;
|
|
|
|
/// Interface définissant le contrat du repository des contributions
|
|
/// Implémentée par ContributionRepositoryImpl dans la couche data
|
|
abstract class IContributionRepository {
|
|
/// Récupère toutes les cotisations du membre connecté
|
|
Future<ContributionPageResult> getMesCotisations({int page = 0, int size = 50});
|
|
|
|
/// Récupère une cotisation par ID
|
|
Future<ContributionModel> getCotisationById(String id);
|
|
|
|
/// Crée une nouvelle cotisation
|
|
Future<ContributionModel> createCotisation(ContributionModel contribution);
|
|
|
|
/// Met à jour une cotisation existante
|
|
Future<ContributionModel> updateCotisation(String id, ContributionModel contribution);
|
|
|
|
/// Supprime une cotisation
|
|
Future<void> deleteCotisation(String id);
|
|
|
|
/// Enregistre un paiement pour une cotisation
|
|
Future<ContributionModel> enregistrerPaiement(
|
|
String cotisationId, {
|
|
required double montant,
|
|
required DateTime datePaiement,
|
|
required String methodePaiement,
|
|
String? numeroPaiement,
|
|
String? referencePaiement,
|
|
});
|
|
|
|
/// Initie un paiement en ligne (Wave)
|
|
Future<WavePaiementInitResult> initierPaiementEnLigne({
|
|
required String cotisationId,
|
|
required String methodePaiement,
|
|
required String numeroTelephone,
|
|
});
|
|
|
|
/// Récupère la synthèse des cotisations du membre
|
|
Future<Map<String, dynamic>?> getMesCotisationsSynthese();
|
|
|
|
/// Récupère les statistiques globales
|
|
Future<Map<String, dynamic>> getStatistiques();
|
|
|
|
/// Récupère les cotisations en attente
|
|
Future<ContributionPageResult> getMesCotisationsEnAttente();
|
|
|
|
/// Récupère les cotisations avec filtres (admin)
|
|
Future<ContributionPageResult> getCotisations({
|
|
int page = 0,
|
|
int size = 20,
|
|
String? membreId,
|
|
String? statut,
|
|
String? type,
|
|
int? annee,
|
|
});
|
|
|
|
/// Envoie un rappel de paiement
|
|
Future<void> envoyerRappel(String cotisationId);
|
|
|
|
/// Génère les cotisations annuelles pour tous les membres
|
|
Future<int> genererCotisationsAnnuelles(int annee);
|
|
}
|