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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user