wip: swagger
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user