feat: add licence import endpoint
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 9m50s

fix: pdf_gen
This commit is contained in:
2025-07-07 14:04:02 +02:00
parent bd59a17212
commit 824bedb99f
4 changed files with 45 additions and 7 deletions

View File

@@ -46,7 +46,8 @@ public class LicenceEndpoints {
@APIResponse(responseCode = "500", description = "Erreur interne du serveur")
})
public Uni<List<SimpleLicence>> getLicence(@PathParam("id") long id) {
return licenceService.getLicence(id, checkPerm).map(licenceModels -> licenceModels.stream().map(SimpleLicence::fromModel).toList());
return licenceService.getLicence(id, checkPerm)
.map(licenceModels -> licenceModels.stream().map(SimpleLicence::fromModel).toList());
}
@GET
@@ -60,7 +61,8 @@ public class LicenceEndpoints {
@APIResponse(responseCode = "500", description = "Erreur interne du serveur")
})
public Uni<List<SimpleLicence>> getCurrentSaisonLicenceAdmin() {
return licenceService.getCurrentSaisonLicence(null).map(licenceModels -> licenceModels.stream().map(SimpleLicence::fromModel).toList());
return licenceService.getCurrentSaisonLicence(null)
.map(licenceModels -> licenceModels.stream().map(SimpleLicence::fromModel).toList());
}
@GET
@@ -74,7 +76,8 @@ public class LicenceEndpoints {
@APIResponse(responseCode = "500", description = "Erreur interne du serveur")
})
public Uni<List<SimpleLicence>> getCurrentSaisonLicenceClub() {
return licenceService.getCurrentSaisonLicence(securityCtx).map(licenceModels -> licenceModels.stream().map(SimpleLicence::fromModel).toList());
return licenceService.getCurrentSaisonLicence(securityCtx)
.map(licenceModels -> licenceModels.stream().map(SimpleLicence::fromModel).toList());
}
@POST
@@ -142,4 +145,14 @@ public class LicenceEndpoints {
public Uni<?> deleteAskLicence(@PathParam("id") long id) {
return licenceService.deleteAskLicence(id, checkPerm);
}
// TODO remove after importe all data
@GET
@Path("import")
@RolesAllowed({"federation_admin"})
@Produces(MediaType.APPLICATION_JSON)
public Uni<?> setImport(@QueryParam("licence") int licence, @QueryParam("saison") int saison,
@QueryParam("valid") int valid) {
return licenceService.setImport(licence, saison, valid != 0);
}
}