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
@@ -31,18 +31,8 @@
<textarea th:field="*{description}" rows="3" class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none"></textarea>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Prix de contribution (€) - Pour équipement facultatif</label>
<input type="number" step="0.01" th:field="*{prixContribution}" required class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
<p class="text-xs text-gray-500 mt-1">Si l'équipement est facultatif, ce montant sera ajouté au tarif global de la licence s'il est commandé.</p>
</div>
<div class="flex items-center space-x-3">
<input type="checkbox" id="obligatoire" th:field="*{obligatoire}" class="w-5 h-5 text-blue-600 border-gray-300 rounded focus:ring-blue-500">
<label for="obligatoire" class="text-sm font-medium text-gray-700">
Cet équipement est obligatoire pour tous les licenciés (inclus dans la licence)
</label>
</div>
<div class="pt-4 flex justify-end space-x-3 border-t border-gray-100">
<a th:href="@{/equipements}" class="px-4 py-2 text-sm font-medium text-gray-700 border border-gray-300 rounded-lg hover:bg-gray-50">Annuler</a>