Fix fews things and rename the inscription app to managerequests also sort the files
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 29s

This commit is contained in:
2024-04-11 21:06:57 +02:00
parent 4199663d64
commit 8ebedec689
37 changed files with 94 additions and 122 deletions

View File

@ -64,8 +64,8 @@ public class ApplicationsController {
if (!authServ.isNotIn(new Role[]{Role.Teacher,Role.Secretary,Role.Admin},token))
authorizedApps.add(Applications.ManageCourses);
if (!authServ.isNotIn(new Role[]{Role.InscriptionService,Role.Admin},token)){
authorizedApps.add(Applications.Inscription);
if (!authServ.isNotIn(new Role[]{Role.InscriptionService,Role.Admin, Role.Teacher},token)){
authorizedApps.add(Applications.Requests);
authorizedApps.add(Applications.StudentsList);}
if (!authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)){

View File

@ -4,8 +4,8 @@ package ovh.herisson.Clyde.EndPoints;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.InscriptionRepository;
import ovh.herisson.Clyde.Repositories.Inscription.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.InscriptionRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.*;
import ovh.herisson.Clyde.Tables.*;

View File

@ -1,13 +1,12 @@
package ovh.herisson.Clyde.EndPoints;
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.InscriptionRepository;
import ovh.herisson.Clyde.Tables.ExternalCurriculum;
import ovh.herisson.Clyde.Tables.InscriptionRequest;
import ovh.herisson.Clyde.Tables.RequestState;
import ovh.herisson.Clyde.Repositories.Inscription.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.InscriptionRepository;
import ovh.herisson.Clyde.Tables.Inscription.ExternalCurriculum;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import java.util.ArrayList;
import java.util.Map;
@ -29,7 +28,7 @@ public class ExternalCurriculumController {
public ResponseEntity<ExternalCurriculum> postExternalCurriculum(@RequestBody Map<String, Object> externalCurrInfos){
InscriptionRequest ir = inscriptionRepository.findById((Integer) externalCurrInfos.get("inscriptionRequestId"));
ExternalCurriculum toSave = new ExternalCurriculum(ir, (String) externalCurrInfos.get("school"),(String) externalCurrInfos.get("formation"),(String) externalCurrInfos.get("completion"), (Integer)externalCurrInfos.get("startYear"), (Integer)externalCurrInfos.get("endYear"), (String)externalCurrInfos.get("justifDocUrl"), RequestState.Pending);
ExternalCurriculum toSave = new ExternalCurriculum(ir, (String) externalCurrInfos.get("school"),(String) externalCurrInfos.get("formation"),(String) externalCurrInfos.get("completion"), (Integer)externalCurrInfos.get("startYear"), (Integer)externalCurrInfos.get("endYear"), (String)externalCurrInfos.get("justifDocUrl"));
return new ResponseEntity<>(ecr.save(toSave), HttpStatus.OK);
}
@ -41,12 +40,4 @@ public class ExternalCurriculumController {
ArrayList<ExternalCurriculum> toReturn = ecr.getExternalCurriculumByInscriptionRequest(ir);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
@PatchMapping("/externalcurriculum/{extcurrid}/{newstate}")
public ResponseEntity<Object> changeExternalCurrState(@PathVariable long extcurrid, @PathVariable RequestState newstate){
ExternalCurriculum externalCurriculum = ecr.getExternalCurriculumById(extcurrid);
externalCurriculum.setState(newstate);
ecr.save(externalCurriculum);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -1,14 +1,13 @@
package ovh.herisson.Clyde.EndPoints;
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.apache.tomcat.util.http.parser.Authorization;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.InscriptionService;
import ovh.herisson.Clyde.Services.Inscription.InscriptionService;
import ovh.herisson.Clyde.Services.ProtectionService;
import ovh.herisson.Clyde.Tables.InscriptionRequest;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.RequestState;
import ovh.herisson.Clyde.Tables.Role;
import java.util.Map;

View File

@ -1,13 +1,12 @@
package ovh.herisson.Clyde.EndPoints;
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.apache.coyote.Response;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.MinervalRepository;
import ovh.herisson.Clyde.Repositories.Inscription.MinervalRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Tables.Minerval;
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
import ovh.herisson.Clyde.Tables.Role;
import java.util.*;

View File

@ -1,18 +1,13 @@
package ovh.herisson.Clyde.EndPoints;
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.PaymentRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Tables.Minerval;
import ovh.herisson.Clyde.Tables.Payment;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Repositories.Inscription.PaymentRepository;
import ovh.herisson.Clyde.Tables.Inscription.Payment;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")

View File

@ -1,15 +1,17 @@
package ovh.herisson.Clyde.EndPoints;
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.CourseRepository;
import ovh.herisson.Clyde.Repositories.ExemptionsRequestRepository;
import ovh.herisson.Clyde.Repositories.ScholarshipRequestRepository;
import ovh.herisson.Clyde.Repositories.Inscription.ExemptionsRequestRepository;
import ovh.herisson.Clyde.Repositories.Inscription.ScholarshipRequestRepository;
import ovh.herisson.Clyde.Repositories.UserRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Tables.Inscription.ExemptionsRequest;
import ovh.herisson.Clyde.Tables.Inscription.ScholarshipRequest;
import java.util.ArrayList;
import java.util.Date;

View File

@ -6,12 +6,11 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
import ovh.herisson.Clyde.Repositories.InscriptionRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.ProtectionService;
import ovh.herisson.Clyde.Tables.Curriculum;
import ovh.herisson.Clyde.Tables.InscriptionRequest;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.RequestState;
import java.util.Date;

View File

@ -3,8 +3,17 @@ package ovh.herisson.Clyde.EndPoints;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.*;
import ovh.herisson.Clyde.Repositories.Inscription.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.MinervalRepository;
import ovh.herisson.Clyde.Repositories.Inscription.ScholarshipRequestRepository;
import ovh.herisson.Clyde.Services.*;
import ovh.herisson.Clyde.Services.Inscription.InscriptionService;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Tables.Inscription.ExternalCurriculum;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
import ovh.herisson.Clyde.Tables.Inscription.ScholarshipRequest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
@ -119,7 +128,7 @@ public class MockController {
inscriptionService.save(inscriptionRequest);
ExternalCurriculum externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null, RequestState.Pending);
ExternalCurriculum externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null);
externalCurriculumRepository.save(externalCurriculum);
}
}

View File

@ -1,7 +1,7 @@
package ovh.herisson.Clyde.Repositories;
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ExemptionsRequest;
import ovh.herisson.Clyde.Tables.Inscription.ExemptionsRequest;
public interface ExemptionsRequestRepository extends CrudRepository<ExemptionsRequest, Long> {

View File

@ -1,9 +1,8 @@
package ovh.herisson.Clyde.Repositories;
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ExternalCurriculum;
import ovh.herisson.Clyde.Tables.InscriptionRequest;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.Inscription.ExternalCurriculum;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import java.util.ArrayList;

View File

@ -1,7 +1,7 @@
package ovh.herisson.Clyde.Repositories;
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.InscriptionRequest;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
public interface InscriptionRepository extends CrudRepository<InscriptionRequest,Long> {

View File

@ -1,7 +1,7 @@
package ovh.herisson.Clyde.Repositories;
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Minerval;
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
import java.util.ArrayList;

View File

@ -1,7 +1,7 @@
package ovh.herisson.Clyde.Repositories;
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Payment;
import ovh.herisson.Clyde.Tables.Inscription.Payment;
import java.util.ArrayList;

View File

@ -1,7 +1,7 @@
package ovh.herisson.Clyde.Repositories;
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ScholarshipRequest;
import ovh.herisson.Clyde.Tables.Inscription.ScholarshipRequest;
public interface ScholarshipRequestRepository extends CrudRepository<ScholarshipRequest, Long> {

View File

@ -1,7 +1,10 @@
package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Services.Inscription.InscriptionService;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import java.util.Date;
@Service

View File

@ -1,9 +1,13 @@
package ovh.herisson.Clyde.Services;
package ovh.herisson.Clyde.Services.Inscription;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.*;
import ovh.herisson.Clyde.Repositories.Inscription.InscriptionRepository;
import ovh.herisson.Clyde.Repositories.Inscription.MinervalRepository;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
@Service
public class InscriptionService {

View File

@ -1,7 +1,7 @@
package ovh.herisson.Clyde.Services;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.InscriptionRequest;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.User;
import java.util.ArrayList;

View File

@ -2,7 +2,7 @@ package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
import ovh.herisson.Clyde.Repositories.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
import ovh.herisson.Clyde.Tables.*;

View File

@ -18,6 +18,6 @@ public enum Applications {
UsersList,
// InscriptionService authorization
Inscription,
Requests,
StudentsList
}

View File

@ -1,9 +1,12 @@
package ovh.herisson.Clyde.Tables;
package ovh.herisson.Clyde.Tables.Inscription;
import jakarta.persistence.*;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.RequestState;
import ovh.herisson.Clyde.Tables.User;
import java.util.Date;

View File

@ -1,4 +1,4 @@
package ovh.herisson.Clyde.Tables;
package ovh.herisson.Clyde.Tables.Inscription;
import jakarta.persistence.*;
@ -25,12 +25,9 @@ public class ExternalCurriculum {
private int endYear;
private String justifdocUrl;
//Accepted if the document justifies the claimed formation
private RequestState state;
public ExternalCurriculum(){}
public ExternalCurriculum(InscriptionRequest ir, String school, String formation, String completion, int startYear, int endYear, String justifdocUrl, RequestState state){
public ExternalCurriculum(InscriptionRequest ir, String school, String formation, String completion, int startYear, int endYear, String justifdocUrl){
this.inscriptionRequest = ir;
this.school = school;
this.formation = formation;
@ -38,7 +35,6 @@ public class ExternalCurriculum {
this.startYear = startYear;
this.endYear = endYear;
this.justifdocUrl = justifdocUrl;
this.state = state;
}
public int getId() {
@ -100,12 +96,4 @@ public class ExternalCurriculum {
public String getJustifdocUrl() {
return justifdocUrl;
}
public RequestState getState() {
return state;
}
public void setState(RequestState state) {
this.state = state;
}
}

View File

@ -1,6 +1,8 @@
package ovh.herisson.Clyde.Tables;
package ovh.herisson.Clyde.Tables.Inscription;
import jakarta.persistence.*;
import ovh.herisson.Clyde.Tables.RequestState;
import java.util.Date;

View File

@ -1,4 +1,4 @@
package ovh.herisson.Clyde.Tables;
package ovh.herisson.Clyde.Tables.Inscription;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;

View File

@ -1,4 +1,4 @@
package ovh.herisson.Clyde.Tables;
package ovh.herisson.Clyde.Tables.Inscription;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;

View File

@ -1,8 +1,11 @@
package ovh.herisson.Clyde.Tables;
package ovh.herisson.Clyde.Tables.Inscription;
import jakarta.persistence.*;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import ovh.herisson.Clyde.Tables.Curriculum;
import ovh.herisson.Clyde.Tables.RequestState;
import ovh.herisson.Clyde.Tables.User;
@Entity
public class ReInscriptionRequest {

View File

@ -1,8 +1,10 @@
package ovh.herisson.Clyde.Tables;
package ovh.herisson.Clyde.Tables.Inscription;
import jakarta.persistence.*;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import ovh.herisson.Clyde.Tables.RequestState;
import ovh.herisson.Clyde.Tables.User;
import java.util.Date;

View File

@ -1,9 +1,10 @@
package ovh.herisson.Clyde.Tables;
package ovh.herisson.Clyde.Tables.Inscription;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import ovh.herisson.Clyde.Tables.RequestState;
@Entity
public class UninscriptionRequest {