feat(sprint-3 P1+P2 2026-04-25): compliance dashboard + PEP screening + formations LBC/FT + goAML XML + tests
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 3m15s
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 3m15s
P1-NEW-11 — Tableau de bord conformité - ComplianceDashboardService : score 0-100 avec 9 indicateurs pondérés (compliance officer, AG annuelle, rapport AIRMS, dirigeants CMU, taux KYC, taux formation LBC/FT, CAC, FOMUS-CI, couverture UBO) - ComplianceDashboardResource : GET /api/compliance/dashboard P1-NEW-11 — PEP screening externe - PepScreeningProvider (interface) + records PepScreeningResult / PepMatch - InMemoryPepScreeningProvider : fallback dev avec similarité Levenshtein normalisée (seuil 0.80) - PepScreeningService : cache LRU 5000 entrées, TTL 24h - Pluggable via @Alternative @Priority pour Youverify / ComplyAdvantage en prod P1-NEW-12 — Module formation LBC/FT obligatoire annuelle - FormationLbcFt + ParticipationFormationLbcFt (entités) - FormationLbcFtService : creer, inscrire, marquerPresent, certifier (score >= 70), estCertifieAnneeCourante - Repositories : trouverCertificationAnnee, findATenir - V47 migration : formations_lbcft, participations_formation_lbcft, pep_screening_cache P2-NEW-4 — goAML XML (anticipation adoption CI) - GoAmlXmlService : génération XML standard ONUDC (report, transaction, t_person, t_account) - Reporting person anonymisé ([REDACTED], rôle Compliance Officer) - POST /api/aml/dos/goaml @RolesAllowed(COMPLIANCE_OFFICER, SUPER_ADMIN) Tests Sprint 3 (15 tests, 100%) : - FormationLbcFtTest : 2 tests (builder, override type) - GoAmlXmlServiceTest : 4 tests (XML non vide, champs clés, anonymisation, country code CIV) - InMemoryPepScreeningProviderTest : 9 tests (match, nationalité, vide, similarité Levenshtein)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package dev.lions.unionflow.server.resource;
|
||||
|
||||
import dev.lions.unionflow.server.security.OrganisationContextHolder;
|
||||
import dev.lions.unionflow.server.service.compliance.ComplianceDashboardService;
|
||||
import io.quarkus.security.Authenticated;
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import java.util.UUID;
|
||||
|
||||
/** Endpoint du tableau de bord de conformité (P1-NEW-7). */
|
||||
@Path("/api/compliance/dashboard")
|
||||
@Authenticated
|
||||
public class ComplianceDashboardResource {
|
||||
|
||||
@Inject ComplianceDashboardService service;
|
||||
@Inject OrganisationContextHolder context;
|
||||
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@RolesAllowed({"PRESIDENT", "TRESORIER", "COMPLIANCE_OFFICER", "CONTROLEUR_INTERNE",
|
||||
"ADMIN_ORGANISATION", "SUPER_ADMIN"})
|
||||
public ComplianceDashboardService.ComplianceSnapshot snapshotCurrent() {
|
||||
UUID orgId = context.getOrganisationId();
|
||||
if (orgId == null) {
|
||||
throw new IllegalStateException("Aucune organisation active dans le contexte");
|
||||
}
|
||||
return service.snapshot(orgId);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{organisationId}")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@RolesAllowed({"SUPER_ADMIN"})
|
||||
public ComplianceDashboardService.ComplianceSnapshot snapshotOf(@PathParam("organisationId") UUID orgId) {
|
||||
return service.snapshot(orgId);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package dev.lions.unionflow.server.resource;
|
||||
|
||||
import dev.lions.unionflow.server.service.centif.DosCentifService;
|
||||
import dev.lions.unionflow.server.service.centif.DosCentifService.DosCentifData;
|
||||
import dev.lions.unionflow.server.service.centif.GoAmlXmlService;
|
||||
import io.quarkus.security.Authenticated;
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
@@ -29,6 +30,7 @@ import java.io.IOException;
|
||||
public class DosCentifResource {
|
||||
|
||||
@Inject DosCentifService dosService;
|
||||
@Inject GoAmlXmlService goAmlService;
|
||||
|
||||
/**
|
||||
* Génère la DOS au format Word (.docx).
|
||||
@@ -67,4 +69,21 @@ public class DosCentifResource {
|
||||
.header("Content-Disposition", "attachment; filename=\"" + filename + "\"")
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Génère la DOS au format goAML XML (standard ONUDC) — anticipation adoption CI.
|
||||
* @since P2-NEW-4
|
||||
*/
|
||||
@POST
|
||||
@Path("/goaml")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_XML)
|
||||
@RolesAllowed({"COMPLIANCE_OFFICER", "SUPER_ADMIN"})
|
||||
public Response genererGoAml(DosCentifData data) throws IOException {
|
||||
byte[] bytes = goAmlService.genererXml(data);
|
||||
String filename = "DOS_goAML_" + data.numeroDosInterne() + ".xml";
|
||||
return Response.ok(bytes)
|
||||
.header("Content-Disposition", "attachment; filename=\"" + filename + "\"")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user