Files
unionflow-server-impl-quarkus/src/main/java/dev/lions/unionflow/server/entity/ReferentielComptable.java
lionsdev d8006c8425
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 3m11s
feat(p0-2026-04-25): multi-référentiel comptable + UBO + audit trail + SoD + seuils AML
Sprint 1 P0 (consolidation 2026-04-25, ETAT_PROJET_METIER_2026-04-25.md) :

P0-NEW-9/10/11 — Multi-référentiel comptable
  - enum ReferentielComptable (SYSCOHADA / SYCEBNL / PCSFD_UMOA)
  - Organisation.referentielComptable + mapping defaultFor(typeOrganisation)
  - V43 : colonne + check + index + mapping initial des orgs existantes

P0-NEW-13 — Bénéficiaires effectifs (UBO) — Instruction BCEAO 003-03-2025
  - Entité BeneficiaireEffectif + repository
  - V44 : table beneficiaires_effectifs (FK kyc_dossier, UBO + PEP + sanctions)
  - Conservation 10 ans (directive 02/2015/CM/UEMOA)

P0-NEW-14 — Compliance Officer (Instruction BCEAO 001-03-2025)
  - Organisation.complianceOfficerId + V43 colonne + index

P0-NEW-15 — Seuils AML alignés (Instruction BCEAO 002-03-2025)
  - AmlSeuils : 10M FCFA intra-UEMOA / 5M FCFA entrée-sortie / 1M FCFA espèce
  - Liste pays UEMOA ISO 3166-1
  - Méthodes seuilApplicable() / depasseSeuil() / depasseSeuilEspece()

P0-NEW-17/18 — Rôles PRESIDENT + CONTROLEUR_INTERNE + suppléants
  - V45 seed : PRESIDENT, VICE_PRESIDENT, CONTROLEUR_INTERNE, ANIMATEUR_ZONE, SECRETAIRE_ADJOINT, TRESORIER_ADJOINT
  - Catégories GOUVERNANCE / CONTROLE / OPERATIONNEL

P0-NEW-19 — Audit trail enrichi (SYSCOHADA + AUDSCGIE)
  - V45 : table audit_trail_operations (acteur, action, contexte multi-org, payload JSONB, SoD)
  - Entité AuditTrailOperation + AuditTrailOperationRepository
  - AuditTrailService (log avec contexte automatique depuis OrganisationContextHolder)
  - OrganisationContextHolder enrichi (roleActif, currentUserId, currentUserEmail)

P0-NEW-20 — SoD (Separation of Duties) — SYSCOHADA + AUDSCGIE + BCEAO Circulaire 03-2017
  - SoDPermissionChecker.checkValidationDistinct() (4-eyes principle)
  - .checkRoleCombination() (combinaisons interdites : Trésorier+Président, etc.)
  - .checkComplianceOfficerEligibility() (Instruction BCEAO 001-03-2025)
  - SoDCheckResult record avec audit trail automatique

P0-NEW-24 — Champ numero_cmu sur Membre (Loi 2014-131 CI)
  - Membre.numeroCMU + V43 colonne + check format 11 caractères + index
  - Auto-déclaration (pas d'API publique CNAM disponible)

BUILD SUCCESS.
2026-04-25 01:15:25 +00:00

69 lines
2.7 KiB
Java

package dev.lions.unionflow.server.entity;
/**
* Référentiel comptable applicable à une {@link Organisation}.
*
* <p>OHADA dispose désormais de plusieurs référentiels selon la nature de l'entité :
*
* <ul>
* <li>{@link #SYSCOHADA} — Système Comptable OHADA révisé (1er jan 2018) pour entités
* commerciales/coopératives à but lucratif.
* <li>{@link #SYCEBNL} — Système Comptable OHADA des Entités à But Non Lucratif (11ᵉ Acte
* uniforme, entré en vigueur <strong>1er jan 2024</strong>) pour mutuelles sociales,
* associations, ONG, fondations, syndicats, projets de développement.
* <li>{@link #PCSFD_UMOA} — Plan Comptable des Systèmes Financiers Décentralisés UMOA pour SFD
* soumis Commission Bancaire UMOA (article 44, encours ≥ 2 milliards FCFA = catégorie III).
* </ul>
*
* <p>Le mapping par défaut depuis {@code Organisation.typeOrganisation} se trouve dans
* {@link #defaultFor(String)}. L'admin peut overrider manuellement (cas hybrides).
*
* <p>Voir : {@code unionflow/docs/COMPLIANCE_OHADA_SYCEBNL.md} et {@code
* unionflow/docs/COMPLIANCE_OHADA_SYSCOHADA.md}.
*
* @since 2026-04-25
*/
public enum ReferentielComptable {
/** Système Comptable OHADA révisé (entités commerciales / coopératives lucratives). */
SYSCOHADA,
/**
* Système Comptable OHADA des Entités à But Non Lucratif (mutuelles sociales, associations,
* ONG, fondations, Lions Clubs, syndicats). Acte uniforme entré en vigueur 1er janvier 2024.
*/
SYCEBNL,
/**
* Plan Comptable des Systèmes Financiers Décentralisés UMOA. Pour SFD article 44 (encours ≥ 2
* Md FCFA = catégorie III, commissaire aux comptes obligatoire agréé OHADA, sélection soumise
* approbation Commission Bancaire UMOA).
*/
PCSFD_UMOA;
/**
* Retourne le référentiel par défaut suggéré pour un {@code typeOrganisation}. L'admin peut
* overrider manuellement à la création/édition d'une organisation.
*
* @param typeOrganisation valeur de {@link Organisation#getTypeOrganisation()}
* @return référentiel par défaut, jamais null (fallback {@link #SYSCOHADA})
*/
public static ReferentielComptable defaultFor(String typeOrganisation) {
if (typeOrganisation == null) {
return SYSCOHADA;
}
return switch (typeOrganisation.toUpperCase()) {
case "MUTUELLE_SANTE",
"ASSOCIATION",
"LIONS_CLUB",
"ONG",
"FONDATION",
"SYNDICAT",
"ORDRE_PROFESSIONNEL",
"PROJET_DEVELOPPEMENT" ->
SYCEBNL;
case "SFD_TIER_1", "SFD_CATEGORIE_III" -> PCSFD_UMOA;
default -> SYSCOHADA;
};
}
}