Refactor: Move equipment price and mandatory status to Categorie relationship
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 3m7s
AS Talange CI/CD Pipeline / Build & Run in Docker Container (push) Successful in 3m34s

- Created CategorieEquipement entity to act as a join table between Category and Equipment.
- Moved 'obligatoire' and 'prix' (formerly prixContribution) fields from Equipement to the new CategorieEquipement entity.
- Added Flyway migrations V14 and V15 to update the database schema and migrate existing data.
- Updated Categorie UI to use a select dropdown and price input for managing category-specific equipment configurations.
- Replaced 'equipement.obligatoire' and 'equipement.prixContribution' calls with their new category-level equivalents in logic and templates.
- Updated pricing calculation in Licence entity to source prices dynamically from the Categorie configuration.
- Updated Dotation generation logic to sync with category requirements automatically.
This commit is contained in:
2026-06-11 22:57:16 +02:00
parent 1a4ff6fdac
commit bca84be16a
17 changed files with 351 additions and 59 deletions
@@ -38,7 +38,7 @@ public class DotationController {
dotation.setNumero(numero);
dotation.setFourni(fourni != null && fourni);
if (dotation.getEquipement().getObligatoire()) {
if (dotation.getLicence().getCategorie().isEquipementObligatoire(dotation.getEquipement().getId())) {
dotation.setChoisi(true);
} else {
dotation.setChoisi(choisi != null && choisi);
@@ -70,7 +70,7 @@ public class DotationController {
if (numero != null) dotation.setNumero(numero);
if (flocage != null) dotation.setFlocage(flocage);
if (dotation.getEquipement().getObligatoire()) {
if (dotation.getLicence().getCategorie().isEquipementObligatoire(dotation.getEquipement().getId())) {
dotation.setChoisi(true);
} else {
dotation.setChoisi(choisiParam != null);