Refactroring
This commit is contained in:
@@ -2,6 +2,7 @@ package dev.lions.unionflow.client.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDate;
|
||||
@@ -9,6 +10,14 @@ import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* DTO client pour les organisations (alias historique Association).
|
||||
*
|
||||
* Harmonisé avec le contrat serveur `OrganisationDTO`:
|
||||
* - `dateCreation`/`dateModification` d'audit (LocalDateTime) alignés sur BaseDTO avec pattern JSON
|
||||
* - `dateFondation` (LocalDate) pour la date de création fonctionnelle de l'organisation
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class AssociationDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -28,9 +37,13 @@ public class AssociationDTO implements Serializable {
|
||||
@JsonProperty("typeOrganisation")
|
||||
private String typeAssociation;
|
||||
|
||||
// Date de fondation (fonctionnelle), côté serveur: OrganisationDTO.dateFondation
|
||||
@JsonProperty("dateFondation")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate dateCreation;
|
||||
private LocalDate dateFondation;
|
||||
|
||||
// Côté serveur: OrganisationDTO.numeroEnregistrement
|
||||
@JsonProperty("numeroEnregistrement")
|
||||
private String numeroRegistre;
|
||||
private String statut;
|
||||
private Integer nombreMembres;
|
||||
@@ -40,11 +53,23 @@ public class AssociationDTO implements Serializable {
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime dateDerniereActivite;
|
||||
|
||||
// Champs d'audit issus de BaseDTO (côté serveur)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime dateCreation;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime dateModification;
|
||||
|
||||
private Long version;
|
||||
private Boolean actif;
|
||||
|
||||
private String region;
|
||||
private String ville;
|
||||
private String quartier;
|
||||
private String pays;
|
||||
// Aligné sur OrganisationDTO.codePostal
|
||||
private String codePostal;
|
||||
|
||||
// Constructeurs
|
||||
public AssociationDTO() {}
|
||||
@@ -53,7 +78,7 @@ public class AssociationDTO implements Serializable {
|
||||
this.nom = nom;
|
||||
this.typeAssociation = typeAssociation;
|
||||
this.statut = "ACTIVE";
|
||||
this.dateCreation = LocalDate.now();
|
||||
this.dateFondation = LocalDate.now();
|
||||
this.nombreMembres = 0;
|
||||
}
|
||||
|
||||
@@ -82,8 +107,8 @@ public class AssociationDTO implements Serializable {
|
||||
public String getTypeAssociation() { return typeAssociation; }
|
||||
public void setTypeAssociation(String typeAssociation) { this.typeAssociation = typeAssociation; }
|
||||
|
||||
public LocalDate getDateCreation() { return dateCreation; }
|
||||
public void setDateCreation(LocalDate dateCreation) { this.dateCreation = dateCreation; }
|
||||
public LocalDate getDateFondation() { return dateFondation; }
|
||||
public void setDateFondation(LocalDate dateFondation) { this.dateFondation = dateFondation; }
|
||||
|
||||
public String getNumeroRegistre() { return numeroRegistre; }
|
||||
public void setNumeroRegistre(String numeroRegistre) { this.numeroRegistre = numeroRegistre; }
|
||||
@@ -117,6 +142,21 @@ public class AssociationDTO implements Serializable {
|
||||
|
||||
public String getPays() { return pays; }
|
||||
public void setPays(String pays) { this.pays = pays; }
|
||||
|
||||
public String getCodePostal() { return codePostal; }
|
||||
public void setCodePostal(String codePostal) { this.codePostal = codePostal; }
|
||||
|
||||
public LocalDateTime getDateCreation() { return dateCreation; }
|
||||
public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }
|
||||
|
||||
public LocalDateTime getDateModification() { return dateModification; }
|
||||
public void setDateModification(LocalDateTime dateModification) { this.dateModification = dateModification; }
|
||||
|
||||
public Long getVersion() { return version; }
|
||||
public void setVersion(Long version) { this.version = version; }
|
||||
|
||||
public Boolean getActif() { return actif; }
|
||||
public void setActif(Boolean actif) { this.actif = actif; }
|
||||
|
||||
// Propriétés dérivées
|
||||
public String getTypeLibelle() {
|
||||
|
||||
Reference in New Issue
Block a user