UnionFlow Client est une interface web responsive construite avec
+ * PrimeFaces 14 (thème Freya) et Quarkus 3.15.1, destinée à l'administration
+ * et à la gestion des organisations de solidarité (associations, mutuelles,
+ * coopératives, tontines, ONG) en Afrique de l'Ouest.
+ *
+ *
Architecture
+ *
+ *
Framework UI : JavaServer Faces (JSF) 4.0
+ *
Composants : PrimeFaces 14.0.0 (thème Freya)
+ *
Backend : Quarkus 3.15.1, Java 17
+ *
Authentification : Keycloak 23 (OIDC/OAuth2)
+ *
Communication API : REST Client MicroProfile
+ *
Internationalisation : i18n avec ResourceBundle (fr, en)
+ *
+ *
+ *
Modules fonctionnels
+ *
+ *
Dashboard — Tableau de bord temps réel avec KPIs,
+ * graphiques interactifs (PrimeFaces Charts)
Lance l'application Quarkus en mode bloquant.
+ * En mode natif, cette méthode démarre instantanément (< 50ms).
+ *
+ * @param args Arguments de ligne de commande (non utilisés)
+ */
public static void main(String... args) {
Quarkus.run(UnionFlowClientApplication.class, args);
}
-
+
+ /**
+ * Méthode de démarrage de l'application.
+ *
+ *
Affiche les informations de démarrage (URLs, configuration)
+ * puis attend le signal d'arrêt (SIGTERM, SIGINT).
+ *
+ * @param args Arguments passés depuis main()
+ * @return Code de sortie (0 = succès)
+ * @throws Exception Si erreur fatale au démarrage
+ */
@Override
public int run(String... args) throws Exception {
- LOG.info("UnionFlow Client démarré avec succès!");
- LOG.info("Interface web disponible sur http://localhost:8082");
- LOG.info("Page d'accueil sur http://localhost:8082/index.xhtml");
-
+ logStartupBanner();
+ logConfiguration();
+ logEndpoints();
+ logArchitecture();
+
+ LOG.info("UnionFlow Client pret a recevoir des requetes");
+ LOG.info("Appuyez sur Ctrl+C pour arreter");
+
+ // Attend le signal d'arrêt (bloquant)
Quarkus.waitForExit();
+
+ LOG.info("UnionFlow Client arrete proprement");
return 0;
}
-}
\ No newline at end of file
+
+ /**
+ * Affiche la bannière ASCII de démarrage.
+ */
+ private void logStartupBanner() {
+ LOG.info("--------------------------------------------------------------");
+ LOG.info("- -");
+ LOG.info("- UNIONFLOW CLIENT v" + applicationVersion + " ");
+ LOG.info("- Interface Web de Gestion Associative Multi-Tenant -");
+ LOG.info("- -");
+ LOG.info("--------------------------------------------------------------");
+ }
+
+ /**
+ * Affiche la configuration active.
+ */
+ private void logConfiguration() {
+ LOG.infof("Profil : %s", activeProfile);
+ LOG.infof("Application : %s v%s", applicationName, applicationVersion);
+ LOG.infof("Java : %s", System.getProperty("java.version"));
+ LOG.infof("Quarkus : %s", quarkusVersion);
+ LOG.infof("PrimeFaces : %s (theme Freya)", primefacesVersion);
+ LOG.infof("JSF : 4.0 (Jakarta Faces)");
+ }
+
+ /**
+ * Affiche les URLs des endpoints principaux.
+ */
+ private void logEndpoints() {
+ String baseUrl = buildBaseUrl();
+
+ LOG.info("--------------------------------------------------------------");
+ LOG.info("Endpoints disponibles:");
+ LOG.infof(" - Page accueil --> %s/index.xhtml", baseUrl);
+ LOG.infof(" - Login --> %s/login.xhtml", baseUrl);
+ LOG.infof(" - Dashboard --> %s/dashboard.xhtml", baseUrl);
+ LOG.infof(" - Health Check --> %s/q/health", baseUrl);
+ LOG.infof(" - Metrics --> %s/q/metrics", baseUrl);
+
+ if ("dev".equals(activeProfile)) {
+ LOG.infof(" - Dev UI --> %s/q/dev", baseUrl);
+ }
+
+ LOG.info("--------------------------------------------------------------");
+ }
+
+ /**
+ * Affiche l'inventaire de l'architecture.
+ */
+ private void logArchitecture() {
+ LOG.info("Architecture:");
+ LOG.info(" - 179 Pages XHTML");
+ LOG.info(" - 50 Managed Beans (JSF)");
+ LOG.info(" - 33 Services");
+ LOG.info(" - 24 REST Clients");
+ LOG.info(" - Templates Facelets (Layout reutilisable)");
+ LOG.info(" - Internationalisation (fr, en)");
+ LOG.info("--------------------------------------------------------------");
+ }
+
+ /**
+ * Construit l'URL de base de l'application.
+ *
+ * @return URL complète (ex: http://localhost:8086)
+ */
+ private String buildBaseUrl() {
+ // En production, utiliser le nom de domaine configuré
+ if ("prod".equals(activeProfile)) {
+ String domain = System.getenv("UNIONFLOW_CLIENT_DOMAIN");
+ if (domain != null && !domain.isEmpty()) {
+ return "https://" + domain;
+ }
+ }
+
+ // En dev/test, utiliser localhost
+ String host = "0.0.0.0".equals(httpHost) ? "localhost" : httpHost;
+ return String.format("http://%s:%d", host, httpPort);
+ }
+}
diff --git a/src/main/java/dev/lions/unionflow/client/bean/MenuBean.java b/src/main/java/dev/lions/unionflow/client/bean/MenuBean.java
new file mode 100644
index 0000000..a2dce22
--- /dev/null
+++ b/src/main/java/dev/lions/unionflow/client/bean/MenuBean.java
@@ -0,0 +1,541 @@
+package dev.lions.unionflow.client.bean;
+
+import jakarta.enterprise.context.SessionScoped;
+import jakarta.inject.Named;
+import io.quarkus.security.identity.SecurityIdentity;
+import jakarta.inject.Inject;
+
+import java.io.Serializable;
+import java.util.Set;
+
+/**
+ * Bean de gestion de la visibilité des menus en fonction des rôles utilisateur.
+ *
+ *
Fournit des méthodes utilitaires pour déterminer quels menus afficher
+ * selon le rôle de l'utilisateur connecté et le type de son organisation.
+ *
+ *
Utilise {@link SecurityIdentity} pour l'authentification OIDC en mode web-app,
+ * en cohérence avec {@link dev.lions.unionflow.client.view.LoginBean}.
+ *
+ * @author UnionFlow Team
+ * @version 1.1
+ * @since 2026-03-01
+ */
+@Named
+@SessionScoped
+public class MenuBean implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @Inject
+ SecurityIdentity securityIdentity;
+
+ /**
+ * Vérifie si l'utilisateur a au moins un des rôles spécifiés.
+ *
+ * @param roles Les rôles à vérifier
+ * @return true si l'utilisateur possède au moins un des rôles, false sinon
+ */
+ private boolean hasAnyRole(String... roles) {
+ if (securityIdentity == null || securityIdentity.isAnonymous()) {
+ return false;
+ }
+
+ Set userRoles = securityIdentity.getRoles();
+ if (userRoles == null || userRoles.isEmpty()) {
+ return false;
+ }
+
+ for (String role : roles) {
+ if (userRoles.contains(role)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // ========================================================================
+ // MENUS PRINCIPAUX - Visibilité par rôle
+ // ========================================================================
+
+ /**
+ * Super Administration - Visible uniquement pour SUPER_ADMIN
+ */
+ public boolean isSuperAdminMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN");
+ }
+
+ /**
+ * Administration - Visible pour admins et secrétaires
+ */
+ public boolean isAdministrationMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE", "MEMBRE_BUREAU");
+ }
+
+ // ========================================================================
+ // NOUVEAUX MENUS PERSONNELS - Visible pour TOUS les membres
+ // ========================================================================
+
+ /**
+ * Mes Finances - Menu personnel pour consulter/gérer ses propres finances
+ * Visible pour TOUS les membres (épargne, cotisations, prêts)
+ */
+ public boolean isMesFinancesMenuVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Événements - Calendrier et inscriptions aux événements
+ * Visible pour TOUS les membres
+ */
+ public boolean isMesEvenementsMenuVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Mes Demandes d'Aide Sociale - Menu personnel pour les demandes d'aide
+ * Visible pour TOUS les membres
+ */
+ public boolean isMesAidesSocialesMenuVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Mes Formations - Catalogue et inscriptions aux formations
+ * Visible pour TOUS les membres
+ */
+ public boolean isMesFormationsMenuVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Mes Communications - Messages et notifications personnelles
+ * Visible pour TOUS les membres
+ */
+ public boolean isMesCommunicationsMenuVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ // ========================================================================
+ // MENUS DE GESTION - Visible pour les responsables uniquement
+ // ========================================================================
+
+ /**
+ * Gestion des Membres - Administration des membres
+ * Visible pour SECRETAIRE et ADMIN uniquement
+ */
+ public boolean isGestionMembresMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE");
+ }
+
+ /**
+ * Annuaire des Membres - Consultation de la liste (pas de modification)
+ * Visible à partir de MEMBRE_ACTIF (pour créer du lien social)
+ */
+ public boolean isAnnuaireMembresVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE", "TRESORIER",
+ "RESPONSABLE_SOCIAL", "RESPONSABLE_EVENEMENTS", "RESPONSABLE_CREDIT",
+ "MEMBRE_BUREAU", "MEMBRE_ACTIF");
+ }
+
+ /**
+ * DEPRECATED: Utilisez isGestionMembresMenuVisible() ou isAnnuaireMembresVisible()
+ * @deprecated Remplacé par isGestionMembresMenuVisible() et isAnnuaireMembresVisible()
+ */
+ @Deprecated
+ public boolean isMembresMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE", "MEMBRE_BUREAU", "MEMBRE_ACTIF");
+ }
+
+ /**
+ * Gestion Financière - Administration finances (trésorerie, budgets, comptabilité)
+ * Visible pour TRESORIER et ADMIN uniquement
+ */
+ public boolean isGestionFinancesMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER");
+ }
+
+ /**
+ * Gestion Événements - Création et organisation des événements
+ * Visible pour RESPONSABLE_EVENEMENTS, SECRETAIRE et ADMIN
+ */
+ public boolean isGestionEvenementsMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE", "RESPONSABLE_EVENEMENTS");
+ }
+
+ /**
+ * Gestion Aide Sociale - Traitement des demandes d'aide
+ * Visible pour RESPONSABLE_SOCIAL et ADMIN
+ */
+ public boolean isGestionAidesSocialesMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "RESPONSABLE_SOCIAL");
+ }
+
+ /**
+ * Organisations - Visible pour admins et super-admins
+ */
+ public boolean isOrganisationsMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION");
+ }
+
+ /**
+ * Adhésions - Visible pour admins, secrétaires, bureau
+ */
+ public boolean isAdhesionsMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE", "MEMBRE_BUREAU");
+ }
+
+ /**
+ * DEPRECATED: Utilisez isGestionFinancesMenuVisible() ou isMesFinancesMenuVisible()
+ * @deprecated Remplacé par isGestionFinancesMenuVisible() (admin) et isMesFinancesMenuVisible() (membre)
+ */
+ @Deprecated
+ public boolean isFinancesMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER", "RESPONSABLE_CREDIT", "MEMBRE_BUREAU");
+ }
+
+ /**
+ * DEPRECATED: Utilisez isGestionAidesSocialesMenuVisible() ou isMesAidesSocialesMenuVisible()
+ * @deprecated Remplacé par isGestionAidesSocialesMenuVisible() (admin) et isMesAidesSocialesMenuVisible() (membre)
+ */
+ @Deprecated
+ public boolean isAidesMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "RESPONSABLE_SOCIAL", "SECRETAIRE", "MEMBRE_BUREAU");
+ }
+
+ /**
+ * DEPRECATED: Utilisez isGestionEvenementsMenuVisible() ou isMesEvenementsMenuVisible()
+ * @deprecated Remplacé par isGestionEvenementsMenuVisible() (admin) et isMesEvenementsMenuVisible() (membre)
+ */
+ @Deprecated
+ public boolean isEvenementsMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "RESPONSABLE_EVENEMENTS", "SECRETAIRE", "MEMBRE_BUREAU", "MEMBRE_ACTIF");
+ }
+
+ /**
+ * Communication - Visible pour admins, secrétaires, bureau
+ */
+ public boolean isCommunicationMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE", "RESPONSABLE_EVENEMENTS", "MEMBRE_BUREAU");
+ }
+
+ /**
+ * Documents - Visible pour tous sauf membres simples
+ */
+ public boolean isDocumentsMenuVisible() {
+ return !hasAnyRole("MEMBRE_SIMPLE");
+ }
+
+ /**
+ * Formation - Visible pour tous les membres actifs et plus
+ */
+ public boolean isFormationMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE", "MEMBRE_BUREAU", "MEMBRE_ACTIF");
+ }
+
+ /**
+ * Rapports et Analyses - Visible pour admins, trésoriers, secrétaires, bureau
+ */
+ public boolean isRapportsMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER", "SECRETAIRE", "MEMBRE_BUREAU");
+ }
+
+ /**
+ * Outils et Utilitaires - Visible pour admins et secrétaires
+ */
+ public boolean isOutilsMenuVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE", "MEMBRE_BUREAU");
+ }
+
+ /**
+ * Mon Espace Personnel - Visible pour tous les utilisateurs connectés
+ */
+ public boolean isPersonnelMenuVisible() {
+ return true; // Tous les utilisateurs connectés
+ }
+
+ /**
+ * Aide et Support - Visible pour tous
+ */
+ public boolean isAideMenuVisible() {
+ return true; // Tous les utilisateurs
+ }
+
+ // ========================================================================
+ // ITEMS DE MENUS PERSONNELS - Actions membre
+ // ========================================================================
+
+ /**
+ * Consulter mon épargne - Visible pour TOUS
+ */
+ public boolean isMonEpargneVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Payer mes cotisations - Visible pour TOUS
+ */
+ public boolean isPaiementCotisationVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Demander un prêt/crédit - Visible pour TOUS
+ */
+ public boolean isDemandePretVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Mes prêts en cours - Visible pour TOUS
+ */
+ public boolean isMesPretsVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Demander une aide sociale - Visible pour TOUS
+ */
+ public boolean isDemandeAideSocialeVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Mes demandes d'aide en cours - Visible pour TOUS
+ */
+ public boolean isMesDemandesAideVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * M'inscrire à un événement - Visible pour TOUS
+ */
+ public boolean isInscriptionEvenementVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Mes inscriptions aux événements - Visible pour TOUS
+ */
+ public boolean isMesInscriptionsEvenementsVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * M'inscrire à une formation - Visible pour TOUS
+ */
+ public boolean isInscriptionFormationVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Mes formations - Visible pour TOUS
+ */
+ public boolean isMesFormationsVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Mes messages personnels - Visible pour TOUS
+ */
+ public boolean isMesMessagesVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ /**
+ * Annonces officielles (lecture seule) - Visible pour TOUS
+ */
+ public boolean isAnnoncesLectureVisible() {
+ return !securityIdentity.isAnonymous();
+ }
+
+ // ========================================================================
+ // ITEMS DE MENUS SPÉCIFIQUES - Administration
+ // ========================================================================
+
+ /**
+ * Items Keycloak User Manager - Visible uniquement pour SUPER_ADMIN
+ */
+ public boolean isKeycloakUserManagerVisible() {
+ return hasAnyRole("SUPER_ADMIN");
+ }
+
+ /**
+ * Gestion des cotisations (admin) - Visible pour admins et trésoriers
+ */
+ public boolean isCotisationsAdminVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER");
+ }
+
+ /**
+ * Comptabilité - Visible pour admins et trésoriers
+ */
+ public boolean isComptabiliteVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER");
+ }
+
+ /**
+ * Trésorerie - Visible pour admins et trésoriers
+ */
+ public boolean isTresorerieVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER");
+ }
+
+ /**
+ * Épargne/Crédit (spécifique mutuelles) - Visible pour trésoriers et responsables crédit
+ */
+ public boolean isEpargneCreditVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER", "RESPONSABLE_CREDIT");
+ }
+
+ /**
+ * Inscription de membres - Visible pour admins et secrétaires
+ */
+ public boolean isInscriptionMembreVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE");
+ }
+
+ /**
+ * Import/Export de membres - Visible pour admins et secrétaires
+ */
+ public boolean isImportExportMembreVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE");
+ }
+
+ /**
+ * Validation des adhésions - Visible pour admins et secrétaires
+ */
+ public boolean isValidationAdhesionVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE");
+ }
+
+ /**
+ * Traitement des demandes d'aide - Visible pour admins et responsables sociaux
+ */
+ public boolean isTraitementAideVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "RESPONSABLE_SOCIAL");
+ }
+
+ /**
+ * Évaluation sociale - Visible pour responsables sociaux
+ */
+ public boolean isEvaluationSocialeVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "RESPONSABLE_SOCIAL");
+ }
+
+ /**
+ * Création d'événements - Visible pour admins et responsables événements
+ */
+ public boolean isCreationEvenementVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "RESPONSABLE_EVENEMENTS", "SECRETAIRE");
+ }
+
+ /**
+ * Logistique événements - Visible pour responsables événements
+ */
+ public boolean isLogistiqueEvenementVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "RESPONSABLE_EVENEMENTS");
+ }
+
+ /**
+ * Envoi SMS/Email - Visible pour admins et secrétaires
+ */
+ public boolean isCommunicationMasseVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "SECRETAIRE");
+ }
+
+ /**
+ * Sauvegardes et maintenance - Visible uniquement pour SUPER_ADMIN
+ */
+ public boolean isMaintenanceVisible() {
+ return hasAnyRole("SUPER_ADMIN");
+ }
+
+ /**
+ * Rapports financiers - Visible pour admins et trésoriers
+ */
+ public boolean isRapportFinancierVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER");
+ }
+
+ /**
+ * Exports personnalisés - Visible pour admins, trésoriers, secrétaires
+ */
+ public boolean isExportsPersonnalisesVisible() {
+ return hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER", "SECRETAIRE");
+ }
+
+ // ========================================================================
+ // HELPERS
+ // ========================================================================
+
+ /**
+ * Vérifie si l'utilisateur est un super-admin
+ */
+ public boolean isSuperAdmin() {
+ return hasAnyRole("SUPER_ADMIN");
+ }
+
+ /**
+ * Vérifie si l'utilisateur est un admin d'organisation
+ */
+ public boolean isAdminOrganisation() {
+ return hasAnyRole("ADMIN_ORGANISATION");
+ }
+
+ /**
+ * Vérifie si l'utilisateur est un trésorier
+ */
+ public boolean isTresorier() {
+ return hasAnyRole("TRESORIER");
+ }
+
+ /**
+ * Vérifie si l'utilisateur est un secrétaire
+ */
+ public boolean isSecretaire() {
+ return hasAnyRole("SECRETAIRE");
+ }
+
+ /**
+ * Vérifie si l'utilisateur est un responsable social
+ */
+ public boolean isResponsableSocial() {
+ return hasAnyRole("RESPONSABLE_SOCIAL");
+ }
+
+ /**
+ * Vérifie si l'utilisateur est un responsable événements
+ */
+ public boolean isResponsableEvenements() {
+ return hasAnyRole("RESPONSABLE_EVENEMENTS");
+ }
+
+ /**
+ * Vérifie si l'utilisateur est un responsable crédit
+ */
+ public boolean isResponsableCredit() {
+ return hasAnyRole("RESPONSABLE_CREDIT");
+ }
+
+ /**
+ * Vérifie si l'utilisateur est membre du bureau
+ */
+ public boolean isMembreBureau() {
+ return hasAnyRole("MEMBRE_BUREAU");
+ }
+
+ /**
+ * Vérifie si l'utilisateur est membre actif
+ */
+ public boolean isMembreActif() {
+ return hasAnyRole("MEMBRE_ACTIF");
+ }
+
+ /**
+ * Vérifie si l'utilisateur est membre simple
+ */
+ public boolean isMembreSimple() {
+ return hasAnyRole("MEMBRE_SIMPLE");
+ }
+}
diff --git a/src/main/java/dev/lions/unionflow/client/config/QuarkusApplicationFactory.java b/src/main/java/dev/lions/unionflow/client/config/QuarkusApplicationFactory.java
new file mode 100644
index 0000000..f8b6735
--- /dev/null
+++ b/src/main/java/dev/lions/unionflow/client/config/QuarkusApplicationFactory.java
@@ -0,0 +1,55 @@
+package dev.lions.unionflow.client.config;
+
+import dev.lions.unionflow.client.el.QuarkusArcELResolver;
+import jakarta.faces.application.Application;
+import jakarta.faces.application.ApplicationFactory;
+import org.jboss.logging.Logger;
+
+/**
+ * ApplicationFactory personnalisé pour Quarkus Arc.
+ *
+ *
Cette factory configure l'Application JSF pour utiliser notre ELResolverBuilder
+ * personnalisé qui ne tente pas d'obtenir le resolver CDI via BeanManager.getELResolver().
+ *
+ * @author UnionFlow Team
+ * @version 1.0
+ */
+public class QuarkusApplicationFactory extends ApplicationFactory {
+
+ private static final Logger LOG = Logger.getLogger(QuarkusApplicationFactory.class);
+
+ private ApplicationFactory delegate;
+ private Application application;
+
+ public QuarkusApplicationFactory(ApplicationFactory delegate) {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public Application getApplication() {
+ if (application == null) {
+ application = delegate.getApplication();
+
+ // Configurer notre ELResolverBuilder personnalisé
+ try {
+ LOG.info("Configuration de l'ELResolverBuilder personnalisé pour Quarkus Arc");
+
+ // Ajouter notre resolver personnalisé
+ application.addELResolver(new QuarkusArcELResolver());
+
+ LOG.info("ELResolver personnalisé configuré avec succès");
+ } catch (Exception e) {
+ LOG.error("Erreur lors de la configuration de l'ELResolver personnalisé", e);
+ // Ne pas bloquer le démarrage si la configuration échoue
+ }
+ }
+ return application;
+ }
+
+ @Override
+ public void setApplication(Application application) {
+ this.application = application;
+ delegate.setApplication(application);
+ }
+}
+
diff --git a/src/main/java/dev/lions/unionflow/client/converter/MembreConverter.java b/src/main/java/dev/lions/unionflow/client/converter/MembreConverter.java
index 7ed355a..d56f007 100644
--- a/src/main/java/dev/lions/unionflow/client/converter/MembreConverter.java
+++ b/src/main/java/dev/lions/unionflow/client/converter/MembreConverter.java
@@ -41,4 +41,4 @@ public class MembreConverter implements Converter {
}
return value.getId().toString();
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/dev/lions/unionflow/client/dto/AdhesionDTO.java b/src/main/java/dev/lions/unionflow/client/dto/AdhesionDTO.java
deleted file mode 100644
index d0e0702..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/AdhesionDTO.java
+++ /dev/null
@@ -1,274 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.time.temporal.ChronoUnit;
-import java.util.UUID;
-
-/**
- * DTO pour la gestion des adhésions côté client
- * Correspond au AdhesionDTO du backend avec méthodes utilitaires pour l'affichage
- *
- * @author UnionFlow Team
- * @version 1.0
- */
-public class AdhesionDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private UUID id;
- private String numeroReference;
- private UUID membreId;
- private String numeroMembre;
- private String nomMembre;
- private String emailMembre;
- private UUID organisationId;
- private String nomOrganisation;
- private LocalDate dateDemande;
- private BigDecimal fraisAdhesion;
- private BigDecimal montantPaye;
- private String codeDevise;
- private String statut;
- private LocalDate dateApprobation;
- private LocalDateTime datePaiement;
- private String methodePaiement;
- private String referencePaiement;
- private String motifRejet;
- private String observations;
- private String approuvePar;
- private LocalDate dateValidation;
- private LocalDateTime dateCreation;
- private LocalDateTime dateModification;
- private Boolean actif;
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getNumeroReference() { return numeroReference; }
- public void setNumeroReference(String numeroReference) { this.numeroReference = numeroReference; }
-
- public UUID getMembreId() { return membreId; }
- public void setMembreId(UUID membreId) { this.membreId = membreId; }
-
- public String getNumeroMembre() { return numeroMembre; }
- public void setNumeroMembre(String numeroMembre) { this.numeroMembre = numeroMembre; }
-
- public String getNomMembre() { return nomMembre; }
- public void setNomMembre(String nomMembre) { this.nomMembre = nomMembre; }
-
- public String getEmailMembre() { return emailMembre; }
- public void setEmailMembre(String emailMembre) { this.emailMembre = emailMembre; }
-
- public UUID getOrganisationId() { return organisationId; }
- public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; }
-
- public String getNomOrganisation() { return nomOrganisation; }
- public void setNomOrganisation(String nomOrganisation) { this.nomOrganisation = nomOrganisation; }
-
- public LocalDate getDateDemande() { return dateDemande; }
- public void setDateDemande(LocalDate dateDemande) { this.dateDemande = dateDemande; }
-
- public BigDecimal getFraisAdhesion() { return fraisAdhesion; }
- public void setFraisAdhesion(BigDecimal fraisAdhesion) { this.fraisAdhesion = fraisAdhesion; }
-
- public BigDecimal getMontantPaye() { return montantPaye != null ? montantPaye : BigDecimal.ZERO; }
- public void setMontantPaye(BigDecimal montantPaye) { this.montantPaye = montantPaye; }
-
- public String getCodeDevise() { return codeDevise; }
- public void setCodeDevise(String codeDevise) { this.codeDevise = codeDevise; }
-
- public String getStatut() { return statut; }
- public void setStatut(String statut) { this.statut = statut; }
-
- public LocalDate getDateApprobation() { return dateApprobation; }
- public void setDateApprobation(LocalDate dateApprobation) { this.dateApprobation = dateApprobation; }
-
- public LocalDateTime getDatePaiement() { return datePaiement; }
- public void setDatePaiement(LocalDateTime datePaiement) { this.datePaiement = datePaiement; }
-
- public String getMethodePaiement() { return methodePaiement; }
- public void setMethodePaiement(String methodePaiement) { this.methodePaiement = methodePaiement; }
-
- public String getReferencePaiement() { return referencePaiement; }
- public void setReferencePaiement(String referencePaiement) { this.referencePaiement = referencePaiement; }
-
- public String getMotifRejet() { return motifRejet; }
- public void setMotifRejet(String motifRejet) { this.motifRejet = motifRejet; }
-
- public String getObservations() { return observations; }
- public void setObservations(String observations) { this.observations = observations; }
-
- public String getApprouvePar() { return approuvePar; }
- public void setApprouvePar(String approuvePar) { this.approuvePar = approuvePar; }
-
- public LocalDate getDateValidation() { return dateValidation; }
- public void setDateValidation(LocalDate dateValidation) { this.dateValidation = dateValidation; }
-
- public LocalDateTime getDateCreation() { return dateCreation; }
- public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
-
- public LocalDateTime getDateModification() { return dateModification; }
- public void setDateModification(LocalDateTime dateModification) { this.dateModification = dateModification; }
-
- public Boolean getActif() { return actif; }
- public void setActif(Boolean actif) { this.actif = actif; }
-
- // Méthodes utilitaires pour l'affichage (alignées avec le backend)
-
- /**
- * Vérifie si l'adhésion est payée intégralement
- */
- public boolean isPayeeIntegralement() {
- return montantPaye != null && fraisAdhesion != null && montantPaye.compareTo(fraisAdhesion) >= 0;
- }
-
- /**
- * Vérifie si l'adhésion est en attente de paiement
- */
- public boolean isEnAttentePaiement() {
- return "APPROUVEE".equals(statut) && !isPayeeIntegralement();
- }
-
- /**
- * Calcule le montant restant à payer
- */
- public BigDecimal getMontantRestant() {
- if (fraisAdhesion == null) return BigDecimal.ZERO;
- if (montantPaye == null) return fraisAdhesion;
- BigDecimal restant = fraisAdhesion.subtract(montantPaye);
- return restant.compareTo(BigDecimal.ZERO) > 0 ? restant : BigDecimal.ZERO;
- }
-
- /**
- * Calcule le pourcentage de paiement
- */
- public int getPourcentagePaiement() {
- if (fraisAdhesion == null || fraisAdhesion.compareTo(BigDecimal.ZERO) == 0) return 0;
- if (montantPaye == null) return 0;
- return montantPaye.multiply(BigDecimal.valueOf(100))
- .divide(fraisAdhesion, 0, java.math.RoundingMode.HALF_UP)
- .intValue();
- }
-
- /**
- * Calcule le nombre de jours depuis la demande
- */
- public long getJoursDepuisDemande() {
- if (dateDemande == null) return 0;
- return ChronoUnit.DAYS.between(dateDemande, LocalDate.now());
- }
-
- /**
- * Retourne le libellé du statut
- */
- public String getStatutLibelle() {
- if (statut == null) return "Non défini";
- return switch (statut) {
- case "EN_ATTENTE" -> "En attente";
- case "APPROUVEE" -> "Approuvée";
- case "REJETEE" -> "Rejetée";
- case "ANNULEE" -> "Annulée";
- case "EN_PAIEMENT" -> "En paiement";
- case "PAYEE" -> "Payée";
- default -> statut;
- };
- }
-
- /**
- * Retourne la sévérité du statut pour PrimeFaces
- */
- public String getStatutSeverity() {
- if (statut == null) return "secondary";
- return switch (statut) {
- case "APPROUVEE", "PAYEE" -> "success";
- case "EN_ATTENTE", "EN_PAIEMENT" -> "warning";
- case "REJETEE" -> "danger";
- case "ANNULEE" -> "secondary";
- default -> "secondary";
- };
- }
-
- /**
- * Retourne l'icône du statut pour PrimeFaces
- */
- public String getStatutIcon() {
- if (statut == null) return "pi-circle";
- return switch (statut) {
- case "APPROUVEE", "PAYEE" -> "pi-check";
- case "EN_ATTENTE" -> "pi-clock";
- case "EN_PAIEMENT" -> "pi-credit-card";
- case "REJETEE" -> "pi-times";
- case "ANNULEE" -> "pi-ban";
- default -> "pi-circle";
- };
- }
-
- /**
- * Retourne le libellé de la méthode de paiement
- */
- public String getMethodePaiementLibelle() {
- if (methodePaiement == null) return "Non défini";
- return switch (methodePaiement) {
- case "ESPECES" -> "Espèces";
- case "VIREMENT" -> "Virement bancaire";
- case "CHEQUE" -> "Chèque";
- case "WAVE_MONEY" -> "Wave Money";
- case "ORANGE_MONEY" -> "Orange Money";
- case "FREE_MONEY" -> "Free Money";
- case "CARTE_BANCAIRE" -> "Carte bancaire";
- default -> methodePaiement;
- };
- }
-
- /**
- * Formate la date de demande
- */
- public String getDateDemandeFormatee() {
- if (dateDemande == null) return "";
- return dateDemande.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));
- }
-
- /**
- * Formate la date d'approbation
- */
- public String getDateApprobationFormatee() {
- if (dateApprobation == null) return "";
- return dateApprobation.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));
- }
-
- /**
- * Formate la date de paiement
- */
- public String getDatePaiementFormatee() {
- if (datePaiement == null) return "";
- return datePaiement.format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
- }
-
- /**
- * Formate les frais d'adhésion
- */
- public String getFraisAdhesionFormatte() {
- if (fraisAdhesion == null) return "0 FCFA";
- return String.format("%,.0f FCFA", fraisAdhesion.doubleValue());
- }
-
- /**
- * Formate le montant payé
- */
- public String getMontantPayeFormatte() {
- if (montantPaye == null) return "0 FCFA";
- return String.format("%,.0f FCFA", montantPaye.doubleValue());
- }
-
- /**
- * Formate le montant restant
- */
- public String getMontantRestantFormatte() {
- return String.format("%,.0f FCFA", getMontantRestant().doubleValue());
- }
-}
-
diff --git a/src/main/java/dev/lions/unionflow/client/dto/AnalyticsDataDTO.java b/src/main/java/dev/lions/unionflow/client/dto/AnalyticsDataDTO.java
deleted file mode 100644
index dc5650d..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/AnalyticsDataDTO.java
+++ /dev/null
@@ -1,300 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Map;
-
-/**
- * DTO côté client pour les données analytics
- * Enrichi avec des méthodes utilitaires pour l'affichage
- *
- * @author UnionFlow Team
- * @version 1.0
- * @since 2025-01-17
- */
-public class AnalyticsDataDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
- private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("dd/MM/yyyy");
- private static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm");
-
- private String id;
- private String typeMetrique;
- private String periodeAnalyse;
- private BigDecimal valeur;
- private BigDecimal valeurPrecedente;
- private BigDecimal pourcentageEvolution;
- private LocalDateTime dateDebut;
- private LocalDateTime dateFin;
- private LocalDateTime dateCalcul;
- private String organisationId;
- private String nomOrganisation;
- private String utilisateurId;
- private String nomUtilisateur;
- private String libellePersonnalise;
- private String description;
- private String donneesDetaillees;
- private String configurationGraphique;
- private Map metadonnees;
- private BigDecimal indicateurFiabilite;
- private Integer nombreElementsAnalyses;
- private Long tempsCalculMs;
- private Boolean tempsReel;
- private Boolean necessiteMiseAJour;
- private Integer niveauPriorite;
- private java.util.List tags;
-
- // Getters et Setters
- public String getId() { return id; }
- public void setId(String id) { this.id = id; }
-
- public String getTypeMetrique() { return typeMetrique; }
- public void setTypeMetrique(String typeMetrique) { this.typeMetrique = typeMetrique; }
-
- public String getPeriodeAnalyse() { return periodeAnalyse; }
- public void setPeriodeAnalyse(String periodeAnalyse) { this.periodeAnalyse = periodeAnalyse; }
-
- public BigDecimal getValeur() { return valeur; }
- public void setValeur(BigDecimal valeur) { this.valeur = valeur; }
-
- public BigDecimal getValeurPrecedente() { return valeurPrecedente; }
- public void setValeurPrecedente(BigDecimal valeurPrecedente) { this.valeurPrecedente = valeurPrecedente; }
-
- public BigDecimal getPourcentageEvolution() { return pourcentageEvolution; }
- public void setPourcentageEvolution(BigDecimal pourcentageEvolution) { this.pourcentageEvolution = pourcentageEvolution; }
-
- public LocalDateTime getDateDebut() { return dateDebut; }
- public void setDateDebut(LocalDateTime dateDebut) { this.dateDebut = dateDebut; }
-
- public LocalDateTime getDateFin() { return dateFin; }
- public void setDateFin(LocalDateTime dateFin) { this.dateFin = dateFin; }
-
- public LocalDateTime getDateCalcul() { return dateCalcul; }
- public void setDateCalcul(LocalDateTime dateCalcul) { this.dateCalcul = dateCalcul; }
-
- public String getOrganisationId() { return organisationId; }
- public void setOrganisationId(String organisationId) { this.organisationId = organisationId; }
-
- public String getNomOrganisation() { return nomOrganisation; }
- public void setNomOrganisation(String nomOrganisation) { this.nomOrganisation = nomOrganisation; }
-
- public String getUtilisateurId() { return utilisateurId; }
- public void setUtilisateurId(String utilisateurId) { this.utilisateurId = utilisateurId; }
-
- public String getNomUtilisateur() { return nomUtilisateur; }
- public void setNomUtilisateur(String nomUtilisateur) { this.nomUtilisateur = nomUtilisateur; }
-
- public String getLibellePersonnalise() { return libellePersonnalise; }
- public void setLibellePersonnalise(String libellePersonnalise) { this.libellePersonnalise = libellePersonnalise; }
-
- public String getDescription() { return description; }
- public void setDescription(String description) { this.description = description; }
-
- public String getDonneesDetaillees() { return donneesDetaillees; }
- public void setDonneesDetaillees(String donneesDetaillees) { this.donneesDetaillees = donneesDetaillees; }
-
- public String getConfigurationGraphique() { return configurationGraphique; }
- public void setConfigurationGraphique(String configurationGraphique) { this.configurationGraphique = configurationGraphique; }
-
- public Map getMetadonnees() { return metadonnees; }
- public void setMetadonnees(Map metadonnees) { this.metadonnees = metadonnees; }
-
- public BigDecimal getIndicateurFiabilite() { return indicateurFiabilite; }
- public void setIndicateurFiabilite(BigDecimal indicateurFiabilite) { this.indicateurFiabilite = indicateurFiabilite; }
-
- public Integer getNombreElementsAnalyses() { return nombreElementsAnalyses; }
- public void setNombreElementsAnalyses(Integer nombreElementsAnalyses) { this.nombreElementsAnalyses = nombreElementsAnalyses; }
-
- public Long getTempsCalculMs() { return tempsCalculMs; }
- public void setTempsCalculMs(Long tempsCalculMs) { this.tempsCalculMs = tempsCalculMs; }
-
- public Boolean getTempsReel() { return tempsReel; }
- public void setTempsReel(Boolean tempsReel) { this.tempsReel = tempsReel; }
-
- public Boolean getNecessiteMiseAJour() { return necessiteMiseAJour; }
- public void setNecessiteMiseAJour(Boolean necessiteMiseAJour) { this.necessiteMiseAJour = necessiteMiseAJour; }
-
- public Integer getNiveauPriorite() { return niveauPriorite; }
- public void setNiveauPriorite(Integer niveauPriorite) { this.niveauPriorite = niveauPriorite; }
-
- public java.util.List getTags() { return tags; }
- public void setTags(java.util.List tags) { this.tags = tags; }
-
- // === MÉTHODES UTILITAIRES ===
-
- /**
- * Retourne le libellé à afficher
- */
- public String getLibelleAffichage() {
- if (libellePersonnalise != null && !libellePersonnalise.trim().isEmpty()) {
- return libellePersonnalise;
- }
- return typeMetrique != null ? typeMetrique : "Métrique";
- }
-
- /**
- * Retourne la valeur formatée
- */
- public String getValeurFormatee() {
- if (valeur == null) return "0";
- return valeur.toPlainString();
- }
-
- /**
- * Retourne le pourcentage d'évolution formaté
- */
- public String getEvolutionFormatee() {
- if (pourcentageEvolution == null) return "0%";
- String signe = pourcentageEvolution.compareTo(BigDecimal.ZERO) >= 0 ? "+" : "";
- return signe + pourcentageEvolution.setScale(2, java.math.RoundingMode.HALF_UP) + "%";
- }
-
- /**
- * Retourne la couleur selon l'évolution
- */
- public String getCouleurEvolution() {
- if (pourcentageEvolution == null) return "text-600";
- if (pourcentageEvolution.compareTo(BigDecimal.ZERO) > 0) return "text-green-500";
- if (pourcentageEvolution.compareTo(BigDecimal.ZERO) < 0) return "text-red-500";
- return "text-600";
- }
-
- /**
- * Retourne l'icône selon l'évolution
- */
- public String getIconeEvolution() {
- if (pourcentageEvolution == null) return "pi pi-minus";
- if (pourcentageEvolution.compareTo(BigDecimal.ZERO) > 0) return "pi pi-arrow-up";
- if (pourcentageEvolution.compareTo(BigDecimal.ZERO) < 0) return "pi pi-arrow-down";
- return "pi pi-minus";
- }
-
- /**
- * Vérifie si l'évolution est positive
- */
- public boolean hasEvolutionPositive() {
- return pourcentageEvolution != null && pourcentageEvolution.compareTo(BigDecimal.ZERO) > 0;
- }
-
- /**
- * Vérifie si l'évolution est négative
- */
- public boolean hasEvolutionNegative() {
- return pourcentageEvolution != null && pourcentageEvolution.compareTo(BigDecimal.ZERO) < 0;
- }
-
- /**
- * Vérifie si les données sont fiables
- */
- public boolean isDonneesFiables() {
- return indicateurFiabilite != null && indicateurFiabilite.compareTo(new BigDecimal("80.0")) >= 0;
- }
-
- /**
- * Retourne la date de début formatée
- */
- public String getDateDebutFormatee() {
- if (dateDebut == null) return "";
- return dateDebut.format(DATE_FORMATTER);
- }
-
- /**
- * Retourne la date de fin formatée
- */
- public String getDateFinFormatee() {
- if (dateFin == null) return "";
- return dateFin.format(DATE_FORMATTER);
- }
-
- /**
- * Retourne la période formatée
- */
- public String getPeriodeFormatee() {
- return getDateDebutFormatee() + " - " + getDateFinFormatee();
- }
-
- /**
- * Convertit depuis une Map (réponse JSON du backend)
- */
- public static AnalyticsDataDTO fromMap(Map map) {
- AnalyticsDataDTO dto = new AnalyticsDataDTO();
- if (map == null) return dto;
-
- dto.setId((String) map.get("id"));
- dto.setTypeMetrique((String) map.get("typeMetrique"));
- dto.setPeriodeAnalyse((String) map.get("periodeAnalyse"));
-
- if (map.get("valeur") != null) {
- dto.setValeur(new BigDecimal(map.get("valeur").toString()));
- }
- if (map.get("valeurPrecedente") != null) {
- dto.setValeurPrecedente(new BigDecimal(map.get("valeurPrecedente").toString()));
- }
- if (map.get("pourcentageEvolution") != null) {
- dto.setPourcentageEvolution(new BigDecimal(map.get("pourcentageEvolution").toString()));
- }
-
- // Conversion des dates depuis des strings ISO
- if (map.get("dateDebut") != null) {
- dto.setDateDebut(parseDateTime(map.get("dateDebut").toString()));
- }
- if (map.get("dateFin") != null) {
- dto.setDateFin(parseDateTime(map.get("dateFin").toString()));
- }
- if (map.get("dateCalcul") != null) {
- dto.setDateCalcul(parseDateTime(map.get("dateCalcul").toString()));
- }
-
- dto.setOrganisationId((String) map.get("organisationId"));
- dto.setNomOrganisation((String) map.get("nomOrganisation"));
- dto.setUtilisateurId((String) map.get("utilisateurId"));
- dto.setNomUtilisateur((String) map.get("nomUtilisateur"));
- dto.setLibellePersonnalise((String) map.get("libellePersonnalise"));
- dto.setDescription((String) map.get("description"));
- dto.setDonneesDetaillees((String) map.get("donneesDetaillees"));
- dto.setConfigurationGraphique((String) map.get("configurationGraphique"));
- dto.setMetadonnees((Map) map.get("metadonnees"));
-
- if (map.get("indicateurFiabilite") != null) {
- dto.setIndicateurFiabilite(new BigDecimal(map.get("indicateurFiabilite").toString()));
- }
- if (map.get("nombreElementsAnalyses") != null) {
- dto.setNombreElementsAnalyses(Integer.valueOf(map.get("nombreElementsAnalyses").toString()));
- }
- if (map.get("tempsCalculMs") != null) {
- dto.setTempsCalculMs(Long.valueOf(map.get("tempsCalculMs").toString()));
- }
-
- dto.setTempsReel((Boolean) map.get("tempsReel"));
- dto.setNecessiteMiseAJour((Boolean) map.get("necessiteMiseAJour"));
- if (map.get("niveauPriorite") != null) {
- dto.setNiveauPriorite(Integer.valueOf(map.get("niveauPriorite").toString()));
- }
-
- @SuppressWarnings("unchecked")
- java.util.List tagsList = (java.util.List) map.get("tags");
- dto.setTags(tagsList);
-
- return dto;
- }
-
- /**
- * Parse une date depuis une string ISO
- */
- private static LocalDateTime parseDateTime(String dateStr) {
- if (dateStr == null || dateStr.isEmpty()) return null;
- try {
- // Format ISO: "2025-01-17T10:30:00" ou "2025-01-17 10:30:00"
- String normalized = dateStr.replace(" ", "T");
- if (normalized.length() == 10) {
- normalized += "T00:00:00";
- }
- return LocalDateTime.parse(normalized);
- } catch (Exception e) {
- return null;
- }
- }
-}
-
diff --git a/src/main/java/dev/lions/unionflow/client/dto/AssociationDTO.java b/src/main/java/dev/lions/unionflow/client/dto/AssociationDTO.java
deleted file mode 100644
index 8d2bfe9..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/AssociationDTO.java
+++ /dev/null
@@ -1,331 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotNull;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.UUID;
-
-/**
- * DTO client pour les organisations (alias historique Association).
- *
- * Harmonisé avec le contrat serveur `OrganisationDTO`:
- * - `dateCreation`/`dateModification` d'audit (LocalDateTime) alignés sur BaseDTO avec pattern JSON
- * - `dateFondation` (LocalDate) pour la date de création fonctionnelle de l'organisation
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class AssociationDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private UUID id;
-
- @NotBlank(message = "Le nom de l'association est obligatoire")
- private String nom;
-
- // Aligné sur OrganisationDTO.nomCourt
- private String nomCourt;
-
- private String description;
- private String adresse;
- private String telephone;
- private String email;
- private String siteWeb;
- // Aligné sur OrganisationDTO.logo (URL ou chemin du logo)
- private String logo;
-
- @NotNull(message = "Le type d'association est obligatoire")
- @JsonProperty("typeOrganisation")
- private String typeAssociation;
-
- // Date de fondation (fonctionnelle), côté serveur: OrganisationDTO.dateFondation
- @JsonProperty("dateFondation")
- @JsonFormat(pattern = "yyyy-MM-dd")
- private LocalDate dateFondation;
-
- // Côté serveur: OrganisationDTO.numeroEnregistrement
- @JsonProperty("numeroEnregistrement")
- private String numeroRegistre;
- private String statut;
- private Integer nombreMembres;
- // Aligné sur OrganisationDTO.nombreAdministrateurs
- private Integer nombreAdministrateurs;
- private String responsablePrincipal;
- private String telephoneResponsable;
- private String emailResponsable;
-
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime dateDerniereActivite;
-
- // Champs d'audit issus de BaseDTO (côté serveur)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime dateCreation;
-
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime dateModification;
-
- private Long version;
- private Boolean actif;
-
- private String region;
- private String ville;
- private String quartier;
- private String pays;
- // Aligné sur OrganisationDTO.codePostal
- private String codePostal;
-
- // Aligné sur OrganisationDTO.activitesPrincipales
- private String activitesPrincipales;
-
- // Aligné sur OrganisationDTO.objectifs / partenaires / certifications / reseauxSociaux / notes
- private String objectifs;
- private String partenaires;
- private String certifications;
- private String reseauxSociaux;
- private String notes;
-
- // Aligné sur OrganisationDTO.organisationPublique / accepteNouveauxMembres / cotisationObligatoire
- private Boolean organisationPublique;
- private Boolean accepteNouveauxMembres;
- private Boolean cotisationObligatoire;
-
- // Aligné sur OrganisationDTO.budgetAnnuel / devise / montantCotisationAnnuelle
- private BigDecimal budgetAnnuel;
- private String devise;
- private BigDecimal montantCotisationAnnuelle;
-
- // Aligné sur OrganisationDTO.telephoneSecondaire / emailSecondaire
- private String telephoneSecondaire;
- private String emailSecondaire;
-
- // Aligné sur OrganisationDTO.organisationParenteId / nomOrganisationParente / niveauHierarchique
- private UUID organisationParenteId;
- private String nomOrganisationParente;
- private Integer niveauHierarchique;
-
- // Aligné sur OrganisationDTO.latitude / longitude
- private BigDecimal latitude;
- private BigDecimal longitude;
-
- // Constructeurs
- public AssociationDTO() {}
-
- public AssociationDTO(String nom, String typeAssociation) {
- this.nom = nom;
- this.typeAssociation = typeAssociation;
- this.statut = "ACTIVE";
- this.dateFondation = LocalDate.now();
- this.nombreMembres = 0;
- }
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getNom() { return nom; }
- public void setNom(String nom) { this.nom = nom; }
-
- public String getNomCourt() { return nomCourt; }
- public void setNomCourt(String nomCourt) { this.nomCourt = nomCourt; }
-
- public String getDescription() { return description; }
- public void setDescription(String description) { this.description = description; }
-
- public String getAdresse() { return adresse; }
- public void setAdresse(String adresse) { this.adresse = adresse; }
-
- public String getTelephone() { return telephone; }
- public void setTelephone(String telephone) { this.telephone = telephone; }
-
- public String getEmail() { return email; }
- public void setEmail(String email) { this.email = email; }
-
- public String getSiteWeb() { return siteWeb; }
- public void setSiteWeb(String siteWeb) { this.siteWeb = siteWeb; }
-
- public String getLogo() { return logo; }
- public void setLogo(String logo) { this.logo = logo; }
-
- public String getTypeAssociation() { return typeAssociation; }
- public void setTypeAssociation(String typeAssociation) { this.typeAssociation = typeAssociation; }
-
- public LocalDate getDateFondation() { return dateFondation; }
- public void setDateFondation(LocalDate dateFondation) { this.dateFondation = dateFondation; }
-
- public String getNumeroRegistre() { return numeroRegistre; }
- public void setNumeroRegistre(String numeroRegistre) { this.numeroRegistre = numeroRegistre; }
-
- public String getStatut() { return statut; }
- public void setStatut(String statut) { this.statut = statut; }
-
- public Integer getNombreMembres() { return nombreMembres; }
- public void setNombreMembres(Integer nombreMembres) { this.nombreMembres = nombreMembres; }
-
- public Integer getNombreAdministrateurs() { return nombreAdministrateurs; }
- public void setNombreAdministrateurs(Integer nombreAdministrateurs) { this.nombreAdministrateurs = nombreAdministrateurs; }
-
- public String getResponsablePrincipal() { return responsablePrincipal; }
- public void setResponsablePrincipal(String responsablePrincipal) { this.responsablePrincipal = responsablePrincipal; }
-
- public String getTelephoneResponsable() { return telephoneResponsable; }
- public void setTelephoneResponsable(String telephoneResponsable) { this.telephoneResponsable = telephoneResponsable; }
-
- public String getEmailResponsable() { return emailResponsable; }
- public void setEmailResponsable(String emailResponsable) { this.emailResponsable = emailResponsable; }
-
- public LocalDateTime getDateDerniereActivite() { return dateDerniereActivite; }
- public void setDateDerniereActivite(LocalDateTime dateDerniereActivite) { this.dateDerniereActivite = dateDerniereActivite; }
-
- public String getRegion() { return region; }
- public void setRegion(String region) { this.region = region; }
-
- public String getVille() { return ville; }
- public void setVille(String ville) { this.ville = ville; }
-
- public String getQuartier() { return quartier; }
- public void setQuartier(String quartier) { this.quartier = quartier; }
-
- public String getPays() { return pays; }
- public void setPays(String pays) { this.pays = pays; }
-
- public String getCodePostal() { return codePostal; }
- public void setCodePostal(String codePostal) { this.codePostal = codePostal; }
-
- public String getActivitesPrincipales() { return activitesPrincipales; }
- public void setActivitesPrincipales(String activitesPrincipales) { this.activitesPrincipales = activitesPrincipales; }
-
- public String getObjectifs() { return objectifs; }
- public void setObjectifs(String objectifs) { this.objectifs = objectifs; }
-
- public String getPartenaires() { return partenaires; }
- public void setPartenaires(String partenaires) { this.partenaires = partenaires; }
-
- public String getCertifications() { return certifications; }
- public void setCertifications(String certifications) { this.certifications = certifications; }
-
- public String getReseauxSociaux() { return reseauxSociaux; }
- public void setReseauxSociaux(String reseauxSociaux) { this.reseauxSociaux = reseauxSociaux; }
-
- public String getNotes() { return notes; }
- public void setNotes(String notes) { this.notes = notes; }
-
- public Boolean getOrganisationPublique() { return organisationPublique; }
- public void setOrganisationPublique(Boolean organisationPublique) { this.organisationPublique = organisationPublique; }
-
- public Boolean getAccepteNouveauxMembres() { return accepteNouveauxMembres; }
- public void setAccepteNouveauxMembres(Boolean accepteNouveauxMembres) { this.accepteNouveauxMembres = accepteNouveauxMembres; }
-
- public Boolean getCotisationObligatoire() { return cotisationObligatoire; }
- public void setCotisationObligatoire(Boolean cotisationObligatoire) { this.cotisationObligatoire = cotisationObligatoire; }
-
- public BigDecimal getBudgetAnnuel() { return budgetAnnuel; }
- public void setBudgetAnnuel(BigDecimal budgetAnnuel) { this.budgetAnnuel = budgetAnnuel; }
-
- public String getDevise() { return devise; }
- public void setDevise(String devise) { this.devise = devise; }
-
- public BigDecimal getMontantCotisationAnnuelle() { return montantCotisationAnnuelle; }
- public void setMontantCotisationAnnuelle(BigDecimal montantCotisationAnnuelle) { this.montantCotisationAnnuelle = montantCotisationAnnuelle; }
-
- public String getTelephoneSecondaire() { return telephoneSecondaire; }
- public void setTelephoneSecondaire(String telephoneSecondaire) { this.telephoneSecondaire = telephoneSecondaire; }
-
- public String getEmailSecondaire() { return emailSecondaire; }
- public void setEmailSecondaire(String emailSecondaire) { this.emailSecondaire = emailSecondaire; }
-
- public UUID getOrganisationParenteId() { return organisationParenteId; }
- public void setOrganisationParenteId(UUID organisationParenteId) { this.organisationParenteId = organisationParenteId; }
-
- public String getNomOrganisationParente() { return nomOrganisationParente; }
- public void setNomOrganisationParente(String nomOrganisationParente) { this.nomOrganisationParente = nomOrganisationParente; }
-
- public Integer getNiveauHierarchique() { return niveauHierarchique; }
- public void setNiveauHierarchique(Integer niveauHierarchique) { this.niveauHierarchique = niveauHierarchique; }
-
- public BigDecimal getLatitude() { return latitude; }
- public void setLatitude(BigDecimal latitude) { this.latitude = latitude; }
-
- public BigDecimal getLongitude() { return longitude; }
- public void setLongitude(BigDecimal longitude) { this.longitude = longitude; }
-
- public LocalDateTime getDateCreation() { return dateCreation; }
- public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
-
- public LocalDateTime getDateModification() { return dateModification; }
- public void setDateModification(LocalDateTime dateModification) { this.dateModification = dateModification; }
-
- public Long getVersion() { return version; }
- public void setVersion(Long version) { this.version = version; }
-
- public Boolean getActif() { return actif; }
- public void setActif(Boolean actif) { this.actif = actif; }
-
- // Propriétés dérivées
- public String getTypeLibelle() {
- return switch (typeAssociation != null ? typeAssociation : "") {
- case "LIONS_CLUB" -> "Club Lions";
- case "ASSOCIATION_LOCALE" -> "Association Locale";
- case "FEDERATION" -> "Fédération";
- case "COOPERATIVE" -> "Coopérative";
- case "MUTUELLE" -> "Mutuelle";
- case "SYNDICAT" -> "Syndicat";
- default -> typeAssociation;
- };
- }
-
- public String getStatutLibelle() {
- return switch (statut != null ? statut : "") {
- case "ACTIVE" -> "Active";
- case "INACTIVE" -> "Inactive";
- case "SUSPENDUE" -> "Suspendue";
- case "DISSOUTE" -> "Dissoute";
- default -> statut;
- };
- }
-
- public String getStatutSeverity() {
- return switch (statut != null ? statut : "") {
- case "ACTIVE" -> "success";
- case "INACTIVE" -> "warning";
- case "SUSPENDUE" -> "danger";
- case "DISSOUTE" -> "secondary";
- default -> "info";
- };
- }
-
- public String getAdresseComplete() {
- StringBuilder addr = new StringBuilder();
- if (adresse != null && !adresse.trim().isEmpty()) {
- addr.append(adresse);
- }
- if (quartier != null && !quartier.trim().isEmpty()) {
- if (addr.length() > 0) addr.append(", ");
- addr.append(quartier);
- }
- if (ville != null && !ville.trim().isEmpty()) {
- if (addr.length() > 0) addr.append(", ");
- addr.append(ville);
- }
- if (region != null && !region.trim().isEmpty()) {
- if (addr.length() > 0) addr.append(", ");
- addr.append(region);
- }
- return addr.toString();
- }
-
- @Override
- public String toString() {
- return "AssociationDTO{" +
- "id=" + id +
- ", nom='" + nom + '\'' +
- ", typeAssociation='" + typeAssociation + '\'' +
- ", statut='" + statut + '\'' +
- ", nombreMembres=" + nombreMembres +
- '}';
- }
-}
\ No newline at end of file
diff --git a/src/main/java/dev/lions/unionflow/client/dto/AuditLogDTO.java b/src/main/java/dev/lions/unionflow/client/dto/AuditLogDTO.java
deleted file mode 100644
index 0a6d6cd..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/AuditLogDTO.java
+++ /dev/null
@@ -1,185 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.UUID;
-
-/**
- * DTO côté client pour les logs d'audit
- * Correspond au AuditLogDTO du backend avec méthodes utilitaires pour l'affichage
- *
- * @author UnionFlow Team
- * @version 1.0
- */
-public class AuditLogDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private UUID id;
- private String typeAction;
- private String severite;
- private String utilisateur;
- private String role;
- private String module;
- private String description;
- private String details;
- private String ipAddress;
- private String userAgent;
- private String sessionId;
- private LocalDateTime dateHeure;
- private String donneesAvant;
- private String donneesApres;
- private String entiteId;
- private String entiteType;
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getTypeAction() { return typeAction; }
- public void setTypeAction(String typeAction) { this.typeAction = typeAction; }
-
- public String getSeverite() { return severite; }
- public void setSeverite(String severite) { this.severite = severite; }
-
- public String getUtilisateur() { return utilisateur; }
- public void setUtilisateur(String utilisateur) { this.utilisateur = utilisateur; }
-
- public String getRole() { return role; }
- public void setRole(String role) { this.role = role; }
-
- public String getModule() { return module; }
- public void setModule(String module) { this.module = module; }
-
- public String getDescription() { return description; }
- public void setDescription(String description) { this.description = description; }
-
- public String getDetails() { return details; }
- public void setDetails(String details) { this.details = details; }
-
- public String getIpAddress() { return ipAddress; }
- public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; }
-
- public String getUserAgent() { return userAgent; }
- public void setUserAgent(String userAgent) { this.userAgent = userAgent; }
-
- public String getSessionId() { return sessionId; }
- public void setSessionId(String sessionId) { this.sessionId = sessionId; }
-
- public LocalDateTime getDateHeure() { return dateHeure; }
- public void setDateHeure(LocalDateTime dateHeure) { this.dateHeure = dateHeure; }
-
- public String getDonneesAvant() { return donneesAvant; }
- public void setDonneesAvant(String donneesAvant) { this.donneesAvant = donneesAvant; }
-
- public String getDonneesApres() { return donneesApres; }
- public void setDonneesApres(String donneesApres) { this.donneesApres = donneesApres; }
-
- public String getEntiteId() { return entiteId; }
- public void setEntiteId(String entiteId) { this.entiteId = entiteId; }
-
- public String getEntiteType() { return entiteType; }
- public void setEntiteType(String entiteType) { this.entiteType = entiteType; }
-
- // Méthodes utilitaires pour l'affichage
-
- public String getDateFormatee() {
- if (dateHeure == null) return "";
- return dateHeure.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));
- }
-
- public String getHeureFormatee() {
- if (dateHeure == null) return "";
- return dateHeure.format(DateTimeFormatter.ofPattern("HH:mm:ss"));
- }
-
- public String getDateHeureComplete() {
- if (dateHeure == null) return "";
- return dateHeure.format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss"));
- }
-
- public String getSeveriteLibelle() {
- if (severite == null) return "";
- return switch (severite) {
- case "SUCCESS" -> "Succès";
- case "INFO" -> "Info";
- case "WARNING" -> "Attention";
- case "ERROR" -> "Erreur";
- case "CRITICAL" -> "Critique";
- default -> severite;
- };
- }
-
- public String getSeveriteSeverity() {
- if (severite == null) return "secondary";
- return switch (severite) {
- case "SUCCESS" -> "success";
- case "INFO" -> "info";
- case "WARNING" -> "warning";
- case "ERROR", "CRITICAL" -> "danger";
- default -> "secondary";
- };
- }
-
- public String getSeveriteIcon() {
- if (severite == null) return "pi pi-circle";
- return switch (severite) {
- case "SUCCESS" -> "pi pi-check";
- case "INFO" -> "pi pi-info";
- case "WARNING" -> "pi pi-exclamation-triangle";
- case "ERROR" -> "pi pi-times";
- case "CRITICAL" -> "pi pi-ban";
- default -> "pi pi-circle";
- };
- }
-
- public String getActionIcon() {
- if (typeAction == null) return "pi pi-circle";
- return switch (typeAction) {
- case "CONNEXION" -> "pi pi-sign-in";
- case "DECONNEXION" -> "pi pi-sign-out";
- case "CREATION" -> "pi pi-plus";
- case "MODIFICATION" -> "pi pi-pencil";
- case "SUPPRESSION" -> "pi pi-trash";
- case "CONSULTATION" -> "pi pi-eye";
- case "EXPORT" -> "pi pi-download";
- case "CONFIGURATION" -> "pi pi-cog";
- default -> "pi pi-circle";
- };
- }
-
- public String getActionLibelle() {
- if (typeAction == null) return "";
- return switch (typeAction) {
- case "CONNEXION" -> "Connexion";
- case "DECONNEXION" -> "Déconnexion";
- case "CREATION" -> "Création";
- case "MODIFICATION" -> "Modification";
- case "SUPPRESSION" -> "Suppression";
- case "CONSULTATION" -> "Consultation";
- case "EXPORT" -> "Export";
- case "CONFIGURATION" -> "Configuration";
- default -> typeAction;
- };
- }
-
- public String getModuleLibelle() {
- if (module == null) return "";
- return switch (module) {
- case "AUTH" -> "Authentification";
- case "MEMBRES" -> "Membres";
- case "COTISATIONS" -> "Cotisations";
- case "EVENTS" -> "Événements";
- case "DOCUMENTS" -> "Documents";
- case "CONFIG" -> "Configuration";
- case "RAPPORTS" -> "Rapports";
- default -> module;
- };
- }
-
- public String getUserAgentCourt() {
- if (userAgent == null || userAgent.isEmpty()) return "";
- return userAgent.length() > 50 ? userAgent.substring(0, 50) + "..." : userAgent;
- }
-}
diff --git a/src/main/java/dev/lions/unionflow/client/dto/CotisationDTO.java b/src/main/java/dev/lions/unionflow/client/dto/CotisationDTO.java
deleted file mode 100644
index 218b4d3..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/CotisationDTO.java
+++ /dev/null
@@ -1,270 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.time.temporal.ChronoUnit;
-import java.util.UUID;
-
-/**
- * DTO pour la gestion des cotisations côté client
- * Correspond au CotisationDTO du backend avec méthodes utilitaires pour l'affichage
- *
- * @author UnionFlow Team
- * @version 1.0
- */
-public class CotisationDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private UUID id;
- private String numeroReference;
- private UUID membreId;
- private String numeroMembre;
- private String nomMembre;
- private UUID associationId;
- private String nomAssociation;
- private String typeCotisation;
- private String libelle;
- private String description;
- private BigDecimal montantDu;
- private BigDecimal montantPaye;
- private String codeDevise;
- private String statut;
- private LocalDate dateEcheance;
- private LocalDateTime datePaiement;
- private String methodePaiement;
- private String referencePaiement;
- private String observations;
- private LocalDateTime dateCreation;
- private String waveSessionId;
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getNumeroReference() { return numeroReference; }
- public void setNumeroReference(String numeroReference) { this.numeroReference = numeroReference; }
-
- public UUID getMembreId() { return membreId; }
- public void setMembreId(UUID membreId) { this.membreId = membreId; }
-
- public String getNumeroMembre() { return numeroMembre; }
- public void setNumeroMembre(String numeroMembre) { this.numeroMembre = numeroMembre; }
-
- public String getNomMembre() { return nomMembre; }
- public void setNomMembre(String nomMembre) { this.nomMembre = nomMembre; }
-
- public UUID getAssociationId() { return associationId; }
- public void setAssociationId(UUID associationId) { this.associationId = associationId; }
-
- public String getNomAssociation() { return nomAssociation; }
- public void setNomAssociation(String nomAssociation) { this.nomAssociation = nomAssociation; }
-
- public String getTypeCotisation() { return typeCotisation; }
- public void setTypeCotisation(String typeCotisation) { this.typeCotisation = typeCotisation; }
-
- public String getLibelle() { return libelle; }
- public void setLibelle(String libelle) { this.libelle = libelle; }
-
- public String getDescription() { return description; }
- public void setDescription(String description) { this.description = description; }
-
- public BigDecimal getMontantDu() { return montantDu; }
- public void setMontantDu(BigDecimal montantDu) { this.montantDu = montantDu; }
-
- public BigDecimal getMontantPaye() { return montantPaye != null ? montantPaye : BigDecimal.ZERO; }
- public void setMontantPaye(BigDecimal montantPaye) { this.montantPaye = montantPaye; }
-
- public String getCodeDevise() { return codeDevise; }
- public void setCodeDevise(String codeDevise) { this.codeDevise = codeDevise; }
-
- public String getStatut() { return statut; }
- public void setStatut(String statut) { this.statut = statut; }
-
- public LocalDate getDateEcheance() { return dateEcheance; }
- public void setDateEcheance(LocalDate dateEcheance) { this.dateEcheance = dateEcheance; }
-
- public LocalDateTime getDatePaiement() { return datePaiement; }
- public void setDatePaiement(LocalDateTime datePaiement) { this.datePaiement = datePaiement; }
-
- public String getMethodePaiement() { return methodePaiement; }
- public void setMethodePaiement(String methodePaiement) { this.methodePaiement = methodePaiement; }
-
- public String getReferencePaiement() { return referencePaiement; }
- public void setReferencePaiement(String referencePaiement) { this.referencePaiement = referencePaiement; }
-
- public String getObservations() { return observations; }
- public void setObservations(String observations) { this.observations = observations; }
-
- public LocalDateTime getDateCreation() { return dateCreation; }
- public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
-
- public String getWaveSessionId() { return waveSessionId; }
- public void setWaveSessionId(String waveSessionId) { this.waveSessionId = waveSessionId; }
-
- // Méthodes utilitaires pour l'affichage (alignées avec le backend)
-
- /**
- * Vérifie si la cotisation est payée intégralement
- */
- public boolean isPayeeIntegralement() {
- return montantPaye != null && montantDu != null && montantPaye.compareTo(montantDu) >= 0;
- }
-
- /**
- * Vérifie si la cotisation est en retard
- */
- public boolean isEnRetard() {
- return dateEcheance != null && LocalDate.now().isAfter(dateEcheance) && !isPayeeIntegralement();
- }
-
- /**
- * Calcule le montant restant à payer
- */
- public BigDecimal getMontantRestant() {
- if (montantDu == null) return BigDecimal.ZERO;
- if (montantPaye == null) return montantDu;
- BigDecimal restant = montantDu.subtract(montantPaye);
- return restant.compareTo(BigDecimal.ZERO) > 0 ? restant : BigDecimal.ZERO;
- }
-
- /**
- * Calcule le pourcentage de paiement
- */
- public int getPourcentagePaiement() {
- if (montantDu == null || montantDu.compareTo(BigDecimal.ZERO) == 0) return 0;
- if (montantPaye == null) return 0;
- return montantPaye.multiply(BigDecimal.valueOf(100))
- .divide(montantDu, 0, java.math.RoundingMode.HALF_UP)
- .intValue();
- }
-
- /**
- * Calcule le nombre de jours de retard
- */
- public long getJoursRetard() {
- if (dateEcheance == null || !isEnRetard()) return 0;
- return ChronoUnit.DAYS.between(dateEcheance, LocalDate.now());
- }
-
- /**
- * Retourne le libellé du type de cotisation
- */
- public String getTypeCotisationLibelle() {
- if (typeCotisation == null) return "Non défini";
- return switch (typeCotisation) {
- case "MENSUELLE" -> "Mensuelle";
- case "TRIMESTRIELLE" -> "Trimestrielle";
- case "SEMESTRIELLE" -> "Semestrielle";
- case "ANNUELLE" -> "Annuelle";
- case "EXCEPTIONNELLE" -> "Exceptionnelle";
- case "ADHESION" -> "Adhésion";
- default -> typeCotisation;
- };
- }
-
- /**
- * Retourne le libellé du statut
- */
- public String getStatutLibelle() {
- if (statut == null) return "Non défini";
- return switch (statut) {
- case "EN_ATTENTE" -> "En attente";
- case "PAYEE" -> "Payée";
- case "PARTIELLEMENT_PAYEE" -> "Partiellement payée";
- case "EN_RETARD" -> "En retard";
- case "ANNULEE" -> "Annulée";
- case "REMBOURSEE" -> "Remboursée";
- default -> statut;
- };
- }
-
- /**
- * Retourne le libellé de la méthode de paiement
- */
- public String getMethodePaiementLibelle() {
- if (methodePaiement == null) return "Non défini";
- return switch (methodePaiement) {
- case "ESPECES" -> "Espèces";
- case "VIREMENT" -> "Virement bancaire";
- case "CHEQUE" -> "Chèque";
- case "WAVE_MONEY" -> "Wave Money";
- case "ORANGE_MONEY" -> "Orange Money";
- case "FREE_MONEY" -> "Free Money";
- case "CARTE_BANCAIRE" -> "Carte bancaire";
- default -> methodePaiement;
- };
- }
-
- /**
- * Retourne la sévérité du statut pour PrimeFaces
- */
- public String getStatutSeverity() {
- if (statut == null) return "secondary";
- return switch (statut) {
- case "PAYEE" -> "success";
- case "EN_ATTENTE" -> "warning";
- case "EN_RETARD" -> "danger";
- case "PARTIELLEMENT_PAYEE" -> "info";
- case "ANNULEE", "REMBOURSEE" -> "secondary";
- default -> "secondary";
- };
- }
-
- /**
- * Retourne l'icône du statut pour PrimeFaces
- */
- public String getStatutIcon() {
- if (statut == null) return "pi-circle";
- return switch (statut) {
- case "PAYEE" -> "pi-check";
- case "EN_ATTENTE" -> "pi-clock";
- case "EN_RETARD" -> "pi-exclamation-triangle";
- case "PARTIELLEMENT_PAYEE" -> "pi-minus";
- default -> "pi-circle";
- };
- }
-
- /**
- * Formate la date d'échéance
- */
- public String getDateEcheanceFormatee() {
- if (dateEcheance == null) return "";
- return dateEcheance.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));
- }
-
- /**
- * Formate la date de paiement
- */
- public String getDatePaiementFormatee() {
- if (datePaiement == null) return "";
- return datePaiement.format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
- }
-
- /**
- * Formate le montant dû
- */
- public String getMontantDuFormatte() {
- if (montantDu == null) return "0 FCFA";
- return String.format("%,.0f FCFA", montantDu.doubleValue());
- }
-
- /**
- * Formate le montant payé
- */
- public String getMontantPayeFormatte() {
- if (montantPaye == null) return "0 FCFA";
- return String.format("%,.0f FCFA", montantPaye.doubleValue());
- }
-
- /**
- * Formate le montant restant
- */
- public String getMontantRestantFormatte() {
- return String.format("%,.0f FCFA", getMontantRestant().doubleValue());
- }
-}
-
diff --git a/src/main/java/dev/lions/unionflow/client/dto/DemandeAideDTO.java b/src/main/java/dev/lions/unionflow/client/dto/DemandeAideDTO.java
deleted file mode 100644
index 4c06ceb..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/DemandeAideDTO.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.UUID;
-
-public class DemandeAideDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private UUID id;
- private String numeroReference;
- private String type;
- private String titre;
- private String description;
- private String justification;
- private BigDecimal montantDemande;
- private BigDecimal montantAccorde;
- private String statut;
- private String urgence;
- private String localisation;
- private String motif;
- private UUID demandeurId;
- private String demandeur;
- private String telephone;
- private String email;
- private LocalDate dateDemande;
- private LocalDate dateLimite;
- private String responsableTraitement;
- private UUID organisationId;
- private LocalDateTime dateCreation;
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getNumeroReference() { return numeroReference; }
- public void setNumeroReference(String numeroReference) { this.numeroReference = numeroReference; }
-
- public String getType() { return type; }
- public void setType(String type) { this.type = type; }
-
- public String getTitre() { return titre; }
- public void setTitre(String titre) { this.titre = titre; }
-
- public String getDescription() { return description; }
- public void setDescription(String description) { this.description = description; }
-
- public String getJustification() { return justification; }
- public void setJustification(String justification) { this.justification = justification; }
-
- public BigDecimal getMontantDemande() { return montantDemande; }
- public void setMontantDemande(BigDecimal montantDemande) { this.montantDemande = montantDemande; }
-
- public BigDecimal getMontantAccorde() { return montantAccorde; }
- public void setMontantAccorde(BigDecimal montantAccorde) { this.montantAccorde = montantAccorde; }
-
- public String getStatut() { return statut; }
- public void setStatut(String statut) { this.statut = statut; }
-
- public String getUrgence() { return urgence; }
- public void setUrgence(String urgence) { this.urgence = urgence; }
-
- public String getLocalisation() { return localisation; }
- public void setLocalisation(String localisation) { this.localisation = localisation; }
-
- public String getMotif() { return motif; }
- public void setMotif(String motif) { this.motif = motif; }
-
- public UUID getDemandeurId() { return demandeurId; }
- public void setDemandeurId(UUID demandeurId) { this.demandeurId = demandeurId; }
-
- public String getDemandeur() { return demandeur; }
- public void setDemandeur(String demandeur) { this.demandeur = demandeur; }
-
- public String getTelephone() { return telephone; }
- public void setTelephone(String telephone) { this.telephone = telephone; }
-
- public String getEmail() { return email; }
- public void setEmail(String email) { this.email = email; }
-
- public LocalDate getDateDemande() { return dateDemande; }
- public void setDateDemande(LocalDate dateDemande) { this.dateDemande = dateDemande; }
-
- public LocalDate getDateLimite() { return dateLimite; }
- public void setDateLimite(LocalDate dateLimite) { this.dateLimite = dateLimite; }
-
- public String getResponsableTraitement() { return responsableTraitement; }
- public void setResponsableTraitement(String responsableTraitement) { this.responsableTraitement = responsableTraitement; }
-
- public UUID getOrganisationId() { return organisationId; }
- public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; }
-
- public LocalDateTime getDateCreation() { return dateCreation; }
- public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
-}
-
diff --git a/src/main/java/dev/lions/unionflow/client/dto/EvenementDTO.java b/src/main/java/dev/lions/unionflow/client/dto/EvenementDTO.java
deleted file mode 100644
index e660535..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/EvenementDTO.java
+++ /dev/null
@@ -1,492 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.format.DateTimeFormatter;
-import java.time.temporal.ChronoUnit;
-import java.util.UUID;
-
-/**
- * DTO pour la gestion des événements côté client
- * Correspond au EvenementDTO du backend avec méthodes utilitaires pour l'affichage
- *
- * @author UnionFlow Team
- * @version 2.0
- */
-public class EvenementDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- // Propriétés de base
- private UUID id;
- private String titre;
- private String description;
- private String typeEvenement; // ASSEMBLEE_GENERALE, FORMATION, etc.
- private String statut; // PLANIFIE, CONFIRME, EN_COURS, TERMINE, ANNULE, REPORTE
- private String priorite; // CRITIQUE, HAUTE, NORMALE, BASSE
-
- // Dates et heures
- private LocalDate dateDebut;
- private LocalDate dateFin;
- private LocalTime heureDebut;
- private LocalTime heureFin;
- private LocalDate dateLimiteInscription;
-
- // Localisation
- private String lieu;
- private String adresse;
- private String ville;
- private String region;
- private BigDecimal latitude;
- private BigDecimal longitude;
-
- // Organisation
- private UUID associationId;
- private String nomAssociation;
- private String organisateur;
- private String emailOrganisateur;
- private String telephoneOrganisateur;
-
- // Participants
- private Integer capaciteMax;
- private Integer participantsInscrits;
- private Integer participantsPresents;
-
- // Budget
- private BigDecimal budget;
- private BigDecimal coutReel;
- private String codeDevise;
-
- // Options
- private Boolean inscriptionObligatoire;
- private Boolean evenementPublic;
- private Boolean recurrent;
- private String frequenceRecurrence;
-
- // Informations complémentaires
- private String instructions;
- private String materielNecessaire;
- private String conditionsMeteo;
- private String imageUrl;
- private String couleurTheme;
-
- // Annulation
- private LocalDateTime dateAnnulation;
- private String raisonAnnulation;
- private String nomAnnulateur;
-
- // Métadonnées
- private LocalDateTime dateCreation;
- private LocalDateTime dateModification;
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getTitre() { return titre; }
- public void setTitre(String titre) { this.titre = titre; }
-
- public String getDescription() { return description; }
- public void setDescription(String description) { this.description = description; }
-
- public String getTypeEvenement() { return typeEvenement; }
- public void setTypeEvenement(String typeEvenement) { this.typeEvenement = typeEvenement; }
-
- public String getStatut() { return statut; }
- public void setStatut(String statut) { this.statut = statut; }
-
- public String getPriorite() { return priorite; }
- public void setPriorite(String priorite) { this.priorite = priorite; }
-
- public LocalDate getDateDebut() { return dateDebut; }
- public void setDateDebut(LocalDate dateDebut) { this.dateDebut = dateDebut; }
-
- public LocalDate getDateFin() { return dateFin; }
- public void setDateFin(LocalDate dateFin) { this.dateFin = dateFin; }
-
- public LocalTime getHeureDebut() { return heureDebut; }
- public void setHeureDebut(LocalTime heureDebut) { this.heureDebut = heureDebut; }
-
- public LocalTime getHeureFin() { return heureFin; }
- public void setHeureFin(LocalTime heureFin) { this.heureFin = heureFin; }
-
- public LocalDate getDateLimiteInscription() { return dateLimiteInscription; }
- public void setDateLimiteInscription(LocalDate dateLimiteInscription) { this.dateLimiteInscription = dateLimiteInscription; }
-
- public String getLieu() { return lieu; }
- public void setLieu(String lieu) { this.lieu = lieu; }
-
- public String getAdresse() { return adresse; }
- public void setAdresse(String adresse) { this.adresse = adresse; }
-
- public String getVille() { return ville; }
- public void setVille(String ville) { this.ville = ville; }
-
- public String getRegion() { return region; }
- public void setRegion(String region) { this.region = region; }
-
- public BigDecimal getLatitude() { return latitude; }
- public void setLatitude(BigDecimal latitude) { this.latitude = latitude; }
-
- public BigDecimal getLongitude() { return longitude; }
- public void setLongitude(BigDecimal longitude) { this.longitude = longitude; }
-
- public UUID getAssociationId() { return associationId; }
- public void setAssociationId(UUID associationId) { this.associationId = associationId; }
-
- public String getNomAssociation() { return nomAssociation; }
- public void setNomAssociation(String nomAssociation) { this.nomAssociation = nomAssociation; }
-
- public String getOrganisateur() { return organisateur; }
- public void setOrganisateur(String organisateur) { this.organisateur = organisateur; }
-
- public String getEmailOrganisateur() { return emailOrganisateur; }
- public void setEmailOrganisateur(String emailOrganisateur) { this.emailOrganisateur = emailOrganisateur; }
-
- public String getTelephoneOrganisateur() { return telephoneOrganisateur; }
- public void setTelephoneOrganisateur(String telephoneOrganisateur) { this.telephoneOrganisateur = telephoneOrganisateur; }
-
- public Integer getCapaciteMax() { return capaciteMax; }
- public void setCapaciteMax(Integer capaciteMax) { this.capaciteMax = capaciteMax; }
-
- public Integer getParticipantsInscrits() { return participantsInscrits != null ? participantsInscrits : 0; }
- public void setParticipantsInscrits(Integer participantsInscrits) { this.participantsInscrits = participantsInscrits; }
-
- public Integer getParticipantsPresents() { return participantsPresents != null ? participantsPresents : 0; }
- public void setParticipantsPresents(Integer participantsPresents) { this.participantsPresents = participantsPresents; }
-
- public BigDecimal getBudget() { return budget; }
- public void setBudget(BigDecimal budget) { this.budget = budget; }
-
- public BigDecimal getCoutReel() { return coutReel; }
- public void setCoutReel(BigDecimal coutReel) { this.coutReel = coutReel; }
-
- public String getCodeDevise() { return codeDevise != null ? codeDevise : "XOF"; }
- public void setCodeDevise(String codeDevise) { this.codeDevise = codeDevise; }
-
- public Boolean getInscriptionObligatoire() { return inscriptionObligatoire != null ? inscriptionObligatoire : false; }
- public void setInscriptionObligatoire(Boolean inscriptionObligatoire) { this.inscriptionObligatoire = inscriptionObligatoire; }
-
- public Boolean getEvenementPublic() { return evenementPublic != null ? evenementPublic : true; }
- public void setEvenementPublic(Boolean evenementPublic) { this.evenementPublic = evenementPublic; }
-
- public Boolean getRecurrent() { return recurrent != null ? recurrent : false; }
- public void setRecurrent(Boolean recurrent) { this.recurrent = recurrent; }
-
- public String getFrequenceRecurrence() { return frequenceRecurrence; }
- public void setFrequenceRecurrence(String frequenceRecurrence) { this.frequenceRecurrence = frequenceRecurrence; }
-
- public String getInstructions() { return instructions; }
- public void setInstructions(String instructions) { this.instructions = instructions; }
-
- public String getMaterielNecessaire() { return materielNecessaire; }
- public void setMaterielNecessaire(String materielNecessaire) { this.materielNecessaire = materielNecessaire; }
-
- public String getConditionsMeteo() { return conditionsMeteo; }
- public void setConditionsMeteo(String conditionsMeteo) { this.conditionsMeteo = conditionsMeteo; }
-
- public String getImageUrl() { return imageUrl; }
- public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; }
-
- public String getCouleurTheme() { return couleurTheme; }
- public void setCouleurTheme(String couleurTheme) { this.couleurTheme = couleurTheme; }
-
- public LocalDateTime getDateAnnulation() { return dateAnnulation; }
- public void setDateAnnulation(LocalDateTime dateAnnulation) { this.dateAnnulation = dateAnnulation; }
-
- public String getRaisonAnnulation() { return raisonAnnulation; }
- public void setRaisonAnnulation(String raisonAnnulation) { this.raisonAnnulation = raisonAnnulation; }
-
- public String getNomAnnulateur() { return nomAnnulateur; }
- public void setNomAnnulateur(String nomAnnulateur) { this.nomAnnulateur = nomAnnulateur; }
-
- public LocalDateTime getDateCreation() { return dateCreation; }
- public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
-
- public LocalDateTime getDateModification() { return dateModification; }
- public void setDateModification(LocalDateTime dateModification) { this.dateModification = dateModification; }
-
- // Méthodes utilitaires pour l'affichage
-
- /**
- * Retourne le libellé du type d'événement
- */
- public String getTypeEvenementLibelle() {
- if (typeEvenement == null) return "Non défini";
- return switch (typeEvenement) {
- case "ASSEMBLEE_GENERALE" -> "Assemblée Générale";
- case "FORMATION" -> "Formation";
- case "ACTIVITE_SOCIALE" -> "Activité Sociale";
- case "ACTION_CARITATIVE" -> "Action Caritative";
- case "REUNION_BUREAU" -> "Réunion de Bureau";
- case "CONFERENCE" -> "Conférence";
- case "ATELIER" -> "Atelier";
- case "CEREMONIE" -> "Cérémonie";
- case "AUTRE" -> "Autre";
- default -> typeEvenement;
- };
- }
-
- /**
- * Retourne la sévérité PrimeFaces pour le type
- */
- public String getTypeEvenementSeverity() {
- if (typeEvenement == null) return "info";
- return switch (typeEvenement) {
- case "ASSEMBLEE_GENERALE" -> "danger";
- case "REUNION_BUREAU" -> "warning";
- case "FORMATION" -> "success";
- case "ACTION_CARITATIVE" -> "info";
- case "ACTIVITE_SOCIALE" -> "secondary";
- default -> "primary";
- };
- }
-
- /**
- * Retourne l'icône PrimeFaces pour le type
- */
- public String getTypeEvenementIcon() {
- if (typeEvenement == null) return "pi-calendar";
- return switch (typeEvenement) {
- case "ASSEMBLEE_GENERALE" -> "pi-sitemap";
- case "REUNION_BUREAU" -> "pi-users";
- case "FORMATION" -> "pi-book";
- case "ACTION_CARITATIVE", "ACTIVITE_SOCIALE" -> "pi-heart";
- case "CONFERENCE" -> "pi-microphone";
- case "ATELIER" -> "pi-wrench";
- case "CEREMONIE" -> "pi-star";
- default -> "pi-calendar";
- };
- }
-
- /**
- * Retourne le libellé du statut
- */
- public String getStatutLibelle() {
- if (statut == null) return "Non défini";
- return switch (statut) {
- case "PLANIFIE" -> "Planifié";
- case "CONFIRME" -> "Confirmé";
- case "EN_COURS" -> "En cours";
- case "TERMINE" -> "Terminé";
- case "ANNULE" -> "Annulé";
- case "REPORTE" -> "Reporté";
- default -> statut;
- };
- }
-
- /**
- * Retourne la sévérité PrimeFaces pour le statut
- */
- public String getStatutSeverity() {
- if (statut == null) return "info";
- return switch (statut) {
- case "PLANIFIE" -> "info";
- case "CONFIRME" -> "success";
- case "EN_COURS" -> "warning";
- case "TERMINE" -> "success";
- case "ANNULE" -> "error";
- case "REPORTE" -> "warn";
- default -> "info";
- };
- }
-
- /**
- * Retourne l'icône PrimeFaces pour le statut
- */
- public String getStatutIcon() {
- if (statut == null) return "pi-circle";
- return switch (statut) {
- case "PLANIFIE" -> "pi-clock";
- case "CONFIRME" -> "pi-check-circle";
- case "EN_COURS" -> "pi-play";
- case "TERMINE" -> "pi-check";
- case "ANNULE" -> "pi-ban";
- case "REPORTE" -> "pi-calendar-times";
- default -> "pi-circle";
- };
- }
-
- /**
- * Retourne le libellé de la priorité
- */
- public String getPrioriteLibelle() {
- if (priorite == null) return "Normale";
- return switch (priorite) {
- case "CRITIQUE" -> "Critique";
- case "HAUTE" -> "Haute";
- case "NORMALE" -> "Normale";
- case "BASSE" -> "Basse";
- default -> priorite;
- };
- }
-
- /**
- * Retourne la sévérité PrimeFaces pour la priorité
- */
- public String getPrioriteSeverity() {
- if (priorite == null) return "info";
- return switch (priorite) {
- case "CRITIQUE" -> "error";
- case "HAUTE" -> "warning";
- case "NORMALE" -> "info";
- case "BASSE" -> "secondary";
- default -> "info";
- };
- }
-
- /**
- * Formate la date de début
- */
- public String getDateDebutFormatee() {
- if (dateDebut == null) return "";
- return dateDebut.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));
- }
-
- /**
- * Formate la date de fin
- */
- public String getDateFinFormatee() {
- if (dateFin == null) return "";
- return dateFin.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));
- }
-
- /**
- * Formate l'heure de début
- */
- public String getHeureDebutFormatee() {
- if (heureDebut == null) return "";
- return heureDebut.format(DateTimeFormatter.ofPattern("HH:mm"));
- }
-
- /**
- * Formate l'heure de fin
- */
- public String getHeureFinFormatee() {
- if (heureFin == null) return "";
- return heureFin.format(DateTimeFormatter.ofPattern("HH:mm"));
- }
-
- /**
- * Formate le budget
- */
- public String getBudgetFormate() {
- if (budget == null) return "0 FCFA";
- return String.format("%,.0f %s", budget.doubleValue(), getCodeDevise());
- }
-
- /**
- * Calcule le nombre de places disponibles
- */
- public int getPlacesDisponibles() {
- if (capaciteMax == null || capaciteMax == 0) return 0;
- int inscrits = getParticipantsInscrits();
- return Math.max(0, capaciteMax - inscrits);
- }
-
- /**
- * Calcule le taux de remplissage en pourcentage
- */
- public int getTauxRemplissage() {
- if (capaciteMax == null || capaciteMax == 0) return 0;
- int inscrits = getParticipantsInscrits();
- return (inscrits * 100) / capaciteMax;
- }
-
- /**
- * Calcule le taux de présence en pourcentage
- */
- public int getTauxPresence() {
- int inscrits = getParticipantsInscrits();
- if (inscrits == 0) return 0;
- int presents = getParticipantsPresents();
- return (presents * 100) / inscrits;
- }
-
- /**
- * Calcule le nombre de jours restants avant l'événement
- */
- public long getJoursRestants() {
- if (dateDebut == null) return 0;
- return ChronoUnit.DAYS.between(LocalDate.now(), dateDebut);
- }
-
- /**
- * Vérifie si l'événement est complet
- */
- public boolean isComplet() {
- if (capaciteMax == null || capaciteMax == 0) return false;
- return getParticipantsInscrits() >= capaciteMax;
- }
-
- /**
- * Vérifie si l'événement est en cours
- */
- public boolean isEnCours() {
- return "EN_COURS".equals(statut);
- }
-
- /**
- * Vérifie si l'événement est terminé
- */
- public boolean isTermine() {
- return "TERMINE".equals(statut);
- }
-
- /**
- * Vérifie si l'événement est annulé
- */
- public boolean isAnnule() {
- return "ANNULE".equals(statut);
- }
-
- /**
- * Vérifie si les inscriptions sont ouvertes
- */
- public boolean sontInscriptionsOuvertes() {
- if (isAnnule() || isTermine()) return false;
- if (dateLimiteInscription != null && LocalDate.now().isAfter(dateLimiteInscription)) return false;
- return !isComplet();
- }
-
- /**
- * Retourne l'adresse complète formatée
- */
- public String getAdresseComplete() {
- StringBuilder sb = new StringBuilder();
- if (lieu != null && !lieu.trim().isEmpty()) {
- sb.append(lieu);
- }
- if (adresse != null && !adresse.trim().isEmpty()) {
- if (sb.length() > 0) sb.append(", ");
- sb.append(adresse);
- }
- if (ville != null && !ville.trim().isEmpty()) {
- if (sb.length() > 0) sb.append(", ");
- sb.append(ville);
- }
- if (region != null && !region.trim().isEmpty()) {
- if (sb.length() > 0) sb.append(", ");
- sb.append(region);
- }
- return sb.toString();
- }
-
- /**
- * Calcule la durée en heures
- */
- public long getDureeEnHeures() {
- if (heureDebut == null || heureFin == null) return 0;
- return ChronoUnit.HOURS.between(heureDebut, heureFin);
- }
-
- /**
- * Vérifie si l'événement dure plusieurs jours
- */
- public boolean isEvenementMultiJours() {
- return dateFin != null && dateDebut != null && !dateDebut.equals(dateFin);
- }
-}
diff --git a/src/main/java/dev/lions/unionflow/client/dto/FormulaireDTO.java b/src/main/java/dev/lions/unionflow/client/dto/FormulaireDTO.java
deleted file mode 100644
index 338c1d3..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/FormulaireDTO.java
+++ /dev/null
@@ -1,181 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Positive;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-import java.util.UUID;
-
-public class FormulaireDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private UUID id;
-
- @NotNull
- private String nom;
-
- private String description;
-
- @NotNull
- @Positive
- private Integer quotaMaxMembres;
-
- @NotNull
- private BigDecimal prixMensuel;
-
- @NotNull
- private BigDecimal prixAnnuel;
-
- private String deviseCode = "XOF"; // Franc CFA
-
- private boolean actif = true;
-
- private boolean recommande = false;
-
- private String couleurTheme;
-
- private String iconeFormulaire;
-
- // Fonctionnalités incluses
- private boolean gestionMembres = true;
- private boolean gestionCotisations = true;
- private boolean gestionEvenements = false;
- private boolean gestionAides = false;
- private boolean rapportsAvances = false;
- private boolean supportPrioritaire = false;
- private boolean sauvegardeAutomatique = false;
- private boolean personnalisationAvancee = false;
- private boolean integrationPaiement = false;
- private boolean notificationsEmail = false;
- private boolean notificationsSMS = false;
- private boolean gestionDocuments = false;
-
- // Métadonnées
- private LocalDateTime dateCreation;
- private LocalDateTime dateMiseAJour;
- private String creePar;
- private String modifiePar;
-
- public FormulaireDTO() {}
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getNom() { return nom; }
- public void setNom(String nom) { this.nom = nom; }
-
- public String getDescription() { return description; }
- public void setDescription(String description) { this.description = description; }
-
- public Integer getQuotaMaxMembres() { return quotaMaxMembres; }
- public void setQuotaMaxMembres(Integer quotaMaxMembres) { this.quotaMaxMembres = quotaMaxMembres; }
-
- public BigDecimal getPrixMensuel() { return prixMensuel; }
- public void setPrixMensuel(BigDecimal prixMensuel) { this.prixMensuel = prixMensuel; }
-
- public BigDecimal getPrixAnnuel() { return prixAnnuel; }
- public void setPrixAnnuel(BigDecimal prixAnnuel) { this.prixAnnuel = prixAnnuel; }
-
- public String getDeviseCode() { return deviseCode; }
- public void setDeviseCode(String deviseCode) { this.deviseCode = deviseCode; }
-
- public boolean isActif() { return actif; }
- public void setActif(boolean actif) { this.actif = actif; }
-
- public boolean isRecommande() { return recommande; }
- public void setRecommande(boolean recommande) { this.recommande = recommande; }
-
- public String getCouleurTheme() { return couleurTheme; }
- public void setCouleurTheme(String couleurTheme) { this.couleurTheme = couleurTheme; }
-
- public String getIconeFormulaire() { return iconeFormulaire; }
- public void setIconeFormulaire(String iconeFormulaire) { this.iconeFormulaire = iconeFormulaire; }
-
- // Fonctionnalités
- public boolean isGestionMembres() { return gestionMembres; }
- public void setGestionMembres(boolean gestionMembres) { this.gestionMembres = gestionMembres; }
-
- public boolean isGestionCotisations() { return gestionCotisations; }
- public void setGestionCotisations(boolean gestionCotisations) { this.gestionCotisations = gestionCotisations; }
-
- public boolean isGestionEvenements() { return gestionEvenements; }
- public void setGestionEvenements(boolean gestionEvenements) { this.gestionEvenements = gestionEvenements; }
-
- public boolean isGestionAides() { return gestionAides; }
- public void setGestionAides(boolean gestionAides) { this.gestionAides = gestionAides; }
-
- public boolean isRapportsAvances() { return rapportsAvances; }
- public void setRapportsAvances(boolean rapportsAvances) { this.rapportsAvances = rapportsAvances; }
-
- public boolean isSupportPrioritaire() { return supportPrioritaire; }
- public void setSupportPrioritaire(boolean supportPrioritaire) { this.supportPrioritaire = supportPrioritaire; }
-
- public boolean isSauvegardeAutomatique() { return sauvegardeAutomatique; }
- public void setSauvegardeAutomatique(boolean sauvegardeAutomatique) { this.sauvegardeAutomatique = sauvegardeAutomatique; }
-
- public boolean isPersonnalisationAvancee() { return personnalisationAvancee; }
- public void setPersonnalisationAvancee(boolean personnalisationAvancee) { this.personnalisationAvancee = personnalisationAvancee; }
-
- public boolean isIntegrationPaiement() { return integrationPaiement; }
- public void setIntegrationPaiement(boolean integrationPaiement) { this.integrationPaiement = integrationPaiement; }
-
- public boolean isNotificationsEmail() { return notificationsEmail; }
- public void setNotificationsEmail(boolean notificationsEmail) { this.notificationsEmail = notificationsEmail; }
-
- public boolean isNotificationsSMS() { return notificationsSMS; }
- public void setNotificationsSMS(boolean notificationsSMS) { this.notificationsSMS = notificationsSMS; }
-
- public boolean isGestionDocuments() { return gestionDocuments; }
- public void setGestionDocuments(boolean gestionDocuments) { this.gestionDocuments = gestionDocuments; }
-
- // Métadonnées
- public LocalDateTime getDateCreation() { return dateCreation; }
- public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
-
- public LocalDateTime getDateMiseAJour() { return dateMiseAJour; }
- public void setDateMiseAJour(LocalDateTime dateMiseAJour) { this.dateMiseAJour = dateMiseAJour; }
-
- public String getCreePar() { return creePar; }
- public void setCreePar(String creePar) { this.creePar = creePar; }
-
- public String getModifiePar() { return modifiePar; }
- public void setModifiePar(String modifiePar) { this.modifiePar = modifiePar; }
-
- // Méthodes utilitaires
- public String getPrixMensuelFormat() {
- return String.format("%,.0f %s", prixMensuel, deviseCode);
- }
-
- public String getPrixAnnuelFormat() {
- return String.format("%,.0f %s", prixAnnuel, deviseCode);
- }
-
- public BigDecimal getEconomieAnnuelle() {
- if (prixMensuel != null && prixAnnuel != null) {
- BigDecimal coutMensuelAnnuel = prixMensuel.multiply(BigDecimal.valueOf(12));
- return coutMensuelAnnuel.subtract(prixAnnuel);
- }
- return BigDecimal.ZERO;
- }
-
- public String getEconomieAnnuelleFormat() {
- BigDecimal economie = getEconomieAnnuelle();
- return String.format("%,.0f %s", economie, deviseCode);
- }
-
- public int getPourcentageEconomie() {
- if (prixMensuel != null && prixAnnuel != null) {
- BigDecimal coutMensuelAnnuel = prixMensuel.multiply(BigDecimal.valueOf(12));
- BigDecimal economie = getEconomieAnnuelle();
- if (coutMensuelAnnuel.compareTo(BigDecimal.ZERO) > 0) {
- return economie.multiply(BigDecimal.valueOf(100))
- .divide(coutMensuelAnnuel, 0, java.math.RoundingMode.HALF_UP)
- .intValue();
- }
- }
- return 0;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/dev/lions/unionflow/client/dto/MembreDTO.java b/src/main/java/dev/lions/unionflow/client/dto/MembreDTO.java
deleted file mode 100644
index 0a4a183..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/MembreDTO.java
+++ /dev/null
@@ -1,320 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import dev.lions.unionflow.client.validation.ValidPhoneNumber;
-import dev.lions.unionflow.client.validation.ValidMemberNumber;
-import dev.lions.unionflow.client.validation.ValidationGroups;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import jakarta.validation.constraints.*;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.io.Serializable;
-import java.util.UUID;
-
-public class MembreDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private UUID id;
-
- /** Numéro unique du membre - OPTIONNEL (généré automatiquement si non fourni) */
- @Size(max = 50, message = "Le numéro de membre ne peut pas dépasser 50 caractères")
- private String numeroMembre;
-
- /** Nom de famille du membre - OBLIGATOIRE */
- @NotBlank(message = "Le nom est obligatoire")
- @Size(min = 2, max = 50, message = "Le nom doit contenir entre 2 et 50 caractères")
- @Pattern(regexp = "^[a-zA-ZÀ-ÿ\\s\\-']+$", message = "Le nom ne peut contenir que des lettres, espaces, tirets et apostrophes")
- private String nom;
-
- /** Prénom du membre - OBLIGATOIRE */
- @NotBlank(message = "Le prénom est obligatoire")
- @Size(min = 2, max = 50, message = "Le prénom doit contenir entre 2 et 50 caractères")
- @Pattern(regexp = "^[a-zA-ZÀ-ÿ\\s\\-']+$", message = "Le prénom ne peut contenir que des lettres, espaces, tirets et apostrophes")
- private String prenom;
-
- /** Adresse email du membre - OBLIGATOIRE */
- @NotBlank(message = "L'email est obligatoire")
- @Email(message = "Format d'email invalide")
- @Size(max = 100, message = "L'email ne peut pas dépasser 100 caractères")
- private String email;
-
- /** Numéro de téléphone du membre - OPTIONNEL (format flexible) */
- @Size(max = 20, message = "Le téléphone ne peut pas dépasser 20 caractères")
- private String telephone;
-
- /** Date de naissance du membre - OPTIONNELLE (définie par défaut à il y a 18 ans si non fournie) */
- @JsonFormat(pattern = "yyyy-MM-dd")
- @Past(message = "La date de naissance doit être dans le passé")
- private LocalDate dateNaissance;
-
- @Size(max = 200, message = "L'adresse ne peut pas dépasser 200 caractères")
- private String adresse;
-
- @Size(max = 100, message = "La profession ne peut pas dépasser 100 caractères")
- private String profession;
-
- @Size(max = 20, message = "Le statut matrimonial ne peut pas dépasser 20 caractères")
- private String statutMatrimonial;
-
- @Size(max = 50, message = "La nationalité ne peut pas dépasser 50 caractères")
- private String nationalite;
-
- @Size(max = 50, message = "Le numéro d'identité ne peut pas dépasser 50 caractères")
- private String numeroIdentite;
-
- @Size(max = 20, message = "Le type d'identité ne peut pas dépasser 20 caractères")
- private String typeIdentite;
-
- /** URL de la photo de profil - OPTIONNELLE */
- @Size(max = 255, message = "L'URL de la photo ne peut pas dépasser 255 caractères")
- private String photoUrl;
-
- /** Statut du membre - OBLIGATOIRE */
- @NotNull(message = "Le statut est obligatoire")
- private String statut;
-
- /** Identifiant de l'association - OBLIGATOIRE */
- @NotNull(message = "L'association est obligatoire")
- private UUID associationId;
-
- /** Nom de l'association (lecture seule) */
- private String associationNom;
-
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime dateInscription;
-
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime dateDerniereModification;
-
- private String creePar;
- private String modifiePar;
-
- private Boolean membreBureau = false;
- private Boolean responsable = false;
-
- @JsonFormat(pattern = "yyyy-MM-dd")
- private LocalDate dateAdhesion;
-
- @Size(max = 50, message = "La région ne peut pas dépasser 50 caractères")
- private String region;
-
- @Size(max = 50, message = "La ville ne peut pas dépasser 50 caractères")
- private String ville;
-
- @Size(max = 50, message = "Le quartier ne peut pas dépasser 50 caractères")
- private String quartier;
-
- @Size(max = 50, message = "Le rôle ne peut pas dépasser 50 caractères")
- private String role;
-
- // Constructeurs
- public MembreDTO() {}
-
- public MembreDTO(String numeroMembre, String nom, String prenom, String email) {
- this.numeroMembre = numeroMembre;
- this.nom = nom;
- this.prenom = prenom;
- this.email = email;
- this.statut = "ACTIF";
- this.dateInscription = LocalDateTime.now();
- }
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getNumeroMembre() { return numeroMembre; }
- public void setNumeroMembre(String numeroMembre) { this.numeroMembre = numeroMembre; }
-
- public String getNom() { return nom; }
- public void setNom(String nom) { this.nom = nom; }
-
- public String getPrenom() { return prenom; }
- public void setPrenom(String prenom) { this.prenom = prenom; }
-
- public String getEmail() { return email; }
- public void setEmail(String email) { this.email = email; }
-
- public String getTelephone() { return telephone; }
- public void setTelephone(String telephone) { this.telephone = telephone; }
-
- public LocalDate getDateNaissance() { return dateNaissance; }
- public void setDateNaissance(LocalDate dateNaissance) { this.dateNaissance = dateNaissance; }
-
- public String getAdresse() { return adresse; }
- public void setAdresse(String adresse) { this.adresse = adresse; }
-
- public String getProfession() { return profession; }
- public void setProfession(String profession) { this.profession = profession; }
-
- public String getStatutMatrimonial() { return statutMatrimonial; }
- public void setStatutMatrimonial(String statutMatrimonial) { this.statutMatrimonial = statutMatrimonial; }
-
- public String getNationalite() { return nationalite; }
- public void setNationalite(String nationalite) { this.nationalite = nationalite; }
-
- public String getNumeroIdentite() { return numeroIdentite; }
- public void setNumeroIdentite(String numeroIdentite) { this.numeroIdentite = numeroIdentite; }
-
- public String getTypeIdentite() { return typeIdentite; }
- public void setTypeIdentite(String typeIdentite) { this.typeIdentite = typeIdentite; }
-
- public String getStatut() { return statut; }
- public void setStatut(String statut) { this.statut = statut; }
-
- public UUID getAssociationId() { return associationId; }
- public void setAssociationId(UUID associationId) { this.associationId = associationId; }
-
- public String getAssociationNom() { return associationNom; }
- public void setAssociationNom(String associationNom) { this.associationNom = associationNom; }
-
- public LocalDateTime getDateInscription() { return dateInscription; }
- public void setDateInscription(LocalDateTime dateInscription) { this.dateInscription = dateInscription; }
-
- public LocalDateTime getDateDerniereModification() { return dateDerniereModification; }
- public void setDateDerniereModification(LocalDateTime dateDerniereModification) { this.dateDerniereModification = dateDerniereModification; }
-
- public String getCreePar() { return creePar; }
- public void setCreePar(String creePar) { this.creePar = creePar; }
-
- public String getModifiePar() { return modifiePar; }
- public void setModifiePar(String modifiePar) { this.modifiePar = modifiePar; }
-
- public String getPhotoUrl() { return photoUrl; }
- public void setPhotoUrl(String photoUrl) { this.photoUrl = photoUrl; }
-
- public Boolean getMembreBureau() { return membreBureau; }
- public void setMembreBureau(Boolean membreBureau) { this.membreBureau = membreBureau; }
-
- public Boolean getResponsable() { return responsable; }
- public void setResponsable(Boolean responsable) { this.responsable = responsable; }
-
- public LocalDate getDateAdhesion() { return dateAdhesion; }
- public void setDateAdhesion(LocalDate dateAdhesion) { this.dateAdhesion = dateAdhesion; }
-
- public String getRegion() { return region; }
- public void setRegion(String region) { this.region = region; }
-
- public String getVille() { return ville; }
- public void setVille(String ville) { this.ville = ville; }
-
- public String getQuartier() { return quartier; }
- public void setQuartier(String quartier) { this.quartier = quartier; }
-
- public String getRole() { return role; }
- public void setRole(String role) { this.role = role; }
-
- // Propriétés dérivées
- public String getNomComplet() {
- return (prenom != null ? prenom : "") + " " + (nom != null ? nom : "");
- }
-
- public String getInitiales() {
- StringBuilder initiales = new StringBuilder();
- if (prenom != null && !prenom.isEmpty()) {
- initiales.append(prenom.charAt(0));
- }
- if (nom != null && !nom.isEmpty()) {
- initiales.append(nom.charAt(0));
- }
- return initiales.toString().toUpperCase();
- }
-
- public String getStatutLibelle() {
- return switch (statut != null ? statut : "") {
- case "ACTIF" -> "Actif";
- case "INACTIF" -> "Inactif";
- case "SUSPENDU" -> "Suspendu";
- case "RADIE" -> "Radié";
- default -> statut;
- };
- }
-
- public String getStatutSeverity() {
- return switch (statut != null ? statut : "") {
- case "ACTIF" -> "success";
- case "INACTIF" -> "warning";
- case "SUSPENDU" -> "danger";
- case "RADIE" -> "secondary";
- default -> "info";
- };
- }
-
- public String getStatutIcon() {
- return switch (statut != null ? statut : "") {
- case "ACTIF" -> "pi-check";
- case "INACTIF" -> "pi-times";
- case "SUSPENDU" -> "pi-ban";
- case "RADIE" -> "pi-trash";
- default -> "pi-question";
- };
- }
-
- // Propriétés pour le type de membre (à adapter selon votre logique métier)
- public String getTypeMembre() {
- // Retourne le type basé sur les rôles
- if (Boolean.TRUE.equals(responsable)) return "Responsable";
- if (Boolean.TRUE.equals(membreBureau)) return "Bureau";
- return "Membre";
- }
-
- public String getTypeSeverity() {
- if (Boolean.TRUE.equals(responsable)) return "danger";
- if (Boolean.TRUE.equals(membreBureau)) return "warning";
- return "info";
- }
-
- public String getTypeIcon() {
- if (Boolean.TRUE.equals(responsable)) return "pi-star-fill";
- if (Boolean.TRUE.equals(membreBureau)) return "pi-briefcase";
- return "pi-user";
- }
-
- // Propriétés pour l'entité (association)
- public String getEntite() {
- return associationNom != null ? associationNom : "Non renseigné";
- }
-
- // Propriétés pour l'ancienneté
- public String getAnciennete() {
- if (dateInscription == null) return "N/A";
- long jours = java.time.temporal.ChronoUnit.DAYS.between(dateInscription.toLocalDate(), LocalDate.now());
- if (jours < 30) return jours + " jours";
- if (jours < 365) return (jours / 30) + " mois";
- return (jours / 365) + " ans";
- }
-
- // Propriétés pour les cotisations - À implémenter avec les vraies données du module Cotisations
- public String getCotisationStatut() {
- return "N/A"; // TODO: Intégrer avec le module Cotisations
- }
-
- public String getCotisationColor() {
- return "text-500"; // Gris neutre par défaut
- }
-
- public String getDernierPaiement() {
- return "N/A"; // TODO: Intégrer avec le module Cotisations
- }
-
- // Propriétés pour la participation aux événements - À implémenter avec les vraies données du module Événements
- public String getTauxParticipation() {
- return "0"; // TODO: Intégrer avec le module Événements
- }
-
- public String getEvenementsAnnee() {
- return "0"; // TODO: Intégrer avec le module Événements
- }
-
- @Override
- public String toString() {
- return "MembreDTO{" +
- "id=" + id +
- ", numeroMembre='" + numeroMembre + '\'' +
- ", nom='" + nom + '\'' +
- ", prenom='" + prenom + '\'' +
- ", email='" + email + '\'' +
- ", statut='" + statut + '\'' +
- '}';
- }
-}
\ No newline at end of file
diff --git a/src/main/java/dev/lions/unionflow/client/dto/SouscriptionDTO.java b/src/main/java/dev/lions/unionflow/client/dto/SouscriptionDTO.java
deleted file mode 100644
index a05f7db..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/SouscriptionDTO.java
+++ /dev/null
@@ -1,242 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import jakarta.validation.constraints.NotNull;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.temporal.ChronoUnit;
-import java.util.UUID;
-
-public class SouscriptionDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- public enum StatutSouscription {
- ACTIVE("Actif", "text-green-600", "bg-green-100"),
- SUSPENDUE("Suspendue", "text-orange-600", "bg-orange-100"),
- EXPIREE("Expirée", "text-red-600", "bg-red-100"),
- EN_ATTENTE_PAIEMENT("En attente de paiement", "text-blue-600", "bg-blue-100"),
- ANNULEE("Annulée", "text-gray-600", "bg-gray-100");
-
- private final String libelle;
- private final String couleurTexte;
- private final String couleurFond;
-
- StatutSouscription(String libelle, String couleurTexte, String couleurFond) {
- this.libelle = libelle;
- this.couleurTexte = couleurTexte;
- this.couleurFond = couleurFond;
- }
-
- public String getLibelle() { return libelle; }
- public String getCouleurTexte() { return couleurTexte; }
- public String getCouleurFond() { return couleurFond; }
- }
-
- public enum TypeFacturation {
- MENSUEL("Mensuel"),
- ANNUEL("Annuel");
-
- private final String libelle;
-
- TypeFacturation(String libelle) {
- this.libelle = libelle;
- }
-
- public String getLibelle() { return libelle; }
- }
-
- private UUID id;
-
- @NotNull
- private UUID organisationId;
- private String organisationNom;
-
- @NotNull
- private UUID formulaireId;
- private String formulaireNom;
-
- @NotNull
- private StatutSouscription statut;
-
- @NotNull
- private TypeFacturation typeFacturation;
-
- @NotNull
- private LocalDate dateDebut;
-
- @NotNull
- private LocalDate dateFin;
-
- private LocalDate dateDernierPaiement;
- private LocalDate dateProchainPaiement;
-
- @NotNull
- private Integer quotaMaxMembres;
-
- private Integer membresActuels = 0;
-
- @NotNull
- private BigDecimal montantSouscription;
-
- private String deviseCode = "XOF";
-
- private String numeroFacture;
- private String referencePaiement;
-
- // Informations de renouvellement automatique
- private boolean renouvellementAutomatique = false;
- private String methodePaiementDefaut;
-
- // Notifications
- private boolean notificationExpiration = true;
- private boolean notificationQuotaAtteint = true;
- private int joursAvantNotificationExpiration = 30;
-
- // Audit
- private LocalDateTime dateCreation;
- private LocalDateTime dateMiseAJour;
- private String creePar;
- private String modifiePar;
-
- public SouscriptionDTO() {}
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public UUID getOrganisationId() { return organisationId; }
- public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; }
-
- public String getOrganisationNom() { return organisationNom; }
- public void setOrganisationNom(String organisationNom) { this.organisationNom = organisationNom; }
-
- public UUID getFormulaireId() { return formulaireId; }
- public void setFormulaireId(UUID formulaireId) { this.formulaireId = formulaireId; }
-
- public String getFormulaireNom() { return formulaireNom; }
- public void setFormulaireNom(String formulaireNom) { this.formulaireNom = formulaireNom; }
-
- public StatutSouscription getStatut() { return statut; }
- public void setStatut(StatutSouscription statut) { this.statut = statut; }
-
- public TypeFacturation getTypeFacturation() { return typeFacturation; }
- public void setTypeFacturation(TypeFacturation typeFacturation) { this.typeFacturation = typeFacturation; }
-
- public LocalDate getDateDebut() { return dateDebut; }
- public void setDateDebut(LocalDate dateDebut) { this.dateDebut = dateDebut; }
-
- public LocalDate getDateFin() { return dateFin; }
- public void setDateFin(LocalDate dateFin) { this.dateFin = dateFin; }
-
- public LocalDate getDateDernierPaiement() { return dateDernierPaiement; }
- public void setDateDernierPaiement(LocalDate dateDernierPaiement) { this.dateDernierPaiement = dateDernierPaiement; }
-
- public LocalDate getDateProchainPaiement() { return dateProchainPaiement; }
- public void setDateProchainPaiement(LocalDate dateProchainPaiement) { this.dateProchainPaiement = dateProchainPaiement; }
-
- public Integer getQuotaMaxMembres() { return quotaMaxMembres; }
- public void setQuotaMaxMembres(Integer quotaMaxMembres) { this.quotaMaxMembres = quotaMaxMembres; }
-
- public Integer getMembresActuels() { return membresActuels; }
- public void setMembresActuels(Integer membresActuels) { this.membresActuels = membresActuels; }
-
- public BigDecimal getMontantSouscription() { return montantSouscription; }
- public void setMontantSouscription(BigDecimal montantSouscription) { this.montantSouscription = montantSouscription; }
-
- public String getDeviseCode() { return deviseCode; }
- public void setDeviseCode(String deviseCode) { this.deviseCode = deviseCode; }
-
- public String getNumeroFacture() { return numeroFacture; }
- public void setNumeroFacture(String numeroFacture) { this.numeroFacture = numeroFacture; }
-
- public String getReferencePaiement() { return referencePaiement; }
- public void setReferencePaiement(String referencePaiement) { this.referencePaiement = referencePaiement; }
-
- public boolean isRenouvellementAutomatique() { return renouvellementAutomatique; }
- public void setRenouvellementAutomatique(boolean renouvellementAutomatique) { this.renouvellementAutomatique = renouvellementAutomatique; }
-
- public String getMethodePaiementDefaut() { return methodePaiementDefaut; }
- public void setMethodePaiementDefaut(String methodePaiementDefaut) { this.methodePaiementDefaut = methodePaiementDefaut; }
-
- public boolean isNotificationExpiration() { return notificationExpiration; }
- public void setNotificationExpiration(boolean notificationExpiration) { this.notificationExpiration = notificationExpiration; }
-
- public boolean isNotificationQuotaAtteint() { return notificationQuotaAtteint; }
- public void setNotificationQuotaAtteint(boolean notificationQuotaAtteint) { this.notificationQuotaAtteint = notificationQuotaAtteint; }
-
- public int getJoursAvantNotificationExpiration() { return joursAvantNotificationExpiration; }
- public void setJoursAvantNotificationExpiration(int joursAvantNotificationExpiration) { this.joursAvantNotificationExpiration = joursAvantNotificationExpiration; }
-
- public LocalDateTime getDateCreation() { return dateCreation; }
- public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
-
- public LocalDateTime getDateMiseAJour() { return dateMiseAJour; }
- public void setDateMiseAJour(LocalDateTime dateMiseAJour) { this.dateMiseAJour = dateMiseAJour; }
-
- public String getCreePar() { return creePar; }
- public void setCreePar(String creePar) { this.creePar = creePar; }
-
- public String getModifiePar() { return modifiePar; }
- public void setModifiePar(String modifiePar) { this.modifiePar = modifiePar; }
-
- // Méthodes utilitaires
- public boolean isActive() {
- return statut == StatutSouscription.ACTIVE && !isExpiree();
- }
-
- public boolean isExpiree() {
- return LocalDate.now().isAfter(dateFin);
- }
-
- public boolean isQuotaAtteint() {
- return membresActuels != null && quotaMaxMembres != null &&
- membresActuels >= quotaMaxMembres;
- }
-
- public int getMembresRestants() {
- if (membresActuels != null && quotaMaxMembres != null) {
- return Math.max(0, quotaMaxMembres - membresActuels);
- }
- return 0;
- }
-
- public int getPourcentageUtilisation() {
- if (membresActuels != null && quotaMaxMembres != null && quotaMaxMembres > 0) {
- return (membresActuels * 100) / quotaMaxMembres;
- }
- return 0;
- }
-
- public String getMontantFormat() {
- if (montantSouscription != null) {
- return String.format("%,.0f %s", montantSouscription, deviseCode);
- }
- return "0 " + deviseCode;
- }
-
- public String getStatutCouleurClass() {
- return statut != null ? statut.getCouleurTexte() : "text-gray-600";
- }
-
- public String getStatutFondClass() {
- return statut != null ? statut.getCouleurFond() : "bg-gray-100";
- }
-
- public String getStatutLibelle() {
- return statut != null ? statut.getLibelle() : "Inconnu";
- }
-
- public long getJoursRestants() {
- if (dateFin != null) {
- return ChronoUnit.DAYS.between(LocalDate.now(), dateFin);
- }
- return 0;
- }
-
- public boolean isExpirationProche() {
- long joursRestants = getJoursRestants();
- return joursRestants <= joursAvantNotificationExpiration && joursRestants > 0;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/dev/lions/unionflow/client/dto/TypeOrganisationClientDTO.java b/src/main/java/dev/lions/unionflow/client/dto/TypeOrganisationClientDTO.java
deleted file mode 100644
index 6fa4437..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/TypeOrganisationClientDTO.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import java.io.Serializable;
-import java.time.LocalDateTime;
-import java.util.UUID;
-
-/**
- * DTO client pour le catalogue des types d'organisation.
- *
- *
Correspond au TypeOrganisationDTO du module server-api, mais sans dépendance directe.
- */
-public class TypeOrganisationClientDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private UUID id;
- private String code;
- private String libelle;
- private String description;
- private Integer ordreAffichage;
- private Boolean actif;
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime dateCreation;
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime dateModification;
- private Long version;
-
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getCode() { return code; }
- public void setCode(String code) { this.code = code; }
-
- public String getLibelle() { return libelle; }
- public void setLibelle(String libelle) { this.libelle = libelle; }
-
- public String getDescription() { return description; }
- public void setDescription(String description) { this.description = description; }
-
- public Integer getOrdreAffichage() { return ordreAffichage; }
- public void setOrdreAffichage(Integer ordreAffichage) { this.ordreAffichage = ordreAffichage; }
-
- public Boolean getActif() { return actif; }
- public void setActif(Boolean actif) { this.actif = actif; }
-
- public LocalDateTime getDateCreation() { return dateCreation; }
- public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
-
- public LocalDateTime getDateModification() { return dateModification; }
- public void setDateModification(LocalDateTime dateModification) { this.dateModification = dateModification; }
-
- public Long getVersion() { return version; }
- public void setVersion(Long version) { this.version = version; }
-}
-
-
diff --git a/src/main/java/dev/lions/unionflow/client/dto/WaveBalanceDTO.java b/src/main/java/dev/lions/unionflow/client/dto/WaveBalanceDTO.java
deleted file mode 100644
index ee8d2c9..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/WaveBalanceDTO.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-
-/**
- * DTO client pour le solde Wave Money
- *
- * @author UnionFlow Team
- * @version 1.0
- * @since 2025-01-17
- */
-public class WaveBalanceDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private BigDecimal soldeDisponible;
- private BigDecimal soldeEnAttente;
- private BigDecimal soldeTotal;
- private String devise;
- private String numeroWallet;
- private String nomBusiness;
- private LocalDateTime dateDerniereMiseAJour;
- private LocalDateTime dateDerniereSynchronisation;
- private String statutWallet;
- private BigDecimal limiteQuotidienne;
- private BigDecimal montantUtiliseAujourdhui;
- private BigDecimal limiteMensuelle;
- private BigDecimal montantUtiliseCeMois;
- private Integer nombreTransactionsAujourdhui;
- private Integer nombreTransactionsCeMois;
-
- // Getters et Setters
- public BigDecimal getSoldeDisponible() { return soldeDisponible; }
- public void setSoldeDisponible(BigDecimal soldeDisponible) { this.soldeDisponible = soldeDisponible; }
-
- public BigDecimal getSoldeEnAttente() { return soldeEnAttente; }
- public void setSoldeEnAttente(BigDecimal soldeEnAttente) { this.soldeEnAttente = soldeEnAttente; }
-
- public BigDecimal getSoldeTotal() { return soldeTotal; }
- public void setSoldeTotal(BigDecimal soldeTotal) { this.soldeTotal = soldeTotal; }
-
- public String getDevise() { return devise; }
- public void setDevise(String devise) { this.devise = devise; }
-
- public String getNumeroWallet() { return numeroWallet; }
- public void setNumeroWallet(String numeroWallet) { this.numeroWallet = numeroWallet; }
-
- public String getNomBusiness() { return nomBusiness; }
- public void setNomBusiness(String nomBusiness) { this.nomBusiness = nomBusiness; }
-
- public LocalDateTime getDateDerniereMiseAJour() { return dateDerniereMiseAJour; }
- public void setDateDerniereMiseAJour(LocalDateTime dateDerniereMiseAJour) { this.dateDerniereMiseAJour = dateDerniereMiseAJour; }
-
- public LocalDateTime getDateDerniereSynchronisation() { return dateDerniereSynchronisation; }
- public void setDateDerniereSynchronisation(LocalDateTime dateDerniereSynchronisation) { this.dateDerniereSynchronisation = dateDerniereSynchronisation; }
-
- public String getStatutWallet() { return statutWallet; }
- public void setStatutWallet(String statutWallet) { this.statutWallet = statutWallet; }
-
- public BigDecimal getLimiteQuotidienne() { return limiteQuotidienne; }
- public void setLimiteQuotidienne(BigDecimal limiteQuotidienne) { this.limiteQuotidienne = limiteQuotidienne; }
-
- public BigDecimal getMontantUtiliseAujourdhui() { return montantUtiliseAujourdhui; }
- public void setMontantUtiliseAujourdhui(BigDecimal montantUtiliseAujourdhui) { this.montantUtiliseAujourdhui = montantUtiliseAujourdhui; }
-
- public BigDecimal getLimiteMensuelle() { return limiteMensuelle; }
- public void setLimiteMensuelle(BigDecimal limiteMensuelle) { this.limiteMensuelle = limiteMensuelle; }
-
- public BigDecimal getMontantUtiliseCeMois() { return montantUtiliseCeMois; }
- public void setMontantUtiliseCeMois(BigDecimal montantUtiliseCeMois) { this.montantUtiliseCeMois = montantUtiliseCeMois; }
-
- public Integer getNombreTransactionsAujourdhui() { return nombreTransactionsAujourdhui; }
- public void setNombreTransactionsAujourdhui(Integer nombreTransactionsAujourdhui) { this.nombreTransactionsAujourdhui = nombreTransactionsAujourdhui; }
-
- public Integer getNombreTransactionsCeMois() { return nombreTransactionsCeMois; }
- public void setNombreTransactionsCeMois(Integer nombreTransactionsCeMois) { this.nombreTransactionsCeMois = nombreTransactionsCeMois; }
-
- /**
- * Formate le solde disponible pour l'affichage
- */
- public String getSoldeDisponibleFormate() {
- if (soldeDisponible == null) return "0 FCFA";
- return String.format("%.0f FCFA", soldeDisponible.doubleValue());
- }
-
- /**
- * Formate le solde total pour l'affichage
- */
- public String getSoldeTotalFormate() {
- if (soldeTotal == null) return "0 FCFA";
- return String.format("%.0f FCFA", soldeTotal.doubleValue());
- }
-
- /**
- * Vérifie si le wallet est actif
- */
- public boolean isWalletActif() {
- return "ACTIVE".equals(statutWallet);
- }
-}
diff --git a/src/main/java/dev/lions/unionflow/client/dto/WaveCheckoutSessionDTO.java b/src/main/java/dev/lions/unionflow/client/dto/WaveCheckoutSessionDTO.java
deleted file mode 100644
index 32ab996..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/WaveCheckoutSessionDTO.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package dev.lions.unionflow.client.dto;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-import java.util.UUID;
-
-/**
- * DTO client pour les sessions de paiement Wave Money
- *
- * @author UnionFlow Team
- * @version 1.0
- * @since 2025-01-17
- */
-public class WaveCheckoutSessionDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private UUID id;
- private String waveSessionId;
- private String waveUrl;
- private BigDecimal montant;
- private String devise;
- private String successUrl;
- private String errorUrl;
- private String statut;
- private UUID organisationId;
- private String nomOrganisation;
- private UUID membreId;
- private String nomMembre;
- private String typePaiement;
- private String referenceUnionFlow;
- private String description;
- private String nomBusinessAffiche;
- private LocalDateTime dateCreation;
- private LocalDateTime dateExpiration;
- private LocalDateTime dateCompletion;
- private String telephonePayeur;
- private String emailPayeur;
-
- // Getters et Setters
- public UUID getId() { return id; }
- public void setId(UUID id) { this.id = id; }
-
- public String getWaveSessionId() { return waveSessionId; }
- public void setWaveSessionId(String waveSessionId) { this.waveSessionId = waveSessionId; }
-
- public String getWaveUrl() { return waveUrl; }
- public void setWaveUrl(String waveUrl) { this.waveUrl = waveUrl; }
-
- public BigDecimal getMontant() { return montant; }
- public void setMontant(BigDecimal montant) { this.montant = montant; }
-
- public String getDevise() { return devise; }
- public void setDevise(String devise) { this.devise = devise; }
-
- public String getSuccessUrl() { return successUrl; }
- public void setSuccessUrl(String successUrl) { this.successUrl = successUrl; }
-
- public String getErrorUrl() { return errorUrl; }
- public void setErrorUrl(String errorUrl) { this.errorUrl = errorUrl; }
-
- public String getStatut() { return statut; }
- public void setStatut(String statut) { this.statut = statut; }
-
- public UUID getOrganisationId() { return organisationId; }
- public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; }
-
- public String getNomOrganisation() { return nomOrganisation; }
- public void setNomOrganisation(String nomOrganisation) { this.nomOrganisation = nomOrganisation; }
-
- public UUID getMembreId() { return membreId; }
- public void setMembreId(UUID membreId) { this.membreId = membreId; }
-
- public String getNomMembre() { return nomMembre; }
- public void setNomMembre(String nomMembre) { this.nomMembre = nomMembre; }
-
- public String getTypePaiement() { return typePaiement; }
- public void setTypePaiement(String typePaiement) { this.typePaiement = typePaiement; }
-
- public String getReferenceUnionFlow() { return referenceUnionFlow; }
- public void setReferenceUnionFlow(String referenceUnionFlow) { this.referenceUnionFlow = referenceUnionFlow; }
-
- public String getDescription() { return description; }
- public void setDescription(String description) { this.description = description; }
-
- public String getNomBusinessAffiche() { return nomBusinessAffiche; }
- public void setNomBusinessAffiche(String nomBusinessAffiche) { this.nomBusinessAffiche = nomBusinessAffiche; }
-
- public LocalDateTime getDateCreation() { return dateCreation; }
- public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
-
- public LocalDateTime getDateExpiration() { return dateExpiration; }
- public void setDateExpiration(LocalDateTime dateExpiration) { this.dateExpiration = dateExpiration; }
-
- public LocalDateTime getDateCompletion() { return dateCompletion; }
- public void setDateCompletion(LocalDateTime dateCompletion) { this.dateCompletion = dateCompletion; }
-
- public String getTelephonePayeur() { return telephonePayeur; }
- public void setTelephonePayeur(String telephonePayeur) { this.telephonePayeur = telephonePayeur; }
-
- public String getEmailPayeur() { return emailPayeur; }
- public void setEmailPayeur(String emailPayeur) { this.emailPayeur = emailPayeur; }
-
- /**
- * Retourne le libellé du statut
- */
- public String getStatutLibelle() {
- if (statut == null) return "Inconnu";
- return switch (statut) {
- case "PENDING" -> "En attente";
- case "COMPLETED" -> "Complétée";
- case "CANCELLED" -> "Annulée";
- case "EXPIRED" -> "Expirée";
- case "FAILED" -> "Échouée";
- default -> statut;
- };
- }
-
- /**
- * Retourne la sévérité PrimeFaces pour le statut
- */
- public String getStatutSeverity() {
- if (statut == null) return "info";
- return switch (statut) {
- case "PENDING" -> "warning";
- case "COMPLETED" -> "success";
- case "CANCELLED" -> "info";
- case "EXPIRED" -> "warn";
- case "FAILED" -> "error";
- default -> "info";
- };
- }
-
- /**
- * Vérifie si la session est expirée
- */
- public boolean isExpiree() {
- return dateExpiration != null && LocalDateTime.now().isAfter(dateExpiration);
- }
-
- /**
- * Vérifie si la session est complétée
- */
- public boolean isCompletee() {
- return "COMPLETED".equals(statut);
- }
-}
diff --git a/src/main/java/dev/lions/unionflow/client/dto/auth/LoginRequest.java b/src/main/java/dev/lions/unionflow/client/dto/auth/LoginRequest.java
deleted file mode 100644
index 0d9afc9..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/auth/LoginRequest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package dev.lions.unionflow.client.dto.auth;
-
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.Size;
-
-public class LoginRequest {
-
- @NotBlank(message = "L'email ou nom d'utilisateur est requis")
- @Size(min = 3, max = 100, message = "L'email ou nom d'utilisateur doit contenir entre 3 et 100 caractères")
- private String username;
-
- @NotBlank(message = "Le mot de passe est requis")
- @Size(min = 6, message = "Le mot de passe doit contenir au moins 6 caractères")
- private String password;
-
- @NotBlank(message = "Le type de compte est requis")
- private String typeCompte;
-
- private boolean rememberMe;
-
- public LoginRequest() {}
-
- public LoginRequest(String username, String password, String typeCompte) {
- this.username = username;
- this.password = password;
- this.typeCompte = typeCompte;
- }
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getTypeCompte() {
- return typeCompte;
- }
-
- public void setTypeCompte(String typeCompte) {
- this.typeCompte = typeCompte;
- }
-
- public boolean isRememberMe() {
- return rememberMe;
- }
-
- public void setRememberMe(boolean rememberMe) {
- this.rememberMe = rememberMe;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/dev/lions/unionflow/client/dto/auth/LoginResponse.java b/src/main/java/dev/lions/unionflow/client/dto/auth/LoginResponse.java
deleted file mode 100644
index 7b2b1d7..0000000
--- a/src/main/java/dev/lions/unionflow/client/dto/auth/LoginResponse.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package dev.lions.unionflow.client.dto.auth;
-
-import java.time.LocalDateTime;
-import java.util.List;
-import java.util.UUID;
-
-public class LoginResponse {
-
- private String accessToken;
- private String refreshToken;
- private String tokenType = "Bearer";
- private Long expiresIn;
- private LocalDateTime expirationDate;
-
- private UserInfo user;
-
- public LoginResponse() {}
-
- public LoginResponse(String accessToken, String refreshToken, Long expiresIn, UserInfo user) {
- this.accessToken = accessToken;
- this.refreshToken = refreshToken;
- this.expiresIn = expiresIn;
- this.user = user;
- this.expirationDate = LocalDateTime.now().plusSeconds(expiresIn);
- }
-
- public String getAccessToken() {
- return accessToken;
- }
-
- public void setAccessToken(String accessToken) {
- this.accessToken = accessToken;
- }
-
- public String getRefreshToken() {
- return refreshToken;
- }
-
- public void setRefreshToken(String refreshToken) {
- this.refreshToken = refreshToken;
- }
-
- public String getTokenType() {
- return tokenType;
- }
-
- public void setTokenType(String tokenType) {
- this.tokenType = tokenType;
- }
-
- public Long getExpiresIn() {
- return expiresIn;
- }
-
- public void setExpiresIn(Long expiresIn) {
- this.expiresIn = expiresIn;
- if (expiresIn != null) {
- this.expirationDate = LocalDateTime.now().plusSeconds(expiresIn);
- }
- }
-
- public LocalDateTime getExpirationDate() {
- return expirationDate;
- }
-
- public void setExpirationDate(LocalDateTime expirationDate) {
- this.expirationDate = expirationDate;
- }
-
- public UserInfo getUser() {
- return user;
- }
-
- public void setUser(UserInfo user) {
- this.user = user;
- }
-
- public boolean isExpired() {
- return expirationDate != null && LocalDateTime.now().isAfter(expirationDate);
- }
-
- public static class UserInfo {
- private UUID id;
- private String nom;
- private String prenom;
- private String email;
- private String username;
- private String typeCompte;
- private List roles;
- private List permissions;
- private EntiteInfo entite;
-
- public UserInfo() {}
-
- public UUID getId() {
- return id;
- }
-
- public void setId(UUID id) {
- this.id = id;
- }
-
- public String getNom() {
- return nom;
- }
-
- public void setNom(String nom) {
- this.nom = nom;
- }
-
- public String getPrenom() {
- return prenom;
- }
-
- public void setPrenom(String prenom) {
- this.prenom = prenom;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getTypeCompte() {
- return typeCompte;
- }
-
- public void setTypeCompte(String typeCompte) {
- this.typeCompte = typeCompte;
- }
-
- public List getRoles() {
- return roles;
- }
-
- public void setRoles(List roles) {
- this.roles = roles;
- }
-
- public List getPermissions() {
- return permissions;
- }
-
- public void setPermissions(List permissions) {
- this.permissions = permissions;
- }
-
- public EntiteInfo getEntite() {
- return entite;
- }
-
- public void setEntite(EntiteInfo entite) {
- this.entite = entite;
- }
-
- public String getNomComplet() {
- if (prenom != null && nom != null) {
- return prenom + " " + nom;
- }
- return nom != null ? nom : username;
- }
- }
-
- public static class EntiteInfo {
- private UUID id;
- private String nom;
- private String type;
- private String pays;
- private String ville;
-
- public EntiteInfo() {}
-
- public UUID getId() {
- return id;
- }
-
- public void setId(UUID id) {
- this.id = id;
- }
-
- public String getNom() {
- return nom;
- }
-
- public void setNom(String nom) {
- this.nom = nom;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getPays() {
- return pays;
- }
-
- public void setPays(String pays) {
- this.pays = pays;
- }
-
- public String getVille() {
- return ville;
- }
-
- public void setVille(String ville) {
- this.ville = ville;
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/java/dev/lions/unionflow/client/el/QuarkusArcELResolver.java b/src/main/java/dev/lions/unionflow/client/el/QuarkusArcELResolver.java
new file mode 100644
index 0000000..25e827e
--- /dev/null
+++ b/src/main/java/dev/lions/unionflow/client/el/QuarkusArcELResolver.java
@@ -0,0 +1,138 @@
+package dev.lions.unionflow.client.el;
+
+import jakarta.el.ELContext;
+import jakarta.el.ELResolver;
+import jakarta.enterprise.inject.spi.Bean;
+import jakarta.enterprise.inject.spi.BeanManager;
+import jakarta.enterprise.inject.spi.CDI;
+import java.util.Set;
+
+/**
+ * ELResolver personnalisé pour intégrer Quarkus Arc avec MyFaces JSF.
+ *
+ *
Ce resolver permet à MyFaces d'utiliser les beans CDI gérés par Quarkus Arc
+ * dans les expressions EL (#{bean.property}).
+ *
+ *
Quarkus Arc ne supporte pas la méthode BeanManager.getELResolver(),
+ * donc nous devons créer notre propre resolver qui utilise Arc directement.
+ *
+ * @author UnionFlow Team
+ * @version 1.0
+ */
+public class QuarkusArcELResolver extends ELResolver {
+
+ /**
+ * Obtient le BeanManager via CDI.current().
+ * Cette méthode est thread-safe et fonctionne avec Quarkus Arc.
+ */
+ private BeanManager getBeanManager() {
+ try {
+ CDI