package dev.lions.unionflow.server.entity;

import static org.assertj.core.api.Assertions.assertThat;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.UUID;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

class FormationLbcFtTest {

  @Test
  @DisplayName("Builder valeurs par défaut")
  void builderDefaults() {
    FormationLbcFt f = FormationLbcFt.builder()
        .organisationId(UUID.randomUUID())
        .titre("Formation annuelle 2026")
        .dateSession(LocalDateTime.now())
        .anneeReference(2026)
        .build();

    assertThat(f.getTypeFormation()).isEqualTo("STANDARD");
    assertThat(f.getDureeHeures()).isEqualByComparingTo(new BigDecimal("4.0"));
    assertThat(f.getStatut()).isEqualTo("PLANIFIEE");
  }

  @Test
  @DisplayName("Type formation override")
  void typeFormationOverride() {
    FormationLbcFt f = FormationLbcFt.builder()
        .organisationId(UUID.randomUUID())
        .titre("Compliance Officer Advanced")
        .typeFormation("COMPLIANCE_OFFICER")
        .dureeHeures(new BigDecimal("16.0"))
        .dateSession(LocalDateTime.now())
        .anneeReference(2026)
        .build();

    assertThat(f.getTypeFormation()).isEqualTo("COMPLIANCE_OFFICER");
    assertThat(f.getDureeHeures()).isEqualByComparingTo(new BigDecimal("16.0"));
  }
}
