wip: swagger

This commit is contained in:
2024-07-19 17:21:11 +02:00
parent 3ccf880057
commit 957fcfff8b
12 changed files with 419 additions and 129 deletions

View File

@@ -233,7 +233,7 @@ public class AffiliationService {
.call(m -> (m.getUserId() == null) ? keycloakService.initCompte(m.getId()) :
keycloakService.setClubGroupMembre(m, club))
.call(m -> Panache.withTransaction(() -> licenceRepository.persist(
new LicenceModel(null, m, saison, false, true))));
new LicenceModel(null, m, saison, null, true))));
}
public Uni<?> accept(AffiliationRequestSaveForm form) {
@@ -336,6 +336,7 @@ public class AffiliationService {
public Uni<SimpleAffiliation> setAffiliation(long id, int saison) {
return clubRepository.findById(id)
.onItem().ifNull().failWith(new DNotFoundException("Club non trouvé"))
.call(model -> Mutiny.fetch(model.getAffiliations()))
.invoke(Unchecked.consumer(club -> {
if (club.getAffiliations().stream().anyMatch(affiliation -> affiliation.getSaison() == saison)) {
throw new DBadRequestException("Affiliation déjà existante");