fix(client): Ajout des propriétés manquantes dans MembreDTO pour liste.xhtml
- Ajout des champs : membreBureau, responsable, dateAdhesion, region, ville, quartier, role - Ajout des propriétés dérivées : * typeMembre, typeSeverity, typeIcon : basés sur responsable/membreBureau * statutIcon : icône selon le statut * entite : nom de l'association * anciennete : calcul depuis dateInscription * cotisationStatut, cotisationColor, dernierPaiement : valeurs par défaut (TODO) * tauxParticipation, evenementsAnnee : valeurs par défaut (TODO) - Résout PropertyNotFoundException pour typeSeverity et autres propriétés - Les propriétés de cotisation et participation sont des placeholders à remplacer par vraies données
This commit is contained in:
@@ -79,6 +79,24 @@ public class MembreDTO implements Serializable {
|
||||
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() {}
|
||||
|
||||
@@ -155,6 +173,27 @@ public class MembreDTO implements Serializable {
|
||||
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 : "");
|
||||
@@ -191,6 +230,72 @@ public class MembreDTO implements Serializable {
|
||||
};
|
||||
}
|
||||
|
||||
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 (valeurs par défaut - à remplacer par vraies données)
|
||||
public String getCotisationStatut() {
|
||||
return "À jour"; // TODO: Calculer depuis les vraies cotisations
|
||||
}
|
||||
|
||||
public String getCotisationColor() {
|
||||
return "text-green-500"; // TODO: Calculer selon le statut réel
|
||||
}
|
||||
|
||||
public String getDernierPaiement() {
|
||||
return "Nov 2025"; // TODO: Récupérer la vraie date
|
||||
}
|
||||
|
||||
// Propriétés pour la participation aux événements (valeurs par défaut - à remplacer)
|
||||
public String getTauxParticipation() {
|
||||
return "75"; // TODO: Calculer le vrai taux
|
||||
}
|
||||
|
||||
public String getEvenementsAnnee() {
|
||||
return "12"; // TODO: Compter les vrais événements
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MembreDTO{" +
|
||||
|
||||
Reference in New Issue
Block a user