package ovh.herisson.Clyde.Tables;

import jakarta.persistence.*;

import java.util.Date;

//Classe représentant un utilisateur l'attribut password demande surement un peu de rafinement niveau sécurité
//et l'attribut tokenApi doit encore être ajouté vu qu'il faut en discuter

@Entity
//Je rajoute un s au nom de la table pour éviter les conflits avec les mots réservés
@Table(name = "Users")
public class User {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int regNo;
    private String lastName;
    private String firstName;
    @Column(unique = true)
    private String email;
    private String address;
    private String country;
    private Date birthDate;
    private String profilePictureUrl;
    private ovh.herisson.Clyde.Tables.Role role;
    private String password;
    public User(String lastName, String firstName, String email, String address,
                String country, Date birthDate, String profilePictureUrl, Role role, String password)
    {
        this.lastName = lastName;
        this.firstName = firstName;
        this.email = email;
        this.address = address;
        this.country = country;
        this.birthDate = birthDate;
        this.profilePictureUrl = profilePictureUrl;
        this.role = role;
        this.password = password;
    }

    public User() {}

    public int getRegNo(){
        return this.regNo;
    }
    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getEmail() {
        return email;
    }

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

    public String getAddress() {
        return address;
    }

    public void setAddress(String adress) {
        this.address = adress;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    public String getProfilePictureUrl(){return this.profilePictureUrl;}

    public void setProfilePictureUrl(String profilePictureUrl){
        this.profilePictureUrl = profilePictureUrl;
    }
    public ovh.herisson.Clyde.Tables.Role getRole() {
        return role;
    }

    public void setRole(ovh.herisson.Clyde.Tables.Role role) {
        this.role = role;
    }
    public String getPassword(){
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
