32 lines
847 B
Dart
32 lines
847 B
Dart
/// Use Case: Récupérer la liste des organisations
|
|
library get_organizations;
|
|
|
|
import 'package:injectable/injectable.dart';
|
|
import '../../data/models/organization_model.dart';
|
|
import '../repositories/organization_repository.dart';
|
|
|
|
/// Récupère la liste paginée des organisations
|
|
@injectable
|
|
class GetOrganizations {
|
|
final IOrganizationRepository _repository;
|
|
|
|
GetOrganizations(this._repository);
|
|
|
|
/// Exécute le use case
|
|
/// [page] : Numéro de page (défaut: 0)
|
|
/// [size] : Taille de la page (défaut: 20)
|
|
/// [recherche] : Terme de recherche optionnel
|
|
/// Retourne une liste d'organisations
|
|
Future<List<OrganizationModel>> call({
|
|
int page = 0,
|
|
int size = 20,
|
|
String? recherche,
|
|
}) async {
|
|
return _repository.getOrganizations(
|
|
page: page,
|
|
size: size,
|
|
recherche: recherche,
|
|
);
|
|
}
|
|
}
|