feat(api): ajout totalCotisationsPayeesToutTemps dans MembreDashboardSyntheseResponse

- Champ pour la carte Contribution Totale (cotisations tout temps)
- Test unitaire mis à jour

Made-with: Cursor
This commit is contained in:
dahoud
2026-03-09 19:58:00 +00:00
parent b1957c1c81
commit 0a9dece955
2 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
package dev.lions.unionflow.server.api.dto.dashboard;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* DTO de synthèse dashboard membre (cotisations, épargne, événements, aides).
*
* @author UnionFlow Team
* @version 1.0
*/
public record MembreDashboardSyntheseResponse(
String prenom,
String nom,
LocalDate dateInscription,
// Cotisations
BigDecimal mesCotisationsPaiement,
/** Total des cotisations payées sur l'année en cours (pour affichage dashboard). */
BigDecimal totalCotisationsPayeesAnnee,
/** Total des cotisations payées tout temps (pour la carte « Contribution Totale »). */
BigDecimal totalCotisationsPayeesToutTemps,
/** Nombre de cotisations (payées ou total) pour la carte « Cotisations ». */
Integer nombreCotisationsPayees,
String statutCotisations,
Integer tauxCotisationsPerso,
// Epargne
BigDecimal monSoldeEpargne,
BigDecimal evolutionEpargneNombre,
String evolutionEpargne,
Integer objectifEpargne,
// Evenements
Integer mesEvenementsInscrits,
Integer evenementsAVenir,
Integer tauxParticipationPerso,
// Aides
Integer mesDemandesAide,
Integer aidesEnCours,
Integer tauxAidesApprouvees) implements Serializable {
}

View File

@@ -0,0 +1,53 @@
package dev.lions.unionflow.server.api.dto.dashboard;
import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigDecimal;
import java.time.LocalDate;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class MembreDashboardSyntheseResponseTest {
@Test
@DisplayName("Record MembreDashboardSyntheseResponse : construction et accesseurs")
void record_constructionAndAccessors() {
MembreDashboardSyntheseResponse dto = new MembreDashboardSyntheseResponse(
"Jean",
"Dupont",
LocalDate.of(2023, 1, 15),
BigDecimal.valueOf(50000),
BigDecimal.valueOf(150000),
BigDecimal.valueOf(200000),
5,
"À jour",
100,
BigDecimal.valueOf(250000),
BigDecimal.valueOf(10000),
"+4%",
500000,
3,
2,
75,
1,
0,
100
);
assertThat(dto.prenom()).isEqualTo("Jean");
assertThat(dto.nom()).isEqualTo("Dupont");
assertThat(dto.dateInscription()).isEqualTo(LocalDate.of(2023, 1, 15));
assertThat(dto.mesCotisationsPaiement()).isEqualByComparingTo(BigDecimal.valueOf(50000));
assertThat(dto.totalCotisationsPayeesAnnee()).isEqualByComparingTo(BigDecimal.valueOf(150000));
assertThat(dto.totalCotisationsPayeesToutTemps()).isEqualByComparingTo(BigDecimal.valueOf(200000));
assertThat(dto.nombreCotisationsPayees()).isEqualTo(5);
assertThat(dto.statutCotisations()).isEqualTo("À jour");
assertThat(dto.tauxCotisationsPerso()).isEqualTo(100);
assertThat(dto.monSoldeEpargne()).isEqualByComparingTo(BigDecimal.valueOf(250000));
assertThat(dto.objectifEpargne()).isEqualTo(500000);
assertThat(dto.mesEvenementsInscrits()).isEqualTo(3);
assertThat(dto.tauxParticipationPerso()).isEqualTo(75);
assertThat(dto.mesDemandesAide()).isEqualTo(1);
assertThat(dto.tauxAidesApprouvees()).isEqualTo(100);
}
}