Version propre - Dashboard enhanced
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
import 'package:injectable/injectable.dart';
|
||||
import '../../../../core/models/cotisation_model.dart';
|
||||
import '../../../../core/services/api_service.dart';
|
||||
import '../../../cotisations/domain/repositories/cotisation_repository.dart';
|
||||
|
||||
/// Implémentation du repository des cotisations
|
||||
/// Utilise ApiService pour communiquer avec le backend
|
||||
@LazySingleton(as: CotisationRepository)
|
||||
class CotisationRepositoryImpl implements CotisationRepository {
|
||||
final ApiService _apiService;
|
||||
|
||||
CotisationRepositoryImpl(this._apiService);
|
||||
|
||||
@override
|
||||
Future<List<CotisationModel>> getCotisations({int page = 0, int size = 20}) async {
|
||||
return await _apiService.getCotisations(page: page, size: size);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<CotisationModel> getCotisationById(String id) async {
|
||||
return await _apiService.getCotisationById(id);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<CotisationModel> getCotisationByReference(String numeroReference) async {
|
||||
return await _apiService.getCotisationByReference(numeroReference);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<CotisationModel> createCotisation(CotisationModel cotisation) async {
|
||||
return await _apiService.createCotisation(cotisation);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<CotisationModel> updateCotisation(String id, CotisationModel cotisation) async {
|
||||
return await _apiService.updateCotisation(id, cotisation);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteCotisation(String id) async {
|
||||
return await _apiService.deleteCotisation(id);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<CotisationModel>> getCotisationsByMembre(String membreId, {int page = 0, int size = 20}) async {
|
||||
return await _apiService.getCotisationsByMembre(membreId, page: page, size: size);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<CotisationModel>> getCotisationsByStatut(String statut, {int page = 0, int size = 20}) async {
|
||||
return await _apiService.getCotisationsByStatut(statut, page: page, size: size);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<CotisationModel>> getCotisationsEnRetard({int page = 0, int size = 20}) async {
|
||||
return await _apiService.getCotisationsEnRetard(page: page, size: size);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<CotisationModel>> rechercherCotisations({
|
||||
String? membreId,
|
||||
String? statut,
|
||||
String? typeCotisation,
|
||||
int? annee,
|
||||
int? mois,
|
||||
int page = 0,
|
||||
int size = 20,
|
||||
}) async {
|
||||
return await _apiService.rechercherCotisations(
|
||||
membreId: membreId,
|
||||
statut: statut,
|
||||
typeCotisation: typeCotisation,
|
||||
annee: annee,
|
||||
mois: mois,
|
||||
page: page,
|
||||
size: size,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Map<String, dynamic>> getCotisationsStats() async {
|
||||
return await _apiService.getCotisationsStats();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user