feat: add affiliation pdf generator
This commit is contained in:
@@ -207,6 +207,21 @@ public class ClubEndpoints {
|
||||
return clubService.delete(id);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{id}/affiliation")
|
||||
@RolesAllowed({"federation_admin"})
|
||||
@Operation(summary = "Renvoie l'attestation d'affiliation du club en fonction de son identifiant", description =
|
||||
"Renvoie l'attestation d'affiliation du club en fonction de son identifiant")
|
||||
@APIResponses(value = {
|
||||
@APIResponse(responseCode = "200", description = "L'attestation d'affiliation"),
|
||||
@APIResponse(responseCode = "403", description = "Accès refusé"),
|
||||
@APIResponse(responseCode = "404", description = "Le club n'existe pas ou n'a pas d'affiliation active"),
|
||||
@APIResponse(responseCode = "500", description = "Erreur interne du serveur")
|
||||
})
|
||||
public Uni<Response> getAffiliation(@Parameter(description = "Identifiant de club") @PathParam("id") long id) {
|
||||
return clubService.getAffiliationPdf(id);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/me")
|
||||
@RolesAllowed({"club_president", "club_secretaire", "club_respo_intra"})
|
||||
@@ -241,13 +256,28 @@ public class ClubEndpoints {
|
||||
return clubService.updateOfUser(securityCtx, form);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/me/affiliation")
|
||||
@RolesAllowed({"club_president", "club_secretaire", "club_respo_intra"})
|
||||
@Operation(summary = "Renvoie l'attestation d'affiliation du club de l'utilisateur connecté", description =
|
||||
"Renvoie l'attestation d'affiliation du club de l'utilisateur connecté")
|
||||
@APIResponses(value = {
|
||||
@APIResponse(responseCode = "200", description = "L'attestation d'affiliation"),
|
||||
@APIResponse(responseCode = "403", description = "Accès refusé"),
|
||||
@APIResponse(responseCode = "404", description = "Le club n'a pas d'affiliation active"),
|
||||
@APIResponse(responseCode = "500", description = "Erreur interne du serveur")
|
||||
})
|
||||
public Uni<Response> getMeAffiliation() {
|
||||
return clubService.getAffiliationPdf(securityCtx.getSubject());
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/renew/{id}")
|
||||
@RolesAllowed({"club_president", "club_secretaire", "club_respo_intra"})
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Operation(hidden = true)
|
||||
public Uni<RenewAffData> getRenew(@PathParam("id") long id, @QueryParam("m1") long m1_id,
|
||||
@QueryParam("m2") long m2_id, @QueryParam("m3") long m3_id) {
|
||||
@QueryParam("m2") long m2_id, @QueryParam("m3") long m3_id) {
|
||||
return Uni.createFrom().item(id).invoke(checkPerm2)
|
||||
.chain(__ -> clubService.getRenewData(id, List.of(m1_id, m2_id, m3_id)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user