package fr.titionfire.ffsaf.data.model; import fr.titionfire.ffsaf.utils.Categorie; import fr.titionfire.ffsaf.utils.Genre; import fr.titionfire.ffsaf.utils.GradeArbitrage; import fr.titionfire.ffsaf.utils.RoleAsso; import io.quarkus.runtime.annotations.RegisterForReflection; import jakarta.persistence.*; import lombok.*; import org.eclipse.microprofile.openapi.annotations.media.Schema; import java.util.Date; import java.util.List; @Getter @Setter @Builder @AllArgsConstructor @NoArgsConstructor @RegisterForReflection @Entity @ToString @Table(name = "membre") public class MembreModel implements LoggableModel { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(AccessType.PROPERTY) @Schema(description = "L'identifiant du membre.", example = "1") Long id; @Schema(description = "L'identifiant long du membre (userID).", example = "e81d1d35-d897-421e-8086-6c5e74d13c6e") String userId; @Schema(description = "Le nom du membre.", example = "Dupont") String lname; @Schema(description = "Le prénom du membre.", example = "Jean") String fname; @Schema(description = "La catégorie du membre.", example = "SENIOR") Categorie categorie; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "club", referencedColumnName = "id") @Schema(description = "Le club du membre.") ClubModel club; @Schema(description = "Le genre du membre.", example = "H") Genre genre; @Schema(description = "Le numéro de licence du membre.", example = "12345") Integer licence; @Schema(description = "Le pays du membre.", example = "FR") String country; @Schema(description = "La date de naissance du membre.") Date birth_date; @Schema(description = "L'adresse e-mail du membre.", example = "jean.dupont@example.com") String email; @Schema(description = "Le rôle du membre dans l'association.", example = "MEMBRE") RoleAsso role; @Schema(description = "Le grade d'arbitrage du membre.", example = "NA") GradeArbitrage grade_arbitrage; @Schema(hidden = true) String url_photo; @OneToMany(mappedBy = "membre", fetch = FetchType.LAZY, cascade = CascadeType.ALL) @Schema(description = "Les licences du membre. (optionnel)") List licences; @Override public String getObjectName() { return fname + " " + lname; } @Override public LogModel.ObjectType getObjectType() { return LogModel.ObjectType.Membre; } }