refactor: supprimer setTypeAssociation/setTypeLibelle doublons dans OrganisationService

- OrganisationService.convertToResponse: ne plus setter typeAssociation ni typeLibelle
- Utiliser uniquement typeOrganisation et typeOrganisationLibelle
- Corriger tests: assertions sur typeOrganisationLibelle au lieu de typeLibelle
This commit is contained in:
dahoud
2026-04-17 20:00:34 +00:00
parent 4b2b326afe
commit 9f14c2e345
2 changed files with 7 additions and 12 deletions

View File

@@ -593,18 +593,14 @@ public class OrganisationService {
}
dto.setTypeOrganisation(organisation.getTypeOrganisation());
dto.setTypeAssociation(organisation.getTypeOrganisation());
dto.setStatut(organisation.getStatut());
// Résolution des libellés
if (organisation.getTypeOrganisation() != null) {
typeReferenceRepository.findByDomaineAndCode("TYPE_ORGANISATION", organisation.getTypeOrganisation())
.ifPresent(ref -> {
dto.setTypeOrganisationLibelle(ref.getLibelle());
dto.setTypeLibelle(ref.getLibelle());
});
if (dto.getTypeLibelle() == null) {
dto.setTypeLibelle(organisation.getTypeOrganisation());
.ifPresent(ref -> dto.setTypeOrganisationLibelle(ref.getLibelle()));
if (dto.getTypeOrganisationLibelle() == null) {
dto.setTypeOrganisationLibelle(organisation.getTypeOrganisation());
}
}
if (organisation.getStatut() != null) {