feat: club

This commit is contained in:
2024-07-17 10:44:04 +02:00
parent edcda185db
commit d268461bfd
8 changed files with 326 additions and 19 deletions

View File

@@ -308,7 +308,13 @@ public class AffiliationService {
}
}))
.chain(club ->
Panache.withTransaction(() -> repository.persist(new AffiliationModel(null, club, saison))))
Panache.withTransaction(() -> repository.persist(new AffiliationModel(null, club, saison))
.chain(c -> (club.getNo_affiliation() != null) ? Uni.createFrom().item(c) :
sequenceRepository.getNextValueInTransaction(SequenceType.Affiliation)
.invoke(club::setNo_affiliation)
.chain(() -> clubRepository.persist(club))
.map(o -> c)
)))
.map(SimpleAffiliation::fromModel);
}