Sync: code local unifié
Synchronisation du code source local (fait foi). Signed-off-by: lions dev Team
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
package dev.lions.unionflow.server.entity.mutuelle.credit;
|
||||
|
||||
import dev.lions.unionflow.server.api.enums.mutuelle.credit.StatutDemandeCredit;
|
||||
import dev.lions.unionflow.server.api.enums.mutuelle.credit.TypeCredit;
|
||||
import dev.lions.unionflow.server.entity.BaseEntity;
|
||||
import dev.lions.unionflow.server.entity.Membre;
|
||||
import dev.lions.unionflow.server.entity.mutuelle.epargne.CompteEpargne;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "demandes_credit", indexes = {
|
||||
@Index(name = "idx_credit_membre", columnList = "membre_id"),
|
||||
@Index(name = "idx_credit_numero", columnList = "numero_dossier", unique = true)
|
||||
})
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DemandeCredit extends BaseEntity {
|
||||
|
||||
@Column(name = "numero_dossier", unique = true, nullable = false, length = 50)
|
||||
private String numeroDossier;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "membre_id", nullable = false)
|
||||
private Membre membre;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "type_credit", nullable = false, length = 50)
|
||||
private TypeCredit typeCredit;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "compte_lie_id")
|
||||
private CompteEpargne compteLie;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "montant_demande", nullable = false, precision = 19, scale = 4)
|
||||
private BigDecimal montantDemande;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "duree_mois_demande", nullable = false)
|
||||
private Integer dureeMoisDemande;
|
||||
|
||||
@Column(name = "justification_detaillee", columnDefinition = "TEXT")
|
||||
private String justificationDetaillee;
|
||||
|
||||
@Column(name = "montant_approuve", precision = 19, scale = 4)
|
||||
private BigDecimal montantApprouve;
|
||||
|
||||
@Column(name = "duree_mois_approuvee")
|
||||
private Integer dureeMoisApprouvee;
|
||||
|
||||
@Column(name = "taux_interet_annuel", precision = 5, scale = 2)
|
||||
private BigDecimal tauxInteretAnnuel;
|
||||
|
||||
@Column(name = "cout_total_credit", precision = 19, scale = 4)
|
||||
private BigDecimal coutTotalCredit;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "statut", nullable = false, length = 50)
|
||||
@Builder.Default
|
||||
private StatutDemandeCredit statut = StatutDemandeCredit.SOUMISE;
|
||||
|
||||
@Column(name = "notes_comite", columnDefinition = "TEXT")
|
||||
private String notesComite;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "date_soumission", nullable = false)
|
||||
@Builder.Default
|
||||
private LocalDate dateSoumission = LocalDate.now();
|
||||
|
||||
@Column(name = "date_validation")
|
||||
private LocalDate dateValidation;
|
||||
|
||||
@Column(name = "date_premier_echeance")
|
||||
private LocalDate datePremierEcheance;
|
||||
|
||||
@OneToMany(mappedBy = "demandeCredit", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@Builder.Default
|
||||
private List<GarantieDemande> garanties = new ArrayList<>();
|
||||
|
||||
@OneToMany(mappedBy = "demandeCredit", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@OrderBy("ordre ASC")
|
||||
@Builder.Default
|
||||
private List<EcheanceCredit> echeancier = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package dev.lions.unionflow.server.entity.mutuelle.credit;
|
||||
|
||||
import dev.lions.unionflow.server.api.enums.mutuelle.credit.StatutEcheanceCredit;
|
||||
import dev.lions.unionflow.server.entity.BaseEntity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Entity
|
||||
@Table(name = "echeances_credit", indexes = {
|
||||
@Index(name = "idx_echeance_demande", columnList = "demande_credit_id")
|
||||
})
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(exclude = "demandeCredit")
|
||||
public class EcheanceCredit extends BaseEntity {
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "demande_credit_id", nullable = false)
|
||||
private DemandeCredit demandeCredit;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "ordre", nullable = false)
|
||||
private Integer ordre;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "date_echeance_prevue", nullable = false)
|
||||
private LocalDate dateEcheancePrevue;
|
||||
|
||||
@Column(name = "date_paiement_effectif")
|
||||
private LocalDate datePaiementEffectif;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "capital_amorti", nullable = false, precision = 19, scale = 4)
|
||||
private BigDecimal capitalAmorti;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "interets_periode", nullable = false, precision = 19, scale = 4)
|
||||
private BigDecimal interetsDeLaPeriode;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "montant_total_exigible", nullable = false, precision = 19, scale = 4)
|
||||
private BigDecimal montantTotalExigible;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "capital_restant_du", nullable = false, precision = 19, scale = 4)
|
||||
private BigDecimal capitalRestantDu;
|
||||
|
||||
@Column(name = "penalites_retard", precision = 19, scale = 4)
|
||||
@Builder.Default
|
||||
private BigDecimal penalitesRetard = BigDecimal.ZERO;
|
||||
|
||||
@Column(name = "montant_regle", precision = 19, scale = 4)
|
||||
@Builder.Default
|
||||
private BigDecimal montantRegle = BigDecimal.ZERO;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "statut", nullable = false, length = 50)
|
||||
@Builder.Default
|
||||
private StatutEcheanceCredit statut = StatutEcheanceCredit.A_VENIR;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package dev.lions.unionflow.server.entity.mutuelle.credit;
|
||||
|
||||
import dev.lions.unionflow.server.api.enums.mutuelle.credit.TypeGarantie;
|
||||
import dev.lions.unionflow.server.entity.BaseEntity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Entity
|
||||
@Table(name = "garanties_demande")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(exclude = "demandeCredit")
|
||||
public class GarantieDemande extends BaseEntity {
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "demande_credit_id", nullable = false)
|
||||
private DemandeCredit demandeCredit;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "type_garantie", nullable = false, length = 50)
|
||||
private TypeGarantie typeGarantie;
|
||||
|
||||
@Column(name = "valeur_estimee", precision = 19, scale = 4)
|
||||
private BigDecimal valeurEstimee;
|
||||
|
||||
@Column(name = "reference_description", length = 500)
|
||||
private String referenceOuDescription;
|
||||
|
||||
@Column(name = "document_preuve_id", length = 36)
|
||||
private String documentPreuveId;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package dev.lions.unionflow.server.entity.mutuelle.epargne;
|
||||
|
||||
import dev.lions.unionflow.server.entity.BaseEntity;
|
||||
import dev.lions.unionflow.server.entity.Membre;
|
||||
import dev.lions.unionflow.server.entity.Organisation;
|
||||
import dev.lions.unionflow.server.api.enums.mutuelle.epargne.StatutCompteEpargne;
|
||||
import dev.lions.unionflow.server.api.enums.mutuelle.epargne.TypeCompteEpargne;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Entity
|
||||
@Table(name = "comptes_epargne", indexes = {
|
||||
@Index(name = "idx_compte_epargne_numero", columnList = "numero_compte", unique = true),
|
||||
@Index(name = "idx_compte_epargne_membre", columnList = "membre_id"),
|
||||
@Index(name = "idx_compte_epargne_orga", columnList = "organisation_id")
|
||||
})
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CompteEpargne extends BaseEntity {
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "membre_id", nullable = false)
|
||||
private Membre membre;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "organisation_id", nullable = false)
|
||||
private Organisation organisation;
|
||||
|
||||
@NotBlank
|
||||
@Column(name = "numero_compte", unique = true, nullable = false, length = 50)
|
||||
private String numeroCompte;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "type_compte", nullable = false, length = 50)
|
||||
private TypeCompteEpargne typeCompte;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "solde_actuel", nullable = false, precision = 19, scale = 4)
|
||||
@Builder.Default
|
||||
private BigDecimal soldeActuel = BigDecimal.ZERO;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "solde_bloque", nullable = false, precision = 19, scale = 4)
|
||||
@Builder.Default
|
||||
private BigDecimal soldeBloque = BigDecimal.ZERO;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "statut", nullable = false, length = 30)
|
||||
@Builder.Default
|
||||
private StatutCompteEpargne statut = StatutCompteEpargne.ACTIF;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "date_ouverture", nullable = false)
|
||||
@Builder.Default
|
||||
private LocalDate dateOuverture = LocalDate.now();
|
||||
|
||||
@Column(name = "date_derniere_transaction")
|
||||
private LocalDate dateDerniereTransaction;
|
||||
|
||||
@Column(name = "description", length = 500)
|
||||
private String description;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package dev.lions.unionflow.server.entity.mutuelle.epargne;
|
||||
|
||||
import dev.lions.unionflow.server.api.enums.mutuelle.epargne.TypeTransactionEpargne;
|
||||
import dev.lions.unionflow.server.api.enums.wave.StatutTransactionWave;
|
||||
import dev.lions.unionflow.server.entity.BaseEntity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "transactions_epargne", indexes = {
|
||||
@Index(name = "idx_tx_epargne_compte", columnList = "compte_id"),
|
||||
@Index(name = "idx_tx_epargne_reference", columnList = "reference_externe")
|
||||
})
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TransactionEpargne extends BaseEntity {
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "compte_id", nullable = false)
|
||||
private CompteEpargne compte;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "type_transaction", nullable = false, length = 50)
|
||||
private TypeTransactionEpargne type;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "montant", nullable = false, precision = 19, scale = 4)
|
||||
private BigDecimal montant;
|
||||
|
||||
@Column(name = "solde_avant", precision = 19, scale = 4)
|
||||
private BigDecimal soldeAvant;
|
||||
|
||||
@Column(name = "solde_apres", precision = 19, scale = 4)
|
||||
private BigDecimal soldeApres;
|
||||
|
||||
@Column(name = "motif", length = 500)
|
||||
private String motif;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "date_transaction", nullable = false)
|
||||
@Builder.Default
|
||||
private LocalDateTime dateTransaction = LocalDateTime.now();
|
||||
|
||||
@Column(name = "operateur_id", length = 36)
|
||||
private String operateurId;
|
||||
|
||||
@Column(name = "reference_externe", length = 100)
|
||||
private String referenceExterne;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "statut_execution", length = 50)
|
||||
private StatutTransactionWave statutExecution;
|
||||
|
||||
/** Origine des fonds (LCB-FT) — obligatoire au-dessus du seuil configuré */
|
||||
@Column(name = "origine_fonds", length = 200)
|
||||
private String origineFonds;
|
||||
|
||||
/** Pièce justificative (document) pour opérations au-dessus du seuil LCB-FT */
|
||||
@Column(name = "piece_justificative_id")
|
||||
private java.util.UUID pieceJustificativeId;
|
||||
}
|
||||
Reference in New Issue
Block a user