Refactor: Move equipment price and mandatory status to Categorie relationship
- 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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user