- Création de la table qui stocke les demandes d'inscriptions
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 21s

- Création de la table qui stocke les demandes de réinscription

- Création d'un enum pour les états des requetes
This commit is contained in:
LeoMoulin 2024-03-09 12:40:02 +01:00
parent 54c0f9069e
commit 02afc3df47
3 changed files with 184 additions and 0 deletions

View File

@ -0,0 +1,108 @@
package ovh.herisson.Clyde.Tables;
import jakarta.persistence.*;
import java.util.Date;
public class InscriptionRequest {
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String firstName;
private String lastName;
private String adress;
private String email;
private String country;
private Date birthDate;
@ManyToOne
@JoinColumn(name="Cursus")
private Cursus cursus;
private RequestState state;
private String profilePicture;
public InscriptionRequest(){}
public InscriptionRequest(String lastName, String firstName, String adress, String email, String country, Date birthDate, RequestState state, String profilePicture){
this.lastName = lastName;
this.firstName = firstName;
this.adress = adress;
this.email = email;
this.country = country;
this.birthDate = birthDate;
this.state = state;
}
public int getId() {
return id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getAdress() {
return adress;
}
public void setAdress(String adress) {
this.adress = adress;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
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 Cursus getCursus() {
return cursus;
}
public void setCursus(Cursus cursus) {
this.cursus = cursus;
}
public RequestState getState() {
return state;
}
public void setState(RequestState state) {
this.state = state;
}
public String getProfilePicture() {
return profilePicture;
}
public void setProfilePicture(String profilePicture) {
this.profilePicture = profilePicture;
}
}

View File

@ -0,0 +1,69 @@
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;
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 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;
}
}

View File

@ -0,0 +1,7 @@
package ovh.herisson.Clyde.Tables;
public enum RequestState {
Accepted,
Refused,
Pending;
}