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,
                7,  // nombreCotisationsTotal (toutes années, tous statuts)
                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);
    }
}
