## PI-SPI BCEAO (P0.3 — deadline 30/06/2026)
- package payment/pispi/ complet : PispiAuth (OAuth2), PispiClient (HTTP brut),
PispiIso20022Mapper (pacs.008/002), PispiSignatureVerifier (HMAC-SHA256),
PispiWebhookResource (/api/pispi/webhook), DTOs ISO 20022
- PaymentOrchestrator + PaymentProviderRegistry pour l'orchestration multi-provider
- Mode mock automatique si credentials absents (dev)
## KYC AML
- entity/KycDossier, KycResource, KycAmlService + tests
- Migration V38 (create_kyc_dossier_table)
## RLS (PostgreSQL Row-Level Security) — isolation multi-tenant
- RlsConnectionInitializer, RlsContextInterceptor, @RlsEnabled annotation
- Migration V39 (PostgreSQL RLS Tenant Isolation) + V42 (app DB roles)
- Tests unitaires RlsConnectionInitializerTest, RlsContextInterceptorTest
- Tests d'intégration RlsCrossTenantIsolationTest (@QuarkusTest + IntegrationTestProfile)
## Mutuelle — Parts sociales
- entity/mutuelle/parts/ComptePartsSociales, TransactionPartsSociales
- Service, resource, mapper, repository + tests
- InteretsEpargneService + ReleveComptePdfService
## Comptabilité PDF
- ComptabilitePdfService (OpenPDF), ComptabilitePdfResource
- Tests ComptabilitePdfServiceTest, ComptabilitePdfResourceTest
## Migrations Flyway (SYSCOHADA + Keycloak Orgs)
- V36 SYSCOHADA Plan Comptable Complet : seeds comptes standards UEMOA,
trigger init_plan_comptable_organisation, alignement schéma V1 → entités
- V37 keycloak_org_id sur organisations (P0.2 migration KC 26)
- V40 provider_defaut sur FormuleAbonnement
- V41 fcm_token sur utilisateurs (FCM notifications push)
## Fixes startup (SmallRye Config 3.20 + schéma)
- 8× @ConfigProperty(defaultValue = "") → Optional<String>
(firebase, pispi.*, mtnmomo, orange) — empty default rejetés par SmallRye 3.20
- application.properties : mappings secrets env var sous %prod. uniquement
- V36 : drop colonne obsolète 'numero' de V1 quand Hibernate a créé 'numero_compte'
- V36 : remplacement UNIQUE global sur journaux_comptables.code par composite
(organisation_id, code) pour autoriser plusieurs orgs avec code 'ACH'/'VTE'/etc
- V39 : escape placeholder ${VAR} → <VAR> dans lignes commentées
(Flyway parser évalue les placeholders même dans les commentaires)
- V41 : table 'membres' → 'utilisateurs' (nom correct selon entité Membre)
- JournalComptable entity : @UniqueConstraint composite au lieu de unique=true
- MembreResource : example @Schema JSON valide (['...'] → [])
- IntegrationTestProfile : auto-détection Docker via `docker info`, fallback
vers PostgreSQL local sans DevServices
## Dev config
- application-dev.properties : quarkus.devservices.enabled=false +
quarkus.kafka.devservices.enabled=false (pas besoin de Docker pour dev)
- quarkus.flyway.placeholder-replacement=false
- Secrets dev (wave.*, firebase, pispi) en mode mock automatique
## Phase 8 tests (complète)
- 170 fichiers modifiés/ajoutés, 23425+ insertions
- Tests RBAC (@QuarkusTest) pour MembreResource lifecycle
- Tests OrganisationContextFilter multi-org
- Tests SouscriptionQuotaOptionC, KycAmlService, EmailTemplate, etc.
Résultat : Backend démarre en 64s sur port 8085 avec 36 features installées.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
109 lines
3.0 KiB
Java
109 lines
3.0 KiB
Java
package dev.lions.unionflow.server.entity;
|
|
|
|
import dev.lions.unionflow.server.api.enums.comptabilite.TypeJournalComptable;
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
import jakarta.persistence.*;
|
|
import jakarta.validation.constraints.NotBlank;
|
|
import jakarta.validation.constraints.NotNull;
|
|
import java.time.LocalDate;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Builder;
|
|
import lombok.Data;
|
|
import lombok.EqualsAndHashCode;
|
|
import lombok.NoArgsConstructor;
|
|
|
|
/**
|
|
* Entité JournalComptable pour la gestion des journaux
|
|
*
|
|
* @author UnionFlow Team
|
|
* @version 3.0
|
|
* @since 2025-01-29
|
|
*/
|
|
@Entity
|
|
@Table(
|
|
name = "journaux_comptables",
|
|
uniqueConstraints = {
|
|
@UniqueConstraint(name = "uk_journaux_org_code", columnNames = {"organisation_id", "code"})
|
|
},
|
|
indexes = {
|
|
@Index(name = "idx_journal_code", columnList = "code"),
|
|
@Index(name = "idx_journal_type", columnList = "type_journal"),
|
|
@Index(name = "idx_journal_periode", columnList = "date_debut, date_fin")
|
|
})
|
|
@Data
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@Builder
|
|
@EqualsAndHashCode(callSuper = true)
|
|
public class JournalComptable extends BaseEntity {
|
|
|
|
/** Code du journal (unique par organisation). */
|
|
@NotBlank
|
|
@Column(name = "code", nullable = false, length = 10)
|
|
private String code;
|
|
|
|
/** Libellé du journal */
|
|
@NotBlank
|
|
@Column(name = "libelle", nullable = false, length = 100)
|
|
private String libelle;
|
|
|
|
/** Type de journal */
|
|
@NotNull
|
|
@Enumerated(EnumType.STRING)
|
|
@Column(name = "type_journal", nullable = false, length = 30)
|
|
private TypeJournalComptable typeJournal;
|
|
|
|
/** Date de début de la période */
|
|
@Column(name = "date_debut")
|
|
private LocalDate dateDebut;
|
|
|
|
/** Date de fin de la période */
|
|
@Column(name = "date_fin")
|
|
private LocalDate dateFin;
|
|
|
|
/** Statut du journal (OUVERT, FERME, ARCHIVE) */
|
|
@Builder.Default
|
|
@Column(name = "statut", length = 20)
|
|
private String statut = "OUVERT";
|
|
|
|
/** Description */
|
|
@Column(name = "description", length = 500)
|
|
private String description;
|
|
|
|
/** Organisation propriétaire */
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
|
@JoinColumn(name = "organisation_id")
|
|
private Organisation organisation;
|
|
|
|
/** Écritures comptables associées */
|
|
@JsonIgnore
|
|
@OneToMany(mappedBy = "journal", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
|
@Builder.Default
|
|
private List<EcritureComptable> ecritures = new ArrayList<>();
|
|
|
|
/** Méthode métier pour vérifier si le journal est ouvert */
|
|
public boolean isOuvert() {
|
|
return "OUVERT".equals(statut);
|
|
}
|
|
|
|
/** Méthode métier pour vérifier si une date est dans la période */
|
|
public boolean estDansPeriode(LocalDate date) {
|
|
if (dateDebut == null || dateFin == null) {
|
|
return true; // Période illimitée
|
|
}
|
|
return !date.isBefore(dateDebut) && !date.isAfter(dateFin);
|
|
}
|
|
|
|
/** Callback JPA avant la persistance */
|
|
@PrePersist
|
|
protected void onCreate() {
|
|
super.onCreate();
|
|
if (statut == null || statut.isEmpty()) {
|
|
statut = "OUVERT";
|
|
}
|
|
}
|
|
}
|
|
|