feat: map adherent size and shoe size to dotations
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 4m35s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 6m1s

This commit is contained in:
2026-07-17 23:55:44 +02:00
parent e81be98cbe
commit baa4d3c0cd
@@ -123,6 +123,26 @@ public class CategorieService {
continue; continue;
} }
String matchedTaille = "";
if (licence.getAdherent() != null) {
String taillesDispo = ce.getEquipement().getTaillesDisponibles();
if (taillesDispo != null && !taillesDispo.trim().isEmpty()) {
String[] dispos = taillesDispo.split(",");
String tv = licence.getAdherent().getTailleVetement();
String pt = licence.getAdherent().getPointure();
for (String t : dispos) {
String trimmed = t.trim();
if (tv != null && !tv.trim().isEmpty() && trimmed.equalsIgnoreCase(tv.trim())) {
matchedTaille = tv.trim();
break;
} else if (pt != null && !pt.trim().isEmpty() && trimmed.equalsIgnoreCase(pt.trim())) {
matchedTaille = pt.trim();
break;
}
}
}
}
boolean found = false; boolean found = false;
for (Dotation d : currentDotations) { for (Dotation d : currentDotations) {
if (ce.getEquipement().getId().equals(d.getEquipement().getId())) { if (ce.getEquipement().getId().equals(d.getEquipement().getId())) {
@@ -130,6 +150,9 @@ public class CategorieService {
if (Boolean.TRUE.equals(ce.getObligatoire()) && !Boolean.TRUE.equals(d.getChoisi())) { if (Boolean.TRUE.equals(ce.getObligatoire()) && !Boolean.TRUE.equals(d.getChoisi())) {
d.setChoisi(true); d.setChoisi(true);
} }
if ((d.getTaille() == null || d.getTaille().trim().isEmpty()) && !matchedTaille.isEmpty()) {
d.setTaille(matchedTaille);
}
break; break;
} }
} }
@@ -146,7 +169,7 @@ public class CategorieService {
} }
newDotation.setChoisi(ce.getObligatoire() || (isMaillot && isNouvelle)); // Checked if obligatoire or if it's a new registration newDotation.setChoisi(ce.getObligatoire() || (isMaillot && isNouvelle)); // Checked if obligatoire or if it's a new registration
newDotation.setFourni(false); newDotation.setFourni(false);
newDotation.setTaille(""); newDotation.setTaille(matchedTaille);
newDotation.setNumero(""); newDotation.setNumero("");
if (licence.getAdherent() != null) { if (licence.getAdherent() != null) {
String defaultFlocage = ""; String defaultFlocage = "";