feat(equipements): clean equipment search, fix category regression, and sync dotations on category change

This commit is contained in:
2026-06-15 23:11:05 +02:00
parent e1cd5930fd
commit c4bb9803ed
9 changed files with 368 additions and 11 deletions
@@ -23,13 +23,15 @@ public class AdherentController {
private final com.astalange.core.repository.LicenceRepository licenceRepository;
private final com.astalange.core.repository.ModePaiementRepository modePaiementRepository;
private final SaisonRepository saisonRepository;
private final com.astalange.core.service.CategorieService categorieService;
public AdherentController(AdherentRepository adherentRepository, CategorieRepository categorieRepository, com.astalange.core.repository.LicenceRepository licenceRepository, com.astalange.core.repository.ModePaiementRepository modePaiementRepository, SaisonRepository saisonRepository) {
public AdherentController(AdherentRepository adherentRepository, CategorieRepository categorieRepository, com.astalange.core.repository.LicenceRepository licenceRepository, com.astalange.core.repository.ModePaiementRepository modePaiementRepository, SaisonRepository saisonRepository, com.astalange.core.service.CategorieService categorieService) {
this.adherentRepository = adherentRepository;
this.categorieRepository = categorieRepository;
this.licenceRepository = licenceRepository;
this.modePaiementRepository = modePaiementRepository;
this.saisonRepository = saisonRepository;
this.categorieService = categorieService;
}
@org.springframework.web.bind.annotation.ModelAttribute("equipes")
@@ -187,7 +189,8 @@ public class AdherentController {
.orElse(null);
if (newCat != null) {
licence.setCategorie(newCat);
licenceRepository.save(licence);
licence = licenceRepository.save(licence);
categorieService.syncDotationsForLicence(licence);
}
}
}