feat: add club_id to LicenceModel for stats

This commit is contained in:
2025-07-05 21:19:57 +02:00
parent 3fd5ae3741
commit 9705182547
4 changed files with 11 additions and 3 deletions

View File

@@ -53,6 +53,7 @@ public class LicenceService {
return combRepository.findById(id).chain(membreModel -> {
LicenceModel model = new LicenceModel();
model.setMembre(membreModel);
model.setClub_id((membreModel.getClub() == null) ? null : membreModel.getClub().getId());
model.setSaison(form.getSaison());
model.setCertificate(form.getCertificate());
model.setValidate(form.isValidate());
@@ -92,9 +93,10 @@ public class LicenceService {
.invoke(Unchecked.consumer(count -> {
if (count > 0)
throw new DBadRequestException("Licence déjà demandée");
})).chain(__ -> combRepository.findById(id).chain(combRepository -> {
})).chain(__ -> combRepository.findById(id).chain(membreModel2 -> {
LicenceModel model = new LicenceModel();
model.setMembre(combRepository);
model.setClub_id((membreModel2.getClub() == null) ? null : membreModel2.getClub().getId());
model.setMembre(membreModel2);
model.setSaison(Utils.getSaison());
model.setCertificate(form.getCertificate());
model.setValidate(false);