Refactroring
This commit is contained in:
@@ -0,0 +1,274 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
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<String, Object> metadonnees;
|
||||
private BigDecimal indicateurFiabilite;
|
||||
private Integer nombreElementsAnalyses;
|
||||
private Long tempsCalculMs;
|
||||
private Boolean tempsReel;
|
||||
private Boolean necessiteMiseAJour;
|
||||
private Integer niveauPriorite;
|
||||
private java.util.List<String> 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<String, Object> getMetadonnees() { return metadonnees; }
|
||||
public void setMetadonnees(Map<String, Object> 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<String> getTags() { return tags; }
|
||||
public void setTags(java.util.List<String> 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<String, Object> 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<String, Object>) 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<String> tagsList = (java.util.List<String>) 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.lions.unionflow.client.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDate;
|
||||
@@ -24,6 +25,7 @@ public class AssociationDTO implements Serializable {
|
||||
private String siteWeb;
|
||||
|
||||
@NotNull(message = "Le type d'association est obligatoire")
|
||||
@JsonProperty("typeOrganisation")
|
||||
private String typeAssociation;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@@ -42,6 +44,7 @@ public class AssociationDTO implements Serializable {
|
||||
private String region;
|
||||
private String ville;
|
||||
private String quartier;
|
||||
private String pays;
|
||||
|
||||
// Constructeurs
|
||||
public AssociationDTO() {}
|
||||
@@ -111,6 +114,9 @@ public class AssociationDTO implements Serializable {
|
||||
|
||||
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; }
|
||||
|
||||
// Propriétés dérivées
|
||||
public String getTypeLibelle() {
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,17 @@ 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;
|
||||
@@ -27,8 +36,10 @@ public class CotisationDTO implements Serializable {
|
||||
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; }
|
||||
@@ -64,7 +75,7 @@ public class CotisationDTO implements Serializable {
|
||||
public BigDecimal getMontantDu() { return montantDu; }
|
||||
public void setMontantDu(BigDecimal montantDu) { this.montantDu = montantDu; }
|
||||
|
||||
public BigDecimal getMontantPaye() { return montantPaye; }
|
||||
public BigDecimal getMontantPaye() { return montantPaye != null ? montantPaye : BigDecimal.ZERO; }
|
||||
public void setMontantPaye(BigDecimal montantPaye) { this.montantPaye = montantPaye; }
|
||||
|
||||
public String getCodeDevise() { return codeDevise; }
|
||||
@@ -82,10 +93,178 @@ public class CotisationDTO implements Serializable {
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,31 +5,82 @@ 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 type;
|
||||
private String statut;
|
||||
private String priorite;
|
||||
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 organisateurEmail;
|
||||
private String emailOrganisateur;
|
||||
private String telephoneOrganisateur;
|
||||
|
||||
// Participants
|
||||
private Integer capaciteMax;
|
||||
private Integer participantsInscrits;
|
||||
private Integer participantsPresents;
|
||||
|
||||
// Budget
|
||||
private BigDecimal budget;
|
||||
private UUID organisationId;
|
||||
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; }
|
||||
@@ -41,8 +92,8 @@ public class EvenementDTO implements Serializable {
|
||||
public String getDescription() { return description; }
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
|
||||
public String getType() { return type; }
|
||||
public void setType(String type) { this.type = type; }
|
||||
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; }
|
||||
@@ -62,31 +113,380 @@ public class EvenementDTO implements Serializable {
|
||||
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 getOrganisateurEmail() { return organisateurEmail; }
|
||||
public void setOrganisateurEmail(String organisateurEmail) { this.organisateurEmail = organisateurEmail; }
|
||||
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; }
|
||||
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 UUID getOrganisationId() { return organisationId; }
|
||||
public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; }
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
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.
|
||||
*
|
||||
* <p>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; }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user