diff --git a/as-talange-core/src/main/java/com/astalange/core/entity/Licence.java b/as-talange-core/src/main/java/com/astalange/core/entity/Licence.java index 5d21da8..7c73599 100644 --- a/as-talange-core/src/main/java/com/astalange/core/entity/Licence.java +++ b/as-talange-core/src/main/java/com/astalange/core/entity/Licence.java @@ -41,6 +41,9 @@ public class Licence { @Column(name = "type_licence", length = 50) private String typeLicence; + @Column(columnDefinition = "TEXT") + private String commentaire; + @OneToMany(mappedBy = "licence", cascade = CascadeType.ALL, orphanRemoval = true) private List paiements = new ArrayList<>(); @@ -128,6 +131,9 @@ public class Licence { public String getTypeLicence() { return typeLicence; } public void setTypeLicence(String typeLicence) { this.typeLicence = typeLicence; } + public String getCommentaire() { return commentaire; } + public void setCommentaire(String commentaire) { this.commentaire = commentaire; } + public List getPaiements() { return paiements; } public void setPaiements(List paiements) { this.paiements = paiements; } diff --git a/as-talange-core/src/main/resources/db/migration/V36__add_commentaire_to_licence.sql b/as-talange-core/src/main/resources/db/migration/V36__add_commentaire_to_licence.sql new file mode 100644 index 0000000..8da9f7e --- /dev/null +++ b/as-talange-core/src/main/resources/db/migration/V36__add_commentaire_to_licence.sql @@ -0,0 +1 @@ +ALTER TABLE licence ADD COLUMN commentaire TEXT; diff --git a/as-talange-web/src/main/java/com/astalange/web/controller/LicenceController.java b/as-talange-web/src/main/java/com/astalange/web/controller/LicenceController.java index 957026c..66e239b 100644 --- a/as-talange-web/src/main/java/com/astalange/web/controller/LicenceController.java +++ b/as-talange-web/src/main/java/com/astalange/web/controller/LicenceController.java @@ -49,6 +49,7 @@ public class LicenceController { @RequestParam(required = false) String numeroLicence, @RequestParam(required = false) String typeDemande, @RequestParam(required = false) String typeLicence, + @RequestParam(required = false) String commentaire, @RequestParam(required = false) Long equipeId) { Adherent adherent = adherentRepository.findById(id) @@ -73,6 +74,7 @@ public class LicenceController { licence.setNumeroLicence(numeroLicence); licence.setTypeDemande(typeDemande); licence.setTypeLicence(typeLicence); + licence.setCommentaire(commentaire); if (equipeId != null) { Equipe equipe = equipeRepository.findById(equipeId) @@ -97,6 +99,7 @@ public class LicenceController { @RequestParam(required = false) String numeroLicence, @RequestParam(required = false) String typeDemande, @RequestParam(required = false) String typeLicence, + @RequestParam(required = false) String commentaire, @RequestParam(required = false) Long equipeId) { Licence licence = licenceRepository.findById(licenceId) @@ -110,6 +113,7 @@ public class LicenceController { licence.setNumeroLicence(numeroLicence); licence.setTypeDemande(typeDemande); licence.setTypeLicence(typeLicence); + licence.setCommentaire(commentaire); if (equipeId != null) { Equipe equipe = equipeRepository.findById(equipeId) diff --git a/as-talange-web/src/main/resources/templates/adherents/form.html b/as-talange-web/src/main/resources/templates/adherents/form.html index 8d2e82c..142ce50 100644 --- a/as-talange-web/src/main/resources/templates/adherents/form.html +++ b/as-talange-web/src/main/resources/templates/adherents/form.html @@ -259,7 +259,8 @@ th:data-type-demande="${lic.typeDemande}" th:data-type-licence="${lic.typeLicence}" th:data-equipe-id="${lic.equipe != null ? lic.equipe.id : ''}" - onclick="openLicenceModal(this.getAttribute('data-licence-id'), this.getAttribute('data-categorie-id'), this.getAttribute('data-numero-licence'), this.getAttribute('data-etat'), this.getAttribute('data-type-demande'), this.getAttribute('data-type-licence'), this.getAttribute('data-equipe-id'))" + th:data-commentaire="${lic.commentaire}" + onclick="openLicenceModal(this.getAttribute('data-licence-id'), this.getAttribute('data-categorie-id'), this.getAttribute('data-numero-licence'), this.getAttribute('data-etat'), this.getAttribute('data-type-demande'), this.getAttribute('data-type-licence'), this.getAttribute('data-equipe-id'), this.getAttribute('data-commentaire'))" class="text-blue-600 hover:text-blue-800 font-medium bg-blue-50 px-3 py-1 rounded-lg">Modifier @@ -603,7 +608,7 @@