package ovh.herisson.Clyde.Tables;

import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;

public class ReinscriptionRequest {
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;

    @ManyToOne
    @JoinColumn(name = "User")
    private User user;

    @ManyToOne
    @JoinColumn(name = "Cursus")
    private Cursus newCursus;
    private RequestState state;

    //Permet de différencier les demandes de changement et une réinscription dans le même cursus
    //Pour la réinscription on va le mettre a 0
    private boolean type = false;

    public ReinscriptionRequest(){}

    public ReinscriptionRequest(User user, Cursus newCursus, RequestState state, boolean type){
        this.user = user;
        this.newCursus = newCursus;
        this.state = state;
        this.type = type;
    }

    public ReinscriptionRequest(User user, Cursus newCursus, RequestState state){
        this.user = user;
        this.newCursus = newCursus;
        this.state = state;
    }

    public int getId() {
        return id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Cursus getNewCursus() {
        return newCursus;
    }

    public void setNewCursus(Cursus newCursus) {
        this.newCursus = newCursus;
    }

    public RequestState getState() {
        return state;
    }

    public void setState(RequestState state) {
        this.state = state;
    }

    public boolean isType() {
        return type;
    }

    public void setType(boolean type) {
        this.type = type;
    }
}
