fix(client): version 1.0.4, accesseurs JavaBean sur OrganisationSummaryResponse (compat JSF/EL)
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package dev.lions.unionflow.client.api.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -7,29 +11,33 @@ import java.time.LocalDate;
|
||||
/**
|
||||
* DTO received from the backend for the member dashboard synthesis.
|
||||
*/
|
||||
public record MembreDashboardResponse(
|
||||
String prenom,
|
||||
String nom,
|
||||
LocalDate dateInscription,
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MembreDashboardResponse implements Serializable {
|
||||
|
||||
// Cotisations
|
||||
BigDecimal mesCotisationsPaiement,
|
||||
String statutCotisations,
|
||||
Integer tauxCotisationsPerso,
|
||||
private String prenom;
|
||||
private String nom;
|
||||
private LocalDate dateInscription;
|
||||
|
||||
// Epargne
|
||||
BigDecimal monSoldeEpargne,
|
||||
BigDecimal evolutionEpargneNombre,
|
||||
String evolutionEpargne,
|
||||
Integer objectifEpargne,
|
||||
// Cotisations
|
||||
private BigDecimal mesCotisationsPaiement;
|
||||
private String statutCotisations;
|
||||
private Integer tauxCotisationsPerso;
|
||||
|
||||
// Evenements
|
||||
Integer mesEvenementsInscrits,
|
||||
Integer evenementsAVenir,
|
||||
Integer tauxParticipationPerso,
|
||||
// Epargne
|
||||
private BigDecimal monSoldeEpargne;
|
||||
private BigDecimal evolutionEpargneNombre;
|
||||
private String evolutionEpargne;
|
||||
private Integer objectifEpargne;
|
||||
|
||||
// Aides
|
||||
Integer mesDemandesAide,
|
||||
Integer aidesEnCours,
|
||||
Integer tauxAidesApprouvees) implements Serializable {
|
||||
// Evenements
|
||||
private Integer mesEvenementsInscrits;
|
||||
private Integer evenementsAVenir;
|
||||
private Integer tauxParticipationPerso;
|
||||
|
||||
// Aides
|
||||
private Integer mesDemandesAide;
|
||||
private Integer aidesEnCours;
|
||||
private Integer tauxAidesApprouvees;
|
||||
}
|
||||
|
||||
@@ -152,11 +152,11 @@ public class AdhesionsBean implements Serializable {
|
||||
items.add(new SelectItem(null, "Sélectionner une organisation"));
|
||||
if (listeAssociations != null) {
|
||||
for (OrganisationSummaryResponse assoc : listeAssociations) {
|
||||
String label = assoc.nom();
|
||||
if (assoc.typeOrganisation() != null) {
|
||||
label += " (" + assoc.typeOrganisation() + ")";
|
||||
String label = assoc.getNom();
|
||||
if (assoc.getTypeOrganisation() != null) {
|
||||
label += " (" + assoc.getTypeOrganisation() + ")";
|
||||
}
|
||||
items.add(new SelectItem(assoc.id(), label));
|
||||
items.add(new SelectItem(assoc.getId(), label));
|
||||
}
|
||||
}
|
||||
return items;
|
||||
|
||||
@@ -680,7 +680,7 @@ public class CotisationsBean implements Serializable {
|
||||
|
||||
try {
|
||||
IntentionStatutResponse statut = paiementClientService.getStatutIntention(waveIntentionId);
|
||||
this.waveStatut = statut.statut();
|
||||
this.waveStatut = statut.getStatut();
|
||||
|
||||
if ("COMPLETEE".equals(waveStatut)) {
|
||||
waveDialogOuvert = false;
|
||||
|
||||
@@ -352,8 +352,8 @@ public class CotisationsGestionBean implements Serializable {
|
||||
if (response != null && response.getData() != null) {
|
||||
for (OrganisationSummaryResponse assoc : response.getData()) {
|
||||
Organisation org = new Organisation();
|
||||
org.setId(assoc.id());
|
||||
org.setNom(assoc.nom());
|
||||
org.setId(assoc.getId());
|
||||
org.setNom(assoc.getNom());
|
||||
listeOrganisations.add(org);
|
||||
}
|
||||
}
|
||||
@@ -391,7 +391,7 @@ public class CotisationsGestionBean implements Serializable {
|
||||
|
||||
for (OrganisationSummaryResponse assoc : associations.stream().limit(5).collect(Collectors.toList())) {
|
||||
List<CotisationResponse> cotisationsOrg = cotisationsDTO.stream()
|
||||
.filter(c -> c.getOrganisationId() != null && c.getOrganisationId().equals(assoc.id()))
|
||||
.filter(c -> c.getOrganisationId() != null && c.getOrganisationId().equals(assoc.getId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
long total = cotisationsOrg.size();
|
||||
@@ -404,7 +404,7 @@ public class CotisationsGestionBean implements Serializable {
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
OrganisationPerformante org = new OrganisationPerformante();
|
||||
org.setNom(assoc.nom());
|
||||
org.setNom(assoc.getNom());
|
||||
org.setTauxRecouvrement(taux);
|
||||
org.setMontantCollecte(formatMontant(montantCollecte));
|
||||
org.setNombreMembresAJour((int) payees);
|
||||
|
||||
@@ -94,22 +94,22 @@ public class DashboardMembreBean implements Serializable {
|
||||
try {
|
||||
MembreDashboardResponse data = dashboardClient.getMonDashboard();
|
||||
if (data != null) {
|
||||
this.prenomMembre = data.prenom();
|
||||
this.nomMembre = data.nom();
|
||||
this.dateInscription = data.dateInscription();
|
||||
this.mesCotisationsPaiement = formatMontant(data.mesCotisationsPaiement());
|
||||
this.statutCotisations = data.statutCotisations() != null ? data.statutCotisations() : "Non disponible";
|
||||
this.tauxCotisationsPerso = data.tauxCotisationsPerso();
|
||||
this.monSoldeEpargne = formatMontant(data.monSoldeEpargne());
|
||||
this.evolutionEpargneNombre = formatMontant(data.evolutionEpargneNombre());
|
||||
this.evolutionEpargne = data.evolutionEpargne() != null ? data.evolutionEpargne() : "+0%";
|
||||
this.objectifEpargne = data.objectifEpargne();
|
||||
this.mesEvenementsInscrits = data.mesEvenementsInscrits() != null ? data.mesEvenementsInscrits() : 0;
|
||||
this.evenementsAVenir = data.evenementsAVenir() != null ? data.evenementsAVenir() : 0;
|
||||
this.tauxParticipationPerso = data.tauxParticipationPerso();
|
||||
this.mesDemandesAide = data.mesDemandesAide() != null ? data.mesDemandesAide() : 0;
|
||||
this.aidesEnCours = data.aidesEnCours() != null ? data.aidesEnCours() : 0;
|
||||
this.tauxAidesApprouvees = data.tauxAidesApprouvees();
|
||||
this.prenomMembre = data.getPrenom();
|
||||
this.nomMembre = data.getNom();
|
||||
this.dateInscription = data.getDateInscription();
|
||||
this.mesCotisationsPaiement = formatMontant(data.getMesCotisationsPaiement());
|
||||
this.statutCotisations = data.getStatutCotisations() != null ? data.getStatutCotisations() : "Non disponible";
|
||||
this.tauxCotisationsPerso = data.getTauxCotisationsPerso();
|
||||
this.monSoldeEpargne = formatMontant(data.getMonSoldeEpargne());
|
||||
this.evolutionEpargneNombre = formatMontant(data.getEvolutionEpargneNombre());
|
||||
this.evolutionEpargne = data.getEvolutionEpargne() != null ? data.getEvolutionEpargne() : "+0%";
|
||||
this.objectifEpargne = data.getObjectifEpargne();
|
||||
this.mesEvenementsInscrits = data.getMesEvenementsInscrits() != null ? data.getMesEvenementsInscrits() : 0;
|
||||
this.evenementsAVenir = data.getEvenementsAVenir() != null ? data.getEvenementsAVenir() : 0;
|
||||
this.tauxParticipationPerso = data.getTauxParticipationPerso();
|
||||
this.mesDemandesAide = data.getMesDemandesAide() != null ? data.getMesDemandesAide() : 0;
|
||||
this.aidesEnCours = data.getAidesEnCours() != null ? data.getAidesEnCours() : 0;
|
||||
this.tauxAidesApprouvees = data.getTauxAidesApprouvees();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("Erreur chargement KPI dashboard", e);
|
||||
|
||||
@@ -113,10 +113,10 @@ public class EntitesGestionBean implements Serializable {
|
||||
associations = response.getData();
|
||||
}
|
||||
statistiques.setTotalEntites(associations.size());
|
||||
long actives = associations.stream().filter(a -> "ACTIVE".equals(a.statut())).count();
|
||||
long actives = associations.stream().filter(a -> "ACTIVE".equals(a.getStatut())).count();
|
||||
statistiques.setEntitesActives((int) actives);
|
||||
int totalMembres = associations.stream()
|
||||
.mapToInt(a -> a.nombreMembres() != null ? a.nombreMembres() : 0)
|
||||
.mapToInt(a -> a.getNombreMembres() != null ? a.getNombreMembres() : 0)
|
||||
.sum();
|
||||
statistiques.setTotalMembres(totalMembres);
|
||||
double moyenne = associations.isEmpty() ? 0 : (double) totalMembres / associations.size();
|
||||
@@ -154,15 +154,15 @@ public class EntitesGestionBean implements Serializable {
|
||||
|
||||
private Entite convertToEntite(OrganisationSummaryResponse dto) {
|
||||
Entite entite = new Entite();
|
||||
entite.setId(dto.id());
|
||||
entite.setNom(dto.nom());
|
||||
entite.setCodeEntite(dto.nomCourt()); // Using nomCourt as code
|
||||
entite.setType(dto.typeOrganisation());
|
||||
entite.setTypeLibelle(typeCatalogueService.resolveLibelle(dto.typeOrganisation()));
|
||||
entite.setId(dto.getId());
|
||||
entite.setNom(dto.getNom());
|
||||
entite.setCodeEntite(dto.getNomCourt()); // Using nomCourt as code
|
||||
entite.setType(dto.getTypeOrganisation());
|
||||
entite.setTypeLibelle(typeCatalogueService.resolveLibelle(dto.getTypeOrganisation()));
|
||||
entite.setRegion(null); // Not available in Summary
|
||||
entite.setStatut(dto.statut());
|
||||
entite.setNombreMembres(dto.nombreMembres() != null ? dto.nombreMembres() : 0);
|
||||
entite.setMembresUtilises(dto.nombreMembres() != null ? dto.nombreMembres() : 0);
|
||||
entite.setStatut(dto.getStatut());
|
||||
entite.setNombreMembres(dto.getNombreMembres() != null ? dto.getNombreMembres() : 0);
|
||||
entite.setMembresUtilises(dto.getNombreMembres() != null ? dto.getNombreMembres() : 0);
|
||||
entite.setAdresse(null); // Not available in Summary
|
||||
entite.setTelephone(null); // Not available in Summary
|
||||
entite.setEmail(null); // Not available in Summary
|
||||
@@ -170,7 +170,7 @@ public class EntitesGestionBean implements Serializable {
|
||||
entite.setDerniereActivite(null); // Not available in Summary
|
||||
|
||||
try {
|
||||
SouscriptionStatutResponse souscription = souscriptionService.obtenirActive(dto.id());
|
||||
SouscriptionStatutResponse souscription = souscriptionService.obtenirActive(dto.getId());
|
||||
if (souscription != null) {
|
||||
entite.setForfaitSouscrit(
|
||||
souscription.getPlanCommercial() != null ? souscription.getPlanCommercial() : "Non défini");
|
||||
@@ -572,7 +572,7 @@ public class EntitesGestionBean implements Serializable {
|
||||
|
||||
for (OrganisationSummaryResponse assoc : associations) {
|
||||
try {
|
||||
SouscriptionStatutResponse souscription = souscriptionService.obtenirActive(assoc.id());
|
||||
SouscriptionStatutResponse souscription = souscriptionService.obtenirActive(assoc.getId());
|
||||
if (souscription != null) {
|
||||
totalSouscriptions++;
|
||||
if ("ACTIVE".equals(souscription.getStatut())) {
|
||||
|
||||
@@ -98,8 +98,8 @@ public class MembreExportBean implements Serializable {
|
||||
: new ArrayList<>();
|
||||
for (OrganisationSummaryResponse assoc : associations) {
|
||||
OrganisationResponse org = new OrganisationResponse();
|
||||
org.setId(assoc.id());
|
||||
org.setNom(assoc.nom());
|
||||
org.setId(assoc.getId());
|
||||
org.setNom(assoc.getNom());
|
||||
org.setVille(null /* ville not in Summary */);
|
||||
organisationsDisponibles.add(org);
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ public class MembreImportBean implements Serializable {
|
||||
: new ArrayList<>();
|
||||
for (OrganisationSummaryResponse assoc : associations) {
|
||||
OrganisationResponse org = new OrganisationResponse();
|
||||
org.setId(assoc.id());
|
||||
org.setNom(assoc.nom());
|
||||
org.setId(assoc.getId());
|
||||
org.setNom(assoc.getNom());
|
||||
org.setVille(null /* ville not in Summary */);
|
||||
organisationsDisponibles.add(org);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class MembreLazyDataModel extends LazyDataModelBase<MembreSummaryResponse
|
||||
|
||||
@Override
|
||||
public String getRowKey(MembreSummaryResponse object) {
|
||||
return object != null && object.id() != null ? object.id().toString() : null;
|
||||
return object != null && object.getId() != null ? object.getId().toString() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -148,8 +148,8 @@ public class MembreRechercheBean implements Serializable {
|
||||
if (response != null && response.getData() != null) {
|
||||
for (dev.lions.unionflow.server.api.dto.organisation.response.OrganisationSummaryResponse assoc : response.getData()) {
|
||||
Entite entite = new Entite();
|
||||
entite.setId(assoc.id());
|
||||
entite.setNom(assoc.nom());
|
||||
entite.setId(assoc.getId());
|
||||
entite.setNom(assoc.getNom());
|
||||
entitesDisponibles.add(entite);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,9 +70,9 @@ public class MessagingBean implements Serializable {
|
||||
|
||||
public void ouvrirConversation(ConversationResponse conversation) {
|
||||
this.conversationActive = conversation;
|
||||
chargerMessages(conversation.id());
|
||||
chargerMessages(conversation.getId());
|
||||
try {
|
||||
conversationService.marquerCommeLue(conversation.id());
|
||||
conversationService.marquerCommeLue(conversation.getId());
|
||||
} catch (Exception e) {
|
||||
LOGGER.warning("Impossible de marquer comme lue: " + e.getMessage());
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class MessagingBean implements Serializable {
|
||||
}
|
||||
try {
|
||||
SendMessageRequest request = SendMessageRequest.builder()
|
||||
.conversationId(conversationActive.id())
|
||||
.conversationId(conversationActive.getId())
|
||||
.content(contenuMessage.trim())
|
||||
.build();
|
||||
MessageResponse envoye = messageService.envoyer(request);
|
||||
@@ -135,7 +135,7 @@ public class MessagingBean implements Serializable {
|
||||
|
||||
public void archiverConversation(ConversationResponse conversation) {
|
||||
try {
|
||||
conversationService.archiver(conversation.id(), !conversation.isArchived());
|
||||
conversationService.archiver(conversation.getId(), !conversation.isArchived());
|
||||
chargerConversations();
|
||||
} catch (Exception e) {
|
||||
ajouterMessageErreur("Impossible de modifier la conversation.");
|
||||
@@ -144,7 +144,7 @@ public class MessagingBean implements Serializable {
|
||||
|
||||
public void basculerSilence(ConversationResponse conversation) {
|
||||
try {
|
||||
conversationService.basculerSilence(conversation.id());
|
||||
conversationService.basculerSilence(conversation.getId());
|
||||
chargerConversations();
|
||||
} catch (Exception e) {
|
||||
ajouterMessageErreur("Impossible de modifier le silence.");
|
||||
@@ -153,7 +153,7 @@ public class MessagingBean implements Serializable {
|
||||
|
||||
public void basculerEpinglage(ConversationResponse conversation) {
|
||||
try {
|
||||
conversationService.basculerEpinglage(conversation.id());
|
||||
conversationService.basculerEpinglage(conversation.getId());
|
||||
chargerConversations();
|
||||
} catch (Exception e) {
|
||||
ajouterMessageErreur("Impossible de modifier l'épinglage.");
|
||||
@@ -162,7 +162,7 @@ public class MessagingBean implements Serializable {
|
||||
|
||||
public void supprimerMessage(MessageResponse message) {
|
||||
try {
|
||||
messageService.supprimer(message.id());
|
||||
messageService.supprimer(message.getId());
|
||||
messagesConversationActive.remove(message);
|
||||
ajouterMessageSucces("Message supprimé.");
|
||||
} catch (Exception e) {
|
||||
@@ -173,7 +173,7 @@ public class MessagingBean implements Serializable {
|
||||
public void actualiser() {
|
||||
chargerConversations();
|
||||
if (conversationActive != null) {
|
||||
chargerMessages(conversationActive.id());
|
||||
chargerMessages(conversationActive.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ public class OrganisationStatistiquesBean implements Serializable {
|
||||
|
||||
long total = organisations.size();
|
||||
long actives = organisations.stream()
|
||||
.filter(o -> o.statut() != null && StatutOrganisationConstants.ACTIVE.equals(o.statut()))
|
||||
.filter(o -> o.getStatut() != null && StatutOrganisationConstants.ACTIVE.equals(o.getStatut()))
|
||||
.count();
|
||||
long inactives = total - actives;
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ public class OrganisationsBean implements Serializable {
|
||||
|
||||
totalOrganisations = toutes.size();
|
||||
organisationsActives = toutes.stream()
|
||||
.filter(o -> o.statut() != null && StatutOrganisationConstants.ACTIVE.equals(o.statut()))
|
||||
.filter(o -> o.getStatut() != null && StatutOrganisationConstants.ACTIVE.equals(o.getStatut()))
|
||||
.count();
|
||||
organisationsInactives = totalOrganisations - organisationsActives;
|
||||
|
||||
@@ -321,7 +321,7 @@ public class OrganisationsBean implements Serializable {
|
||||
public void preparerModification(OrganisationSummaryResponse org) {
|
||||
try {
|
||||
organisationSelectionnee = retryService.executeWithRetrySupplier(
|
||||
() -> organisationService.obtenirParId(org.id()),
|
||||
() -> organisationService.obtenirParId(org.getId()),
|
||||
"chargement de l'organisation pour modification");
|
||||
} catch (Exception e) {
|
||||
errorHandler.handleException(e, "lors du chargement de l'organisation", null);
|
||||
@@ -368,9 +368,9 @@ public class OrganisationsBean implements Serializable {
|
||||
*/
|
||||
public void preparerSuppression(OrganisationSummaryResponse org) {
|
||||
OrganisationResponse full = new OrganisationResponse();
|
||||
full.setId(org.id());
|
||||
full.setNom(org.nom());
|
||||
full.setStatut(org.statut());
|
||||
full.setId(org.getId());
|
||||
full.setNom(org.getNom());
|
||||
full.setStatut(org.getStatut());
|
||||
organisationPourSuppression = full;
|
||||
}
|
||||
|
||||
@@ -399,9 +399,9 @@ public class OrganisationsBean implements Serializable {
|
||||
*/
|
||||
public void preparerBasculerStatut(OrganisationSummaryResponse org) {
|
||||
OrganisationResponse full = new OrganisationResponse();
|
||||
full.setId(org.id());
|
||||
full.setNom(org.nom());
|
||||
full.setStatut(org.statut());
|
||||
full.setId(org.getId());
|
||||
full.setNom(org.getNom());
|
||||
full.setStatut(org.getStatut());
|
||||
organisationPourStatut = full;
|
||||
}
|
||||
|
||||
@@ -609,22 +609,22 @@ public class OrganisationsBean implements Serializable {
|
||||
.filter(org -> {
|
||||
if (rechercheGlobale != null && !rechercheGlobale.trim().isEmpty()) {
|
||||
String recherche = rechercheGlobale.toLowerCase();
|
||||
return (org.nom() != null && org.nom().toLowerCase().contains(recherche)) ||
|
||||
(org.nomCourt() != null && org.nomCourt().toLowerCase().contains(recherche)) ||
|
||||
(org.typeOrganisationLibelle() != null
|
||||
&& org.typeOrganisationLibelle().toLowerCase().contains(recherche));
|
||||
return (org.getNom() != null && org.getNom().toLowerCase().contains(recherche)) ||
|
||||
(org.getNomCourt() != null && org.getNomCourt().toLowerCase().contains(recherche)) ||
|
||||
(org.getTypeOrganisationLibelle() != null
|
||||
&& org.getTypeOrganisationLibelle().toLowerCase().contains(recherche));
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.filter(org -> {
|
||||
if (filtreStatut != null && !filtreStatut.trim().isEmpty()) {
|
||||
return filtreStatut.equals(org.statut());
|
||||
return filtreStatut.equals(org.getStatut());
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.filter(org -> {
|
||||
if (filtreType != null && !filtreType.trim().isEmpty()) {
|
||||
return filtreType.equals(org.typeOrganisation());
|
||||
return filtreType.equals(org.getTypeOrganisation());
|
||||
}
|
||||
return true;
|
||||
})
|
||||
|
||||
@@ -339,17 +339,17 @@ public class SuperAdminBean implements Serializable {
|
||||
: new ArrayList<>();
|
||||
topEntites = associations.stream()
|
||||
.sorted((a1, a2) -> {
|
||||
int m1 = a1.nombreMembres() != null ? a1.nombreMembres() : 0;
|
||||
int m2 = a2.nombreMembres() != null ? a2.nombreMembres() : 0;
|
||||
int m1 = a1.getNombreMembres() != null ? a1.getNombreMembres() : 0;
|
||||
int m2 = a2.getNombreMembres() != null ? a2.getNombreMembres() : 0;
|
||||
return Integer.compare(m2, m1);
|
||||
})
|
||||
.limit(5)
|
||||
.map(a -> {
|
||||
Entite entite = new Entite();
|
||||
entite.setId(a.id());
|
||||
entite.setNom(a.nom());
|
||||
entite.setTypeEntite(a.typeOrganisation());
|
||||
entite.setNombreMembres(a.nombreMembres() != null ? a.nombreMembres() : 0);
|
||||
entite.setId(a.getId());
|
||||
entite.setNom(a.getNom());
|
||||
entite.setTypeEntite(a.getTypeOrganisation());
|
||||
entite.setNombreMembres(a.getNombreMembres() != null ? a.getNombreMembres() : 0);
|
||||
return entite;
|
||||
})
|
||||
.collect(java.util.stream.Collectors.toList());
|
||||
|
||||
@@ -91,8 +91,8 @@ public class UtilisateursBean implements Serializable {
|
||||
: new ArrayList<>();
|
||||
for (OrganisationSummaryResponse assoc : associations) {
|
||||
Organisation org = new Organisation();
|
||||
org.setId(assoc.id());
|
||||
org.setNom(assoc.nom());
|
||||
org.setId(assoc.getId());
|
||||
org.setNom(assoc.getNom());
|
||||
organisationsDisponibles.add(org);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user