/// États pour le BLoC des cotisations library cotisations_state; import 'package:equatable/equatable.dart'; import '../data/models/cotisation_model.dart'; /// Classe de base pour tous les états de cotisations abstract class CotisationsState extends Equatable { const CotisationsState(); @override List get props => []; } /// État initial class CotisationsInitial extends CotisationsState { const CotisationsInitial(); } /// État de chargement class CotisationsLoading extends CotisationsState { final String? message; const CotisationsLoading({this.message}); @override List get props => [message]; } /// État de rafraîchissement class CotisationsRefreshing extends CotisationsState { const CotisationsRefreshing(); } /// État chargé avec succès class CotisationsLoaded extends CotisationsState { final List cotisations; final int total; final int page; final int size; final int totalPages; const CotisationsLoaded({ required this.cotisations, required this.total, required this.page, required this.size, required this.totalPages, }); @override List get props => [cotisations, total, page, size, totalPages]; } /// État détail d'une cotisation chargé class CotisationDetailLoaded extends CotisationsState { final CotisationModel cotisation; const CotisationDetailLoaded({required this.cotisation}); @override List get props => [cotisation]; } /// État cotisation créée class CotisationCreated extends CotisationsState { final CotisationModel cotisation; const CotisationCreated({required this.cotisation}); @override List get props => [cotisation]; } /// État cotisation mise à jour class CotisationUpdated extends CotisationsState { final CotisationModel cotisation; const CotisationUpdated({required this.cotisation}); @override List get props => [cotisation]; } /// État cotisation supprimée class CotisationDeleted extends CotisationsState { final String id; const CotisationDeleted({required this.id}); @override List get props => [id]; } /// État paiement enregistré class PaiementEnregistre extends CotisationsState { final CotisationModel cotisation; const PaiementEnregistre({required this.cotisation}); @override List get props => [cotisation]; } /// État statistiques chargées class CotisationsStatsLoaded extends CotisationsState { final Map stats; const CotisationsStatsLoaded({required this.stats}); @override List get props => [stats]; } /// État cotisations générées class CotisationsGenerees extends CotisationsState { final int nombreGenere; const CotisationsGenerees({required this.nombreGenere}); @override List get props => [nombreGenere]; } /// État rappel envoyé class RappelEnvoye extends CotisationsState { final String cotisationId; const RappelEnvoye({required this.cotisationId}); @override List get props => [cotisationId]; } /// État d'erreur générique class CotisationsError extends CotisationsState { final String message; final dynamic error; const CotisationsError({ required this.message, this.error, }); @override List get props => [message, error]; } /// État d'erreur réseau class CotisationsNetworkError extends CotisationsState { final String message; const CotisationsNetworkError({required this.message}); @override List get props => [message]; } /// État d'erreur de validation class CotisationsValidationError extends CotisationsState { final String message; final Map? fieldErrors; const CotisationsValidationError({ required this.message, this.fieldErrors, }); @override List get props => [message, fieldErrors]; }