feat: add licence and user remove condition check
This commit is contained in:
@@ -368,6 +368,12 @@ public class MembreService {
|
||||
if (!securityCtx.isInClubGroup(membreModel.getClub().getId()))
|
||||
throw new DForbiddenException();
|
||||
}))
|
||||
.invoke(Unchecked.consumer(membreModel -> {
|
||||
if (membreModel.getLicence() != null) {
|
||||
throw new DBadRequestException(
|
||||
"Impossible de supprimer un membre qui a déjà un numéro de licence");
|
||||
}
|
||||
}))
|
||||
.call(membreModel -> licenceRepository.find("membre = ?1", membreModel).count()
|
||||
.invoke(Unchecked.consumer(l -> {
|
||||
if (l > 0)
|
||||
|
||||
Reference in New Issue
Block a user