package com.astalange.core.entity;

import jakarta.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Entity
@Table(name = "pre_inscription")
public class PreInscription {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(nullable = false, length = 100)
    private String nom;

    @Column(nullable = false, length = 100)
    private String prenom;

    @Column(name = "date_naissance", nullable = false)
    private LocalDate dateNaissance;

    @Column(name = "lieu_naissance_ville", nullable = false, length = 100)
    private String lieuNaissanceVille;

    @Column(name = "lieu_naissance_pays", nullable = false, length = 100)
    private String lieuNaissancePays;

    @Column(nullable = false, length = 100)
    private String nationalite;

    @Column(nullable = false, length = 150)
    private String email;

    @Column(name = "representant_legal", length = 150)
    private String representantLegal;

    @Column(name = "statut_traite", nullable = false)
    private Boolean statutTraite = false;

    @Column(name = "date_creation", nullable = false)
    private LocalDateTime dateCreation = LocalDateTime.now();

    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name = "saison_id", nullable = false)
    private Saison saison;

    @Column(name = "consentement_rgpd", nullable = false)
    private Boolean consentementRgpd = false;

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getNom() { return nom; }
    public void setNom(String nom) { this.nom = nom; }

    public String getPrenom() { return prenom; }
    public void setPrenom(String prenom) { this.prenom = prenom; }

    public LocalDate getDateNaissance() { return dateNaissance; }
    public void setDateNaissance(LocalDate dateNaissance) { this.dateNaissance = dateNaissance; }

    public String getLieuNaissanceVille() { return lieuNaissanceVille; }
    public void setLieuNaissanceVille(String lieuNaissanceVille) { this.lieuNaissanceVille = lieuNaissanceVille; }

    public String getLieuNaissancePays() { return lieuNaissancePays; }
    public void setLieuNaissancePays(String lieuNaissancePays) { this.lieuNaissancePays = lieuNaissancePays; }

    public String getNationalite() { return nationalite; }
    public void setNationalite(String nationalite) { this.nationalite = nationalite; }

    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }

    public String getRepresentantLegal() { return representantLegal; }
    public void setRepresentantLegal(String representantLegal) { this.representantLegal = representantLegal; }

    public Boolean getStatutTraite() { return statutTraite; }
    public void setStatutTraite(Boolean statutTraite) { this.statutTraite = statutTraite; }

    public LocalDateTime getDateCreation() { return dateCreation; }
    public void setDateCreation(LocalDateTime dateCreation) { this.dateCreation = dateCreation; }

    public Saison getSaison() { return saison; }
    public void setSaison(Saison saison) { this.saison = saison; }

    public Boolean getConsentementRgpd() { return consentementRgpd; }
    public void setConsentementRgpd(Boolean consentementRgpd) { this.consentementRgpd = consentementRgpd; }
}
