feat: PHASE 4.2 - DTOs Comptables
DTOs créés: - CompteComptableDTO: Validation complète avec contraintes - JournalComptableDTO: Gestion périodes et statuts - EcritureComptableDTO: Avec liste de lignes - LigneEcritureDTO: Validation débit/crédit Respect strict DRY/WOU: - Patterns de DTO cohérents avec autres modules - Validation complète avec messages d'erreur - Relations via UUID pour découplage
This commit is contained in:
@@ -0,0 +1,57 @@
|
|||||||
|
package dev.lions.unionflow.server.api.dto.comptabilite;
|
||||||
|
|
||||||
|
import dev.lions.unionflow.server.api.dto.base.BaseDTO;
|
||||||
|
import dev.lions.unionflow.server.api.enums.comptabilite.TypeCompteComptable;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.UUID;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DTO pour la gestion des comptes comptables
|
||||||
|
*
|
||||||
|
* @author UnionFlow Team
|
||||||
|
* @version 3.0
|
||||||
|
* @since 2025-01-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CompteComptableDTO extends BaseDTO {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** Numéro de compte */
|
||||||
|
@NotBlank(message = "Le numéro de compte est obligatoire")
|
||||||
|
private String numeroCompte;
|
||||||
|
|
||||||
|
/** Libellé du compte */
|
||||||
|
@NotBlank(message = "Le libellé est obligatoire")
|
||||||
|
private String libelle;
|
||||||
|
|
||||||
|
/** Type de compte */
|
||||||
|
@NotNull(message = "Le type de compte est obligatoire")
|
||||||
|
private TypeCompteComptable typeCompte;
|
||||||
|
|
||||||
|
/** Classe comptable (1-7) */
|
||||||
|
@NotNull(message = "La classe comptable est obligatoire")
|
||||||
|
@Min(value = 1, message = "La classe comptable doit être entre 1 et 7")
|
||||||
|
@Max(value = 7, message = "La classe comptable doit être entre 1 et 7")
|
||||||
|
private Integer classeComptable;
|
||||||
|
|
||||||
|
/** Solde initial */
|
||||||
|
private BigDecimal soldeInitial;
|
||||||
|
|
||||||
|
/** Solde actuel */
|
||||||
|
private BigDecimal soldeActuel;
|
||||||
|
|
||||||
|
/** Compte collectif */
|
||||||
|
private Boolean compteCollectif;
|
||||||
|
|
||||||
|
/** Compte analytique */
|
||||||
|
private Boolean compteAnalytique;
|
||||||
|
|
||||||
|
/** Description */
|
||||||
|
private String description;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package dev.lions.unionflow.server.api.dto.comptabilite;
|
||||||
|
|
||||||
|
import dev.lions.unionflow.server.api.dto.base.BaseDTO;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DTO pour la gestion des écritures comptables
|
||||||
|
*
|
||||||
|
* @author UnionFlow Team
|
||||||
|
* @version 3.0
|
||||||
|
* @since 2025-01-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class EcritureComptableDTO extends BaseDTO {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** Numéro de pièce */
|
||||||
|
@NotBlank(message = "Le numéro de pièce est obligatoire")
|
||||||
|
private String numeroPiece;
|
||||||
|
|
||||||
|
/** Date de l'écriture */
|
||||||
|
@NotNull(message = "La date de l'écriture est obligatoire")
|
||||||
|
private LocalDate dateEcriture;
|
||||||
|
|
||||||
|
/** Libellé de l'écriture */
|
||||||
|
@NotBlank(message = "Le libellé est obligatoire")
|
||||||
|
private String libelle;
|
||||||
|
|
||||||
|
/** Référence externe */
|
||||||
|
private String reference;
|
||||||
|
|
||||||
|
/** Lettrage */
|
||||||
|
private String lettrage;
|
||||||
|
|
||||||
|
/** Pointage */
|
||||||
|
private Boolean pointe;
|
||||||
|
|
||||||
|
/** Montant total débit */
|
||||||
|
@DecimalMin(value = "0.0")
|
||||||
|
@Digits(integer = 12, fraction = 2)
|
||||||
|
private BigDecimal montantDebit;
|
||||||
|
|
||||||
|
/** Montant total crédit */
|
||||||
|
@DecimalMin(value = "0.0")
|
||||||
|
@Digits(integer = 12, fraction = 2)
|
||||||
|
private BigDecimal montantCredit;
|
||||||
|
|
||||||
|
/** Commentaires */
|
||||||
|
private String commentaire;
|
||||||
|
|
||||||
|
/** ID du journal */
|
||||||
|
@NotNull(message = "Le journal est obligatoire")
|
||||||
|
private UUID journalId;
|
||||||
|
|
||||||
|
/** ID de l'organisation */
|
||||||
|
private UUID organisationId;
|
||||||
|
|
||||||
|
/** ID du paiement */
|
||||||
|
private UUID paiementId;
|
||||||
|
|
||||||
|
/** Lignes d'écriture */
|
||||||
|
private List<LigneEcritureDTO> lignes;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package dev.lions.unionflow.server.api.dto.comptabilite;
|
||||||
|
|
||||||
|
import dev.lions.unionflow.server.api.dto.base.BaseDTO;
|
||||||
|
import dev.lions.unionflow.server.api.enums.comptabilite.TypeJournalComptable;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DTO pour la gestion des journaux comptables
|
||||||
|
*
|
||||||
|
* @author UnionFlow Team
|
||||||
|
* @version 3.0
|
||||||
|
* @since 2025-01-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class JournalComptableDTO extends BaseDTO {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** Code unique du journal */
|
||||||
|
@NotBlank(message = "Le code du journal est obligatoire")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/** Libellé du journal */
|
||||||
|
@NotBlank(message = "Le libellé est obligatoire")
|
||||||
|
private String libelle;
|
||||||
|
|
||||||
|
/** Type de journal */
|
||||||
|
@NotNull(message = "Le type de journal est obligatoire")
|
||||||
|
private TypeJournalComptable typeJournal;
|
||||||
|
|
||||||
|
/** Date de début de la période */
|
||||||
|
private LocalDate dateDebut;
|
||||||
|
|
||||||
|
/** Date de fin de la période */
|
||||||
|
private LocalDate dateFin;
|
||||||
|
|
||||||
|
/** Statut du journal */
|
||||||
|
private String statut;
|
||||||
|
|
||||||
|
/** Description */
|
||||||
|
private String description;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package dev.lions.unionflow.server.api.dto.comptabilite;
|
||||||
|
|
||||||
|
import dev.lions.unionflow.server.api.dto.base.BaseDTO;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.UUID;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DTO pour la gestion des lignes d'écriture
|
||||||
|
*
|
||||||
|
* @author UnionFlow Team
|
||||||
|
* @version 3.0
|
||||||
|
* @since 2025-01-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class LigneEcritureDTO extends BaseDTO {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** Numéro de ligne */
|
||||||
|
@NotNull(message = "Le numéro de ligne est obligatoire")
|
||||||
|
@Min(value = 1, message = "Le numéro de ligne doit être positif")
|
||||||
|
private Integer numeroLigne;
|
||||||
|
|
||||||
|
/** Montant débit */
|
||||||
|
@DecimalMin(value = "0.0", message = "Le montant débit doit être positif ou nul")
|
||||||
|
@Digits(integer = 12, fraction = 2)
|
||||||
|
private BigDecimal montantDebit;
|
||||||
|
|
||||||
|
/** Montant crédit */
|
||||||
|
@DecimalMin(value = "0.0", message = "Le montant crédit doit être positif ou nul")
|
||||||
|
@Digits(integer = 12, fraction = 2)
|
||||||
|
private BigDecimal montantCredit;
|
||||||
|
|
||||||
|
/** Libellé de la ligne */
|
||||||
|
private String libelle;
|
||||||
|
|
||||||
|
/** Référence */
|
||||||
|
private String reference;
|
||||||
|
|
||||||
|
/** ID de l'écriture */
|
||||||
|
@NotNull(message = "L'écriture est obligatoire")
|
||||||
|
private UUID ecritureId;
|
||||||
|
|
||||||
|
/** ID du compte comptable */
|
||||||
|
@NotNull(message = "Le compte comptable est obligatoire")
|
||||||
|
private UUID compteComptableId;
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user