diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java index b2dcd50..74f76fa 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java @@ -47,6 +47,7 @@ public class ApplicationsController { //if unAuthed authorizedApps.add(Applications.Login); + authorizedApps.add(Applications.Schedule); User user = authServ.getUserFromToken(token); if(user == null) @@ -60,6 +61,8 @@ public class ApplicationsController { authorizedApps.add(Applications.Rdv); } + if(!authServ.isNotIn(new Role[]{Role.Teacher,Role.Admin},token)) + authorizedApps.add(Applications.ManageOwnedLessons); //if Teacher or Secretary or Admin add ManageCourses App if (!authServ.isNotIn(new Role[]{Role.Teacher,Role.Secretary,Role.Admin},token)) authorizedApps.add(Applications.ManageCourses); @@ -69,7 +72,9 @@ public class ApplicationsController { authorizedApps.add(Applications.StudentsList);} if (!authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)){ - authorizedApps.add(Applications.UsersList);} + authorizedApps.add(Applications.UsersList); + authorizedApps.add(Applications.ManageSchedules); + authorizedApps.add(Applications.LessonRequests);} if (!authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin, Role.InscriptionService},token)){ authorizedApps.add(Applications.Payments);} diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/CourseController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/CourseController.java index c021e0e..f85980c 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/CourseController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/CourseController.java @@ -86,11 +86,8 @@ public class CourseController { public ResponseEntity> postCourse(@RequestHeader("Authorization") String token, @RequestBody Course course) { - System.out.println(course); - System.out.println(token); if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)) return new UnauthorizedResponse<>(null); - Course createdCourse = courseServ.save(course); if (createdCourse == null) return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST); diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/ExternalCurriculumController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/ExternalCurriculumController.java index a8a87ce..7b396d6 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/ExternalCurriculumController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/ExternalCurriculumController.java @@ -39,7 +39,7 @@ public class ExternalCurriculumController { user = userRepository.findById((Integer) externalCurrInfos.get("userRegNo")); } - 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"), user); + 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"), user); return new ResponseEntity<>(ecr.save(toSave), HttpStatus.OK); } diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/InscriptionController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/InscriptionController.java index eb283e8..8caf2d9 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/InscriptionController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/InscriptionController.java @@ -3,10 +3,12 @@ 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.CurriculumRepository; import ovh.herisson.Clyde.Responses.UnauthorizedResponse; import ovh.herisson.Clyde.Services.AuthenticatorService; import ovh.herisson.Clyde.Services.Inscription.InscriptionService; import ovh.herisson.Clyde.Services.ProtectionService; +import ovh.herisson.Clyde.Tables.Curriculum; import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest; import ovh.herisson.Clyde.Tables.RequestState; import ovh.herisson.Clyde.Tables.Role; @@ -19,10 +21,11 @@ public class InscriptionController { private final InscriptionService inscriptionServ; private final AuthenticatorService authServ; - - public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ){ + private final CurriculumRepository curriculumRepository; + public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ, CurriculumRepository curriculumRepository){ this.inscriptionServ = inscriptionServ; this.authServ = authServ; + this.curriculumRepository = curriculumRepository; } @@ -103,4 +106,31 @@ public class InscriptionController { } return new ResponseEntity<>(HttpStatus.OK); } + + @PatchMapping("/request/registerequivimpose/{id}/{cursusid}") + public ResponseEntity editRegisterEquiv(@RequestHeader("Authorization") String token, @PathVariable long id, @PathVariable long cursusid){ + if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher}, token)) + return new UnauthorizedResponse<>(null); + + InscriptionRequest toEdit = inscriptionServ.getById(id); + + //If the request is already accepted we just return ok (otherwise we would duplicate the procedure below) + if (toEdit.getEquivalenceState() == RequestState.Accepted){ + return new ResponseEntity<>(HttpStatus.OK); + } + + //We impose a curriculum + Curriculum curriculum = curriculumRepository.findById(cursusid); + + toEdit.setCurriculumId(curriculum.getCurriculumId()); + toEdit.setEquivalenceState(RequestState.Accepted); + + inscriptionServ.save(toEdit); + + if (toEdit.getState() == RequestState.Accepted && (toEdit.getEquivalenceState() == RequestState.Accepted || toEdit.getEquivalenceState() == RequestState.Unrequired)) + { + inscriptionServ.createUser(toEdit); + } + return new ResponseEntity<>(HttpStatus.OK); + } } diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/RequestsController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/RequestsController.java index b21a6ca..65cbe4d 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/RequestsController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/RequestsController.java @@ -5,10 +5,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import ovh.herisson.Clyde.Repositories.CourseRepository; import ovh.herisson.Clyde.Repositories.CurriculumRepository; -import ovh.herisson.Clyde.Repositories.Inscription.ChangeCurriculumRequestRepository; -import ovh.herisson.Clyde.Repositories.Inscription.ExemptionsRequestRepository; -import ovh.herisson.Clyde.Repositories.Inscription.ScholarshipRequestRepository; -import ovh.herisson.Clyde.Repositories.Inscription.UnregisterRequestRepository; +import ovh.herisson.Clyde.Repositories.Inscription.*; import ovh.herisson.Clyde.Repositories.UserCurriculumRepository; import ovh.herisson.Clyde.Repositories.UserRepository; import ovh.herisson.Clyde.Responses.UnauthorizedResponse; @@ -17,6 +14,7 @@ import ovh.herisson.Clyde.Services.TokenService; import ovh.herisson.Clyde.Services.UserService; import ovh.herisson.Clyde.Tables.*; import ovh.herisson.Clyde.Tables.Inscription.ExemptionsRequest; +import ovh.herisson.Clyde.Tables.Inscription.Minerval; import ovh.herisson.Clyde.Tables.Inscription.ScholarshipRequest; import ovh.herisson.Clyde.Tables.Inscription.UnregisterRequest; @@ -39,10 +37,10 @@ public class RequestsController { public final UserService userService; public final UserCurriculumRepository userCurriculumRepository; public final CurriculumRepository curriculumRepository; - + public final MinervalRepository minervalRepository; public final ChangeCurriculumRequestRepository changeCurriculumRequestRepository; - public RequestsController(TokenService tokenService, ExemptionsRequestRepository err, ScholarshipRequestRepository srr, UserRepository userRepository, AuthenticatorService authServ, UnregisterRequestRepository unregisterRequestRepository, CourseRepository courseRepository, UserService userService, UserCurriculumRepository userCurriculumRepository, CurriculumRepository curriculumRepository, ChangeCurriculumRequestRepository changeCurriculumRequestRepository) { + public RequestsController(TokenService tokenService, ExemptionsRequestRepository err, ScholarshipRequestRepository srr, UserRepository userRepository, AuthenticatorService authServ, UnregisterRequestRepository unregisterRequestRepository, CourseRepository courseRepository, UserService userService, UserCurriculumRepository userCurriculumRepository, CurriculumRepository curriculumRepository, MinervalRepository minervalRepository, ChangeCurriculumRequestRepository changeCurriculumRequestRepository) { this.tokenService = tokenService; this.err = err; this.srr = srr; @@ -53,6 +51,7 @@ public class RequestsController { this.userService = userService; this.userCurriculumRepository = userCurriculumRepository; this.curriculumRepository = curriculumRepository; + this.minervalRepository = minervalRepository; this.changeCurriculumRequestRepository = changeCurriculumRequestRepository; } @@ -154,6 +153,8 @@ public class RequestsController { ScholarshipRequest scholarshipRequest = srr.findById((Integer) infos.get("id")); + User u = scholarshipRequest.getUser(); + //If the request is already accepted we just return ok (otherwise we would duplicate the procedure below) if (scholarshipRequest.getState() == RequestState.Accepted){ return new ResponseEntity<>(HttpStatus.OK); @@ -162,6 +163,12 @@ public class RequestsController { if (infos.get("state").equals("Accepted")){ scholarshipRequest.setState(RequestState.Accepted); scholarshipRequest.setAmount((int) infos.get("amount")); + + //We then deduce then amount from the minerval + ArrayList minerval = minervalRepository.getMinervalsByStudentRegNoOrderByYearDesc(u.getRegNo()); + minerval.get(0).setPaidAmount(minerval.get(0).getPaidAmount() + scholarshipRequest.getAmount()); + minerval.get(0).setToPay(minerval.get(0).getToPay() - scholarshipRequest.getAmount()); + minervalRepository.save(minerval.get(0)); }else{ scholarshipRequest.setState(RequestState.Refused); } diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LessonController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LessonController.java new file mode 100644 index 0000000..72a05b1 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LessonController.java @@ -0,0 +1,129 @@ +package ovh.herisson.Clyde.EndPoints; + +/****************************************************** + * @file LessonController.java + * @author William Karpinski + * @scope Extension Horaire + * + * Controller of Lessons API + ******************************************************/ + +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.LessonService; +import ovh.herisson.Clyde.Services.ProtectionService; +import ovh.herisson.Clyde.Services.ScheduleLessonService; +import ovh.herisson.Clyde.Tables.Lesson; +import ovh.herisson.Clyde.Tables.Role; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@CrossOrigin(originPatterns = "*", allowCredentials = "true") +public class LessonController { + private final LessonService lessonServ; + + private final ScheduleLessonService scheduleLessonServ; + private final AuthenticatorService authServ; + + public LessonController(LessonService lessonServ, ScheduleLessonService scheduleLessonService, AuthenticatorService authServ) { + this.lessonServ = lessonServ; + this.scheduleLessonServ = scheduleLessonService; + this.authServ = authServ; + } + + /** + * Return a lesson via its id + */ + @GetMapping("/lesson/{id}") + public ResponseEntity> getLesson(@PathVariable long id){ + Lesson lesson = lessonServ.findById(id); + + if(lesson == null) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + + return new ResponseEntity<>(ProtectionService.lessonWithoutPassword(lesson),HttpStatus.OK); + } + + /** + * Return all the lessons + */ + @GetMapping("/lessons") + public ResponseEntity>> getAllLessons(@RequestHeader("Authorization") String token){ + if(authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token)) + return new UnauthorizedResponse<>(null); + return new ResponseEntity<>(ProtectionService.lessonsWithoutPassword(lessonServ.findAll()),HttpStatus.OK); + } + + /** + * Return all the lessons of a teacher's courses + */ + @GetMapping("/lessons/owned") + public ResponseEntity>> getOwnedLessons(@RequestHeader("Authorization") String token){ + if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token)){ + return new UnauthorizedResponse<>(null);} + return new ResponseEntity<>(ProtectionService.lessonsWithoutPassword(lessonServ.findAllOwnedLesson(authServ.getUserFromToken(token))),HttpStatus.OK); + } + + /** + ⋅* Return all the lessons of a student + */ + @GetMapping("/lessons/OwnCurriculum") + public ResponseEntity>> getOnesLessons(@RequestHeader("Authorization") String token){ + if (authServ.isNotIn(new Role[]{Role.Admin,Role.Student},token)){ + return new UnauthorizedResponse<>(null);} + return new ResponseEntity<>(ProtectionService.lessonsWithoutPassword(lessonServ.findOnesLessons(authServ.getUserFromToken(token))),HttpStatus.OK); + } + + /** + * Post a new lesson + */ + @PostMapping("/lesson") + public ResponseEntity> postLesson(@RequestHeader("Authorization") String token, + @RequestBody Map lessonInfos){ + if(authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)) + return new UnauthorizedResponse<>(null); + + + Lesson lesson = lessonServ.createLesson(lessonInfos); + Lesson createdLesson = lessonServ.save(lesson); + scheduleLessonServ.saveToAllSchedule(lesson); + + if(createdLesson==null) + return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST); + return new ResponseEntity<>(ProtectionService.lessonWithoutPassword(createdLesson), HttpStatus.OK); + } + /** + * Modify a lesson + */ + @PatchMapping("/lesson/{id}") + public ResponseEntity patchLesson(@RequestHeader("Authorization") String token, + @RequestBody Map updates, + @PathVariable long id){ + if(authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token)) + return new UnauthorizedResponse<>(null); + if(!lessonServ.modifyData(id, updates)){ + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + } + return new ResponseEntity<>(HttpStatus.OK); + } + /** + * Delete a lesson + */ + @DeleteMapping("lesson/{id}") + public ResponseEntity deleteLesson(@RequestHeader("Authorization") String token, + @PathVariable Long id){ + if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token)) + return new UnauthorizedResponse<>(null); + Lesson toDelete = lessonServ.findById(id); + if(toDelete == null) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + lessonServ.delete(toDelete); + return new ResponseEntity<>(HttpStatus.OK); + + } +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LessonRequestsController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LessonRequestsController.java new file mode 100644 index 0000000..68eeeeb --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LessonRequestsController.java @@ -0,0 +1,150 @@ +package ovh.herisson.Clyde.EndPoints; + +/****************************************************** + * @file LessonRequestsController.java + * @author William Karpinski + * @scope Extension Horaire + * + * Controller of lesson requests API + ******************************************************/ + +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.LessonRequestService; +import ovh.herisson.Clyde.Services.LessonService; +import ovh.herisson.Clyde.Services.ProtectionService; +import ovh.herisson.Clyde.Tables.LessonChangesRequest; +import ovh.herisson.Clyde.Tables.RequestState; +import ovh.herisson.Clyde.Tables.Role; +import ovh.herisson.Clyde.Tables.User; + +import java.util.Map; + +@RestController +@CrossOrigin(originPatterns = "*", allowCredentials = "true") +public class LessonRequestsController { + private final LessonRequestService lessonRequestServ; + private final AuthenticatorService authServ; + + private final LessonService lessonServ; + public LessonRequestsController(LessonRequestService lessonRequestServer, AuthenticatorService authServ, LessonService lessonServ) { + this.lessonRequestServ = lessonRequestServer; + this.authServ = authServ; + this.lessonServ = lessonServ; + } + /** + * Return a lesson request via its id + */ + @GetMapping("/requests/lessonRequest/{id}") + public ResponseEntity> getById(@RequestHeader("Authorization") String token, @PathVariable long id){ + if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token)) + return new UnauthorizedResponse<>(null); + + LessonChangesRequest lessonRequest= lessonRequestServ.findById(id); + + return new ResponseEntity<>(ProtectionService.lessonRequestWithoutPassword(lessonRequest), HttpStatus.OK); + } + /** + * return all the requests made by a user + */ + @GetMapping("/requests/lessonRequests/owned") + public ResponseEntity>> getOwnedRequests(@RequestHeader("Authorization") String token){ + if(authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token)) + return new UnauthorizedResponse<>(null); + User user = authServ.getUserFromToken(token); + Iterable lessonChangesRequests = lessonRequestServ.findOwnRequests(user); + return new ResponseEntity<>(ProtectionService.lessonRequestsWithoutPassword(lessonChangesRequests),HttpStatus.OK); + + } + /** + * Return all the lesson requests + */ + @GetMapping("/requests/lessonRequests") + public ResponseEntity>> getAllRequests(@RequestHeader("Authorization") String token){ + if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token)) + return new UnauthorizedResponse<>(null); + + Iterable lessonRequests= lessonRequestServ.getAll(); + + return new ResponseEntity<>(ProtectionService.lessonRequestsWithoutPassword(lessonRequests), HttpStatus.OK); + } + /** + * Post a lesson request + */ + @PostMapping("/requests/lessonRequest") + public ResponseEntity> makeRequest(@RequestHeader("Authorization") String token, @RequestBody Map lessonRequestInfos){ + if(authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token)) + return new UnauthorizedResponse<>(null); + LessonChangesRequest lessonChangesRequest = lessonRequestServ.createLessonRequest(lessonRequestInfos); + LessonChangesRequest createdRequest = lessonRequestServ.save(lessonChangesRequest); + if(createdRequest == null) + return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST); + return new ResponseEntity<>(ProtectionService.lessonRequestWithoutPassword(lessonChangesRequest),HttpStatus.OK); + } + /** + * Modify a lesson Request + */ + @PatchMapping("/requests/lessonRequest/{id}") + public ResponseEntity changeRequestState(@PathVariable long id, + @RequestHeader("Authorization") String token, + @RequestBody Map infos){ + if(authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)) + return new UnauthorizedResponse<>(null); + + LessonChangesRequest lessonRequest = lessonRequestServ.findById(id); + String local = ""; + RequestState state = null; + for (Map.Entry entry : infos.entrySet()) { + switch (entry.getKey()) { + case "local": + local = (String) entry.getValue(); + break; + case "state": + state = RequestState.valueOf((String)entry.getValue()); + } + } + + if (state == null) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + + if(lessonRequest.getRequestType() == 0 ) { + if (!lessonRequestServ.modifyCreateRequestState(lessonRequest, state, local)) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + } + + else if(lessonRequest.getRequestType() == 1){ + infos.put("lessonStart", lessonRequest.getLessonStart()); + infos.put("lessonEnd", lessonRequest.getLessonEnd()); + infos.put("lessonType",lessonRequest.getLessonType()); + if(!lessonRequestServ.modifyChangeRequestState(infos,lessonRequest.getLessonId(),state)) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + lessonRequest.setState(state); + } + + else{ + lessonRequestServ.modifyDeleteRequest(lessonRequest, state); + lessonRequest.setState(state); + + } + lessonRequestServ.save(lessonRequest); + return new ResponseEntity<>(HttpStatus.OK); + + } + + /** + * Delete a lesson request + */ + @DeleteMapping("/requests/lessonRequest/{id}") + public ResponseEntity deleteRequest(@RequestHeader("Authorization") String token, @PathVariable long id){ + if(authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary,Role.Teacher},token)) + return new UnauthorizedResponse<>(null); + LessonChangesRequest lessonChangesRequest = lessonRequestServ.findById(id); + if (lessonChangesRequest == null) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + lessonRequestServ.delete(lessonChangesRequest); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java index ee215c9..3b80212 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java @@ -30,6 +30,12 @@ public class MockController { public final CourseService courseService; public final ExternalCurriculumRepository externalCurriculumRepository; public final InscriptionService inscriptionService; + + public final LessonService lessonService; + public final ScheduleService scheduleService; + public final ScheduleLessonService scheduleLessonService; + + public final LessonRequestService lessonRequestService; ArrayList mockUsers; public final UserCurriculumRepository ucr; @@ -39,7 +45,7 @@ public class MockController { public final ScholarshipRequestRepository scholarshipRequestRepository; public final UnregisterRequestRepository uninscriptionRequestRepository; - public MockController(UserService userService, UserRepository userRepo, TokenRepository tokenRepo, TokenService tokenService, CurriculumCourseService CurriculumCourseService, CurriculumService curriculumService, CourseService courseService, ExternalCurriculumRepository externalCurriculumRepository, InscriptionService inscriptionService, UserCurriculumRepository ucr, MinervalRepository minervalRepository, ScholarshipRequestRepository scholarshipRequestRepository, UnregisterRequestRepository unregisterRequestRepository){ + public MockController(UserService userService, UserRepository userRepo, TokenRepository tokenRepo, TokenService tokenService, CurriculumCourseService CurriculumCourseService, CurriculumService curriculumService, CourseService courseService, ExternalCurriculumRepository externalCurriculumRepository, InscriptionService inscriptionService, UserCurriculumRepository ucr, MinervalRepository minervalRepository, ScholarshipRequestRepository scholarshipRequestRepository, UnregisterRequestRepository unregisterRequestRepository, LessonService lessonService, ScheduleService scheduleService, ScheduleLessonService scheduleLessonService, LessonRequestService lessonRequestService){ this.userService = userService; this.tokenRepo = tokenRepo; this.userRepo = userRepo; @@ -49,6 +55,10 @@ public class MockController { this.courseService = courseService; this.externalCurriculumRepository = externalCurriculumRepository; this.inscriptionService = inscriptionService; + this.lessonService = lessonService; + this.scheduleService = scheduleService; + this.scheduleLessonService = scheduleLessonService; + this.lessonRequestService = lessonRequestService; this.ucr = ucr; this.minervalRepository = minervalRepository; this.scholarshipRequestRepository = scholarshipRequestRepository; @@ -135,6 +145,50 @@ public class MockController { inscriptionService.save(inscriptionRequest); + + //Schedule part + + Lesson lesson_0_progra1 = new Lesson(progra1, "Mon Apr 22 2024 08:15", "Mon Apr 22 2024 10:15","rgb(0,50,100)","A0B2","Course"); + Lesson lesson_0_chemistry1 = new Lesson(chemistry1, "Wed Mar 27 2024 08:15", "Wed Mar 27 2024 09:15","rgb(100,50,0)","A0B2","TP"); + Lesson lesson_0_psycho1 = new Lesson(psycho1, "Sun Mar 24 2024 10:30 ","Sun Mar 24 2024 12:30 ","rgb(100,50,100)", "A0B2","TD"); + Lesson lesson_1_progra1 = new Lesson(progra1, "Mon Apr 02 2024 13:30", "Mon Apr 02 2024 15:30","rgb(0,50,100)","A0B2","TP"); + Lesson lesson_0_commun = new Lesson(commun, "Mon Apr 01 2024 10:30", "Mon Apr 01 2024 12:30","rgb(0,50,100)","A0B2","Course"); + + LessonChangesRequest request1 = new LessonChangesRequest(joke,RequestState.Pending,null,null,null,null,2,null,1); + LessonChangesRequest request2 = new LessonChangesRequest(joke,RequestState.Pending,"Fri Apr 19 2024 10:30 ","Fri Apr 19 2024 12:30 ",null,null,1,null,2); + LessonChangesRequest request3 = new LessonChangesRequest(joke,RequestState.Pending,"Fri Apr 19 2024 13:30 ","Fri Apr 19 2024 15:30 ","Course",progra1,0,"rgb(27,49,100)",4); + + + Schedule infoBab1Schedule = new Schedule(infoBab1); + Schedule chemistryBab1Schedule = new Schedule(chemistryBab1); + Schedule psychoBab1Schedule = new Schedule(psychologyBab1); + + + scheduleService.save(infoBab1Schedule); + scheduleService.save(chemistryBab1Schedule); + scheduleService.save(psychoBab1Schedule); + + lessonService.save(lesson_0_progra1); + lessonService.save(lesson_0_chemistry1); + lessonService.save(lesson_0_commun); + lessonService.save(lesson_0_psycho1); + lessonService.save(lesson_1_progra1); + + scheduleLessonService.save(new ScheduleLesson(infoBab1Schedule,lesson_0_progra1)); + scheduleLessonService.save(new ScheduleLesson(infoBab1Schedule,lesson_1_progra1)); + scheduleLessonService.save(new ScheduleLesson(infoBab1Schedule,lesson_0_commun)); + + scheduleLessonService.save(new ScheduleLesson(chemistryBab1Schedule,lesson_0_chemistry1)); + scheduleLessonService.save(new ScheduleLesson(chemistryBab1Schedule,lesson_0_commun)); + + scheduleLessonService.save(new ScheduleLesson(psychoBab1Schedule,lesson_0_psycho1)); + scheduleLessonService.save(new ScheduleLesson(psychoBab1Schedule,lesson_0_commun)); + + + lessonRequestService.save(request1); + lessonRequestService.save(request2); + lessonRequestService.save(request3); + UnregisterRequest unregisterRequest = new UnregisterRequest(RequestState.Pending, "je veux partir", new Date(), joe.getRegNo(), joe.getFirstName(), joe.getLastName(), joe.getEmail(), null); uninscriptionRequestRepository.save(unregisterRequest); diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ScheduleController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ScheduleController.java new file mode 100644 index 0000000..113b513 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ScheduleController.java @@ -0,0 +1,116 @@ +package ovh.herisson.Clyde.EndPoints; + +/****************************************************** + * @file ScheduleController.java + * @author William Karpinski + * @scope Extension Horaire + * + * Controller of Schedule API + ******************************************************/ + + +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.ScheduleLessonService; +import ovh.herisson.Clyde.Services.ScheduleService; +import ovh.herisson.Clyde.Services.UserCurriculumService; +import ovh.herisson.Clyde.Services.CurriculumService; +import ovh.herisson.Clyde.Tables.*; +import ovh.herisson.Clyde.Services.LessonService; + +import java.util.Map; + +@RestController +@CrossOrigin(originPatterns = "*", allowCredentials = "true") +public class ScheduleController { + + private final ScheduleService scheduleServ; + private final LessonService lessonServ; + + private final CurriculumService curriculumServ; + private final AuthenticatorService authServ; + + private final ScheduleLessonService scheduleLessonServ; + + public ScheduleController(ScheduleService scheduleServ, AuthenticatorService authServ, ScheduleLessonService scheduleLessonServ, CurriculumService curriculumServ,LessonService lessonServ) { + this.scheduleServ = scheduleServ; + this.authServ = authServ; + this.scheduleLessonServ = scheduleLessonServ; + this.curriculumServ = curriculumServ; + this.lessonServ = lessonServ; + } + /** + * Return schedule via its id + */ + @GetMapping("/schedule/{id}") + public ResponseEntity> findById(@PathVariable long id){ + Schedule schedule = scheduleServ.findById(id); + + if(schedule == null) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + return new ResponseEntity<>(scheduleLessonServ.getDepthScheduleBySchedule(schedule),HttpStatus.OK); + } + + /** + * Return a schedule via its curriculum id + */ + @GetMapping("/schedule/curriculum/{id}") + public ResponseEntity> findCurriculumSchedule(@PathVariable Long id){ + Schedule schedule = scheduleLessonServ.getScheduleByCurriculum(curriculumServ.findById(id)); + if(schedule == null) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + return new ResponseEntity<>(scheduleLessonServ.getDepthScheduleBySchedule(schedule),HttpStatus.OK); + } + /** + * Return all schedules + */ + @GetMapping("/schedules") + public ResponseEntity>> findAllSchedule(){ + return new ResponseEntity<>(scheduleLessonServ.getAllSchedule(),HttpStatus.OK); + } + /** + * Post a new schedule + */ + @PostMapping("/schedule") + public ResponseEntity postSchedule(@RequestHeader("Authorization") String token, + @RequestBody Schedule schedule){ + if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token)) + return new UnauthorizedResponse<>(null); + return new ResponseEntity<>(scheduleServ.save(schedule),HttpStatus.OK); + } + /** + * Post a lesson to a schedule + */ + @PostMapping("/schedule/{id}") + public ResponseEntity postLessonToSchedule(@RequestHeader("Authorization") String token, + @RequestBody Long lessonId, + @PathVariable long id) + { + + if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token)) + return new UnauthorizedResponse<>(null); + + if (!scheduleLessonServ.save(new ScheduleLesson( scheduleServ.findById(id), lessonServ.findById(lessonId)))) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + + return new ResponseEntity<>(HttpStatus.OK); + } + /** + * Delete a lesson from a schedule + */ + @DeleteMapping("/schedule/lesson/{id}") + public ResponseEntity deleteLessonFromSchedule(@RequestHeader("Authorization") String token, + @RequestBody Long lessonId, + @PathVariable Long id) + { + if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token)) + return new UnauthorizedResponse<>(null); + if (!scheduleLessonServ.delete(lessonId)) + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java index 20ca9ee..2835b60 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java @@ -103,9 +103,6 @@ public class UserController { @GetMapping("/teachers") public ResponseEntity>> getAllTeachers(@RequestHeader("Authorization") String token){ - if (authServ.getUserFromToken(token) == null) - return new UnauthorizedResponse<>(null); - Iterable teachers = userService.getAllTeachers(); return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(teachers), HttpStatus.OK); diff --git a/backend/src/main/java/ovh/herisson/Clyde/Repositories/LessonChangesRequestRepository.java b/backend/src/main/java/ovh/herisson/Clyde/Repositories/LessonChangesRequestRepository.java new file mode 100644 index 0000000..4f732d6 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Repositories/LessonChangesRequestRepository.java @@ -0,0 +1,23 @@ +package ovh.herisson.Clyde.Repositories; + +/****************************************************** + * @file LessonChangesRequestRepository.java + * @author William Karpinski + * @scope Extension Horaire + ******************************************************/ + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import ovh.herisson.Clyde.Tables.LessonChangesRequest; +import ovh.herisson.Clyde.Tables.User; + +public interface LessonChangesRequestRepository extends CrudRepository { + LessonChangesRequest findById(long id); + + + @Query("select lr from LessonChangesRequest lr where lr.user = ?1") + Iterable findOwnRequests(User user); + + @Query("select lr from LessonChangesRequest lr where lr.lessonId = ?1") + Iterable findRequestByLessonId(long id); +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Repositories/LessonRepository.java b/backend/src/main/java/ovh/herisson/Clyde/Repositories/LessonRepository.java new file mode 100644 index 0000000..6d80ef8 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Repositories/LessonRepository.java @@ -0,0 +1,20 @@ +package ovh.herisson.Clyde.Repositories; + +/****************************************************** + * @file LessonRepository.java + * @author William Karpinski + * @scope Extension Horaire + ******************************************************/ + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import ovh.herisson.Clyde.Tables.Course; +import ovh.herisson.Clyde.Tables.Lesson; + +public interface LessonRepository extends CrudRepository { + + Lesson findById(long id); + + @Query("select l from Lesson l where l.course = ?1") + Iterable findLessonByCourse(Course course); +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScheduleLessonRepository.java b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScheduleLessonRepository.java new file mode 100644 index 0000000..97e69ca --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScheduleLessonRepository.java @@ -0,0 +1,30 @@ +package ovh.herisson.Clyde.Repositories; + +/****************************************************** + * @file ScheduleLessonRepository.java + * @author William Karpinski + * @scope Extension Horaire + ******************************************************/ +import jakarta.transaction.Transactional; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import ovh.herisson.Clyde.Tables.Curriculum; +import ovh.herisson.Clyde.Tables.Lesson; +import ovh.herisson.Clyde.Tables.Schedule; +import ovh.herisson.Clyde.Tables.ScheduleLesson; + +public interface ScheduleLessonRepository extends CrudRepository { + + @Query("select distinct sl.lesson from ScheduleLesson sl where sl.schedule.curriculum = ?1") + Iterable findLessonByCurriculum(Curriculum curriculum); + + @Query("select distinct sl.schedule from ScheduleLesson sl where sl.schedule.curriculum = ?1") + Schedule findScheduleByCurriculum(Curriculum curriculum); + + @Modifying + @Transactional + @Query("delete from ScheduleLesson sl where sl.lesson =?1") + void delete(Lesson lesson); + +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScheduleRepository.java b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScheduleRepository.java new file mode 100644 index 0000000..04f3cde --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScheduleRepository.java @@ -0,0 +1,22 @@ +package ovh.herisson.Clyde.Repositories; + +/****************************************************** + * @file ScheduleRepository.java + * @author William Karpinski + * @scope Extension Horaire + ******************************************************/ + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import ovh.herisson.Clyde.Tables.Course; +import ovh.herisson.Clyde.Tables.Lesson; +import ovh.herisson.Clyde.Tables.Schedule; + +public interface ScheduleRepository extends CrudRepository { + + Schedule getById(long id); + + + @Query("select distinct sl from Schedule sl where EXISTS (select c.curriculum from CurriculumCourse c where (sl.curriculum = c.curriculum) AND (c.course = ?1))") + Iterable findAllLessonSchedule(Course course); +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/Inscription/InscriptionService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/Inscription/InscriptionService.java index 534fb88..374b03b 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Services/Inscription/InscriptionService.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/Inscription/InscriptionService.java @@ -89,7 +89,8 @@ public class InscriptionService { inscrRequest.getCountry(), inscrRequest.getBirthDate(), inscrRequest.getProfilePicture(), - inscrRequest.getPassword() + inscrRequest.getPassword(), + inscrRequest.getIdentityCard() ); userService.save(userFromRequest); diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/LessonRequestService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/LessonRequestService.java new file mode 100644 index 0000000..21a6732 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/LessonRequestService.java @@ -0,0 +1,177 @@ +package ovh.herisson.Clyde.Services; + +/****************************************************** + * @file LeessonRequestService.java + * @author William Karpinski + * @scope Extension Horaire + ******************************************************/ +import org.springframework.stereotype.Service; +import ovh.herisson.Clyde.Repositories.*; +import ovh.herisson.Clyde.Tables.*; + +import java.util.Map; + +@Service +public class LessonRequestService { + private final LessonChangesRequestRepository lessonChangesRepo; + + private final UserRepository userRepo; + + private final LessonRepository lessonRepo; + + private final LessonService lessonServ; + + private final ScheduleLessonRepository scheduleLessonRepo; + + private final ScheduleRepository scheduleRepository; + + private final ScheduleLessonService scheduleLessonService; + + private final UserService userServ; + + private final CourseRepository courseRepository; + public LessonRequestService(LessonChangesRequestRepository lessonChangesRepo, + UserRepository userRepo, LessonRepository lessonRepo, + LessonService lessonServ, ScheduleLessonRepository scheduleLessonRepo, + ScheduleRepository scheduleRepository, ScheduleLessonService scheduleLessonService, + UserService userServ, CourseRepository courseRepository) { + this.lessonChangesRepo = lessonChangesRepo; + this.userRepo = userRepo; + this.lessonRepo = lessonRepo; + this.lessonServ = lessonServ; + this.scheduleLessonRepo = scheduleLessonRepo; + this.scheduleRepository = scheduleRepository; + this.scheduleLessonService = scheduleLessonService; + this.userServ = userServ; + this.courseRepository = courseRepository; + } + + /** + * Create a new lesson request + */ + public LessonChangesRequest save(LessonChangesRequest lessonRequest){ + return lessonChangesRepo.save(lessonRequest); + } + + /** + * Find all the requests made by a user + */ + public Iterable findOwnRequests(User user){ + return lessonChangesRepo.findOwnRequests(user); + } + public LessonChangesRequest findById(long id){ + return lessonChangesRepo.findById(id); + } + /** + * Return all the requests + */ + public Iterable getAll(){return lessonChangesRepo.findAll();} + + /** + * Create a lesson if a request is accepted + */ + public boolean modifyCreateRequestState(LessonChangesRequest lessonRequest, RequestState state, String local ){ + if(lessonRequest == null || state == lessonRequest.getState() || state == null){ + return false;} + if (state == RequestState.Accepted){ + Course course = courseRepository.findById(lessonRequest.getCourse().getCourseID()); + if(courseRepository.findById(lessonRequest.getCourse().getCourseID())==null|| local == null){ + return false;} + Lesson lesson = new Lesson(); + lesson.setCourse(course); + lesson.setLessonStart(lessonRequest.getLessonStart()); + lesson.setLessonEnd(lessonRequest.getLessonEnd()); + lesson.setColor(lessonRequest.getColor()); + lesson.setLocal(local); + lesson.setLessonType(lessonRequest.getLessonType()); + + lesson = lessonRepo.save(lesson); + scheduleLessonService.saveToAllSchedule(lesson); + } + lessonRequest.setState(state); + save(lessonRequest); + return true; + } + + public Iterable findRequestByLessonId(long id){ + return lessonChangesRepo.findRequestByLessonId(id); + } + + /** + * Refuse all the lesson request that depends on a certain lesson + * Used after the deletion of the lesson + */ + public void refuseAllByLessonId(long id){ + Iterable toRefuse = findRequestByLessonId(id); + for(LessonChangesRequest element : toRefuse) + element.setState(RequestState.Refused); + + } + + /** + * Modify a lesson if a request is accepted + */ + public boolean modifyChangeRequestState(Map updates, long lessonId,RequestState state){ + if(state == RequestState.Accepted){ + Lesson lesson = lessonServ.findById(lessonId); + return lessonServ.modifyData(lesson.getLessonID(),updates); + } + return true; + } + + /** + * Delete a lesson if a request is accepted + */ + public void modifyDeleteRequest(LessonChangesRequest lessonChangesRequest, RequestState state){ + if(state == RequestState.Accepted){ + lessonServ.delete(lessonServ.findById(lessonChangesRequest.getLessonId())); + refuseAllByLessonId(lessonChangesRequest.getLessonId()); + } + } + + /** + * Construct a lesson request + */ + public LessonChangesRequest createLessonRequest(Map lessonInfos) { + LessonChangesRequest target = new LessonChangesRequest(); + + for (Map.Entry entry : lessonInfos.entrySet()) { + System.out.println(entry.toString()); + if(entry.getValue() != null){ + switch (entry.getKey()) { + case "requestType": + target.setRequestType((int) entry.getValue()); + break; + case "lessonStart": + target.setLessonStart((String) entry.getValue()); + break; + case "lessonEnd": + target.setLessonEnd((String) entry.getValue()); + break; + case "color": + target.setColor((String) entry.getValue()); + break; + case "user": + target.setUser(userServ.getUserById((int) entry.getValue())); + break; + case "lessonType": + target.setLessonType((String) entry.getValue()); + break; + case "course": + target.setCourse(courseRepository.findById((int) entry.getValue())); + break; + case "lessonId": + target.setLessonId((int) entry.getValue()); + break; + + } + } + } + target.setState(RequestState.Pending); + return target; + } + + public void delete (LessonChangesRequest toDelete) { + lessonChangesRepo.delete(toDelete); + } +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/LessonService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/LessonService.java new file mode 100644 index 0000000..292a6a6 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/LessonService.java @@ -0,0 +1,150 @@ +package ovh.herisson.Clyde.Services; + + +/****************************************************** + * @file LessonService.java + * @author William Karpinski + * @scope Extension Horaire + ******************************************************/ +import org.springframework.stereotype.Service; +import ovh.herisson.Clyde.Repositories.CourseRepository; +import ovh.herisson.Clyde.Repositories.CurriculumCourseRepository; +import ovh.herisson.Clyde.Repositories.LessonRepository; +import ovh.herisson.Clyde.Repositories.UserCurriculumRepository; +import ovh.herisson.Clyde.Tables.*; + +import java.util.ArrayList; +import java.util.Map; + +@Service +public class LessonService { + private final LessonRepository lessonRepo; + private final UserCurriculumRepository userCurriculumRepo; + private final CourseRepository courseRepo; + private final CurriculumCourseRepository curriculumCourseRepo; + public LessonService(LessonRepository lessonRepo, UserCurriculumRepository userCurriculumRepo, CourseRepository courseRepo, CurriculumCourseRepository curriculumCourseRepo){ + this.lessonRepo = lessonRepo; + this.userCurriculumRepo = userCurriculumRepo; + this.courseRepo = courseRepo; + this.curriculumCourseRepo = curriculumCourseRepo; + } + + /** + * Create a lesson + */ + public Lesson save(Lesson lesson){ + return lessonRepo.save(lesson); + } + /** + * Find a lesson by its id + */ + public Lesson findById(long id){ + return lessonRepo.findById(id); + } + /** + * Return all the lessons + */ + public Iterable findAll(){return lessonRepo.findAll();} + /** + * Return all a teacher's lessons + */ + public Iterable findAllOwnedLesson(User teacher){ + ArrayList toReturn = new ArrayList<>(); + ArrayList coursesOwned = (ArrayList) courseRepo.findAllOwnedCoures(teacher); + for (Course element : coursesOwned) { + for(Lesson lesson : lessonRepo.findLessonByCourse(element)) + toReturn.add(lesson); + } + return toReturn; + } + /** + * Return all a student's lessons + */ + + public Iterable findOnesLessons(User student){ + ArrayList toReturn = new ArrayList<>(); + ArrayList courses = new ArrayList<>(); + ArrayList userCurricula = userCurriculumRepo.findByUserAndActual(student, true); + for (UserCurriculum userCurriculum : userCurricula) { + curriculumCourseRepo.findCoursesByCurriculum(userCurriculum.getCurriculum()).forEach((item) -> { + //We need this to eliminate clones because a course can belong to several curriculums + if (!courses.contains(item)) { + System.out.println(item.getTitle()); + courses.add(item); + } + }); + } + for (Course element : courses) { + for(Lesson lesson : lessonRepo.findLessonByCourse(element)) + toReturn.add(lesson); + } + + return toReturn; + } + /** + * Construct a new lesson + */ + public Lesson createLesson(Map lessonInfos) { + Lesson target = new Lesson(); + + for (Map.Entry entry : lessonInfos.entrySet()) { + switch (entry.getKey()) { + case "lessonStart": + target.setLessonStart((String) entry.getValue()); + break; + case "lessonEnd": + target.setLessonEnd((String) entry.getValue()); + case "color": + target.setColor((String) entry.getValue()); + break; + case "local": + target.setLocal((String) entry.getValue()); + break; + case "lessonType": + target.setLessonType((String) entry.getValue()); + break; + case "courseID": + target.setCourse(courseRepo.findById((int) entry.getValue())); + break; + } + + } + return target; + } + /** + * Modify a lesson + */ + public boolean modifyData(long id, Map updates){ + Lesson target = lessonRepo.findById(id); + + if(target == null) + return false; + + for (Map.Entry entry: updates.entrySet()){ + switch (entry.getKey()){ + case "lessonStart": + target.setLessonStart((String) entry.getValue()); + break; + case "lessonEnd": + target.setLessonEnd((String) entry.getValue()); + break; + case "local": + target.setLocal((String) entry.getValue()); + break; + case "lessonType": + target.setLessonType((String) entry.getValue()); + break; + } + } + lessonRepo.save(target); + return true; + } + /** + * Delete a lesson + */ + public void delete(Lesson lesson){ + lessonRepo.delete(lesson); + } + + +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/ProtectionService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/ProtectionService.java index 8c3d847..d08951e 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Services/ProtectionService.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/ProtectionService.java @@ -1,8 +1,7 @@ package ovh.herisson.Clyde.Services; -import ovh.herisson.Clyde.Tables.Course; +import ovh.herisson.Clyde.Tables.*; import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest; -import ovh.herisson.Clyde.Tables.User; import java.util.ArrayList; import java.util.HashMap; @@ -30,6 +29,7 @@ public class ProtectionService { toReturn.put("country",user.getCountry()); toReturn.put("profilePictureUrl",user.getProfilePictureUrl()); toReturn.put("role",user.getRole()); + toReturn.put("identityCard", user.getIdentityCardUrl()); return toReturn; } @@ -69,6 +69,33 @@ public class ProtectionService { } + public static HashMap lessonWithoutPassword(Lesson lesson){ + if(lesson == null) + return null; + + HashMap toReturn = new HashMap<>(); + + toReturn.put("lessonID", lesson.getLessonID()); + toReturn.put("lessonStart", lesson.getLessonStart()); + toReturn.put("lessonEnd", lesson.getLessonEnd()); + toReturn.put("course",courseWithoutPassword(lesson.getCourse())); + toReturn.put("local",lesson.getLocal()); + toReturn.put("color", lesson.getColor()); + toReturn.put("lessonType",lesson.getLessonType()); + return toReturn; + } + + public static Iterable> lessonsWithoutPassword(Iterable lessons){ + ArrayList> toReturn = new ArrayList<>(); + + for (Lesson l: lessons){ + toReturn.add(ProtectionService.lessonWithoutPassword(l)); + } + + return toReturn; + + } + public static Map requestWithoutPassword(InscriptionRequest inscriptionRequest) { @@ -93,6 +120,32 @@ public class ProtectionService { return toReturn; } + public static Map lessonRequestWithoutPassword(LessonChangesRequest lessonRequest){ + if (lessonRequest == null) + return null; + Map toReturn = new HashMap<>(); + toReturn.put("id", lessonRequest.getId()); + toReturn.put("lessonStart", lessonRequest.getLessonStart()); + toReturn.put("lessonEnd", lessonRequest.getLessonEnd()); + toReturn.put("lessonType",lessonRequest.getLessonType()); + toReturn.put("course", courseWithoutPassword(lessonRequest.getCourse())); + toReturn.put("user", userWithoutPassword(lessonRequest.getUser())); + toReturn.put("requestType", lessonRequest.getRequestType()); + toReturn.put("state", lessonRequest.getState()); + toReturn.put("lessonId",lessonRequest.getLessonId()); + + return toReturn; + } + + public static Iterable> lessonRequestsWithoutPassword(Iterable lessonChangesRequests){ + ArrayList> toReturn = new ArrayList<>(); + + for(LessonChangesRequest lessonChangeRequest: lessonChangesRequests){ + toReturn.add(lessonRequestWithoutPassword(lessonChangeRequest)); + } + return toReturn; + + } public static Iterable> requestsWithoutPasswords(Iterable inscriptionRequests){ ArrayList> toReturn = new ArrayList<>(); diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/ScheduleLessonService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/ScheduleLessonService.java new file mode 100644 index 0000000..d89fa01 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/ScheduleLessonService.java @@ -0,0 +1,93 @@ +package ovh.herisson.Clyde.Services; + +/****************************************************** + * @file ScheduleLessonService.java + * @author William Karpinski + * @scope Extension Horaire + ******************************************************/ +import org.springframework.stereotype.Service; +import ovh.herisson.Clyde.Repositories.LessonRepository; +import ovh.herisson.Clyde.Repositories.ScheduleLessonRepository; +import ovh.herisson.Clyde.Repositories.ScheduleRepository; +import ovh.herisson.Clyde.Tables.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +@Service +public class ScheduleLessonService { + + private final ScheduleLessonRepository scheduleLessonRepo; + + private final LessonRepository lessonRepo; + private final ScheduleRepository scheduleRepo; + public ScheduleLessonService(ScheduleLessonRepository scheduleLessonRepo, LessonRepository lessonRepo, ScheduleRepository scheduleRepo) { + this.scheduleLessonRepo = scheduleLessonRepo; + this.lessonRepo = lessonRepo; + this.scheduleRepo = scheduleRepo; + } + public boolean save(ScheduleLesson scheduleLesson){ + if(scheduleLesson == null) + return false; + scheduleLessonRepo.save(scheduleLesson); + return true; + } + /** + * Save a lesson to all the schedule it is linked + */ + public boolean saveToAllSchedule(Lesson lesson){ + Iterable schedules = scheduleRepo.findAllLessonSchedule(lesson.getCourse()); + if(schedules == null) + return false; + for (Schedule schedule : schedules){ + save(new ScheduleLesson(schedule, lesson)); + } + return true; + } + /** + * Delete a scheduleLesson via its lesson + */ + public boolean delete(long lessonId){ + if(lessonId == 0) + return false; + scheduleLessonRepo.delete(lessonRepo.findById(lessonId)); + return true; + } + + public Schedule getScheduleByCurriculum(Curriculum curriculum){ + return scheduleLessonRepo.findScheduleByCurriculum(curriculum); + } + /** + * Return a schedule and the list of lessons that corresponds + */ + public Map getDepthScheduleBySchedule(Schedule schedule){ + if(schedule == null) + return null; + + HashMap toReturn = new HashMap<>(); + ArrayList> lessons = new ArrayList<>(); + Iterable foundLessons = scheduleLessonRepo.findLessonByCurriculum(schedule.getCurriculum()); + + for (Lesson l: foundLessons){ + lessons.add(ProtectionService.lessonWithoutPassword(l)); + } + toReturn.put("lessons",lessons); + toReturn.put("scheduleId" , schedule.getScheduleID()); + toReturn.put("curriculum", schedule.getCurriculum()); + return toReturn; + } + /** + * Return all the schedules + */ + public Iterable> getAllSchedule(){ + ArrayList> toReturn = new ArrayList<>(); + + for (Schedule schedule: scheduleRepo.findAll()){ + toReturn.add(getDepthScheduleBySchedule(schedule)); + } + return toReturn; + } + +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/ScheduleService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/ScheduleService.java new file mode 100644 index 0000000..0d73cfc --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/ScheduleService.java @@ -0,0 +1,24 @@ +package ovh.herisson.Clyde.Services; + +import org.springframework.stereotype.Service; +import ovh.herisson.Clyde.Repositories.ScheduleRepository; +import ovh.herisson.Clyde.Tables.Schedule; + +@Service +public class ScheduleService { + private final ScheduleRepository scheduleRepo; + public ScheduleService(ScheduleRepository scheduleRepo) { + this.scheduleRepo = scheduleRepo; + } + public Schedule save(Schedule schedule){ + return scheduleRepo.save(schedule); + } + public Schedule findById(long id){ + return scheduleRepo.getById(id); + } + public void delete(Schedule schedule){ + scheduleRepo.delete(schedule); + } + +} + diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java index 77a7074..741de69 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java @@ -3,6 +3,7 @@ package ovh.herisson.Clyde.Tables; public enum Applications { // without any token Login, + Schedule, // with any token Profile, @@ -12,10 +13,17 @@ public enum Applications { Msg, Forum, Rdv, + // teachers authorization + + ManageOwnedLessons, // teachers and Secretary authorization ManageCourses, UsersList, + + //Secretary authorization + ManageSchedules, + LessonRequests, // InscriptionService authorization Requests, diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Lesson.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Lesson.java new file mode 100644 index 0000000..673e532 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Lesson.java @@ -0,0 +1,101 @@ +package ovh.herisson.Clyde.Tables; + + +/****************************************************** + * @file Lesson.java + * @author William Karpinski + * @scope Extension Horaire + * + * Represent a course in a schedule + ******************************************************/ + +import jakarta.persistence.*; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; + + +@Entity +public class Lesson { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int lessonID; + + @ManyToOne(fetch = FetchType.EAGER) + @OnDelete(action = OnDeleteAction.SET_NULL) + @JoinColumn(name = "Course") + private Course course; + + private String lessonStart; + + private String lessonEnd; + + private String color; + + private String lessonType; + + private String local; + + public Lesson(Course course,String start, String end ,String color,String local,String lessonType){ + this.lessonEnd = end; + this.course = course; + this.lessonStart = start; + this.color = color; + this.local = local; + this.lessonType = lessonType; + } + + public Lesson() { + } + + public int getLessonID(){ + return lessonID; + } + + public void setCourse(Course course) { + this.course = course; + } + + public Course getCourse(){ + return course; + } + + public String getLessonStart(){ + return lessonStart; + } + + public String getLessonEnd() { + return lessonEnd; + } + + public String getColor(){ + return color; + } + + public String getLocal() { + return local; + } + + public String getLessonType(){ + return lessonType; + } + + public void setLessonStart(String start){ + this.lessonStart = start; + } + + public void setLessonEnd(String lessonEnd) { + this.lessonEnd = lessonEnd; + } + + public void setColor(String color){ + this.color = color; + } + + public void setLocal(String local){ + this.local = local; + } + + public void setLessonType(String lessonType){ + this.lessonType = lessonType; + } +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/LessonChangesRequest.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/LessonChangesRequest.java new file mode 100644 index 0000000..c969548 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/LessonChangesRequest.java @@ -0,0 +1,148 @@ +package ovh.herisson.Clyde.Tables; + + +/****************************************************** + * @file LessonChangesRequest.java + * @author William Karpinski + * @scope Extension Horaire + * + * Represent a request about changes on schedules and lessons + ******************************************************/ + +import jakarta.persistence.*; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; + +@Entity +public class LessonChangesRequest { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int id; + + @ManyToOne + @JoinColumn(name = "Users") + @OnDelete(action = OnDeleteAction.CASCADE) + private User user; + + private long lessonId; + + private RequestState state; + + private String lessonStart; + + private String lessonEnd; + + private String color; + @ManyToOne + @JoinColumn(name ="Course") + private Course course; + + private String lessonType; + + /** + * Can take 3 values: + * 0 : Request to CREATE a lesson + * 1 : Request to MODIFY an existing lesson + * 2 : Request to DELETE a lesson + */ + private int requestType; + + public LessonChangesRequest(User user, RequestState state, String lessonStart, + String lessonEnd, String lessonType, Course course, + int requestType, String color,long lessonId){ + this.user = user; + this.state = state; + this.requestType = requestType; + this.lessonType = lessonType; + this.lessonStart = lessonStart; + this.lessonEnd= lessonEnd; + this.color = color; + this.course = course; + this.lessonId = lessonId; + } + + public LessonChangesRequest() { + + } + + public int getId() { + return id; + } + + + public RequestState getState() { + return state; + } + + public User getUser() { + return user; + } + + public long getLessonId(){ + return lessonId; + } + + public String getLessonStart() { + return lessonStart; + } + + public String getLessonEnd() { + return lessonEnd; + } + + + + public int getRequestType() { + return requestType; + } + + public String getLessonType() { + return lessonType; + } + + public String getColor() { + return color; + } + + public Course getCourse() { + return course; + } + + public void setState(RequestState state) { + this.state = state; + } + + public void setUser(User user) { + this.user = user; + } + + public void setLessonStart(String lessonStart) { + this.lessonStart = lessonStart; + } + + public void setLessonType(String lessonType) { + this.lessonType = lessonType; + } + + public void setLessonEnd(String lessonEnd) { + this.lessonEnd = lessonEnd; + } + + public void setColor(String color) { + this.color = color; + } + + public void setRequestType(int requestType) { + this.requestType = requestType; + } + + + public void setLessonId(long lessonId) { + this.lessonId = lessonId; + } + + public void setCourse(Course course){ + this.course = course; + } +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Schedule.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Schedule.java new file mode 100644 index 0000000..e2f1982 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Schedule.java @@ -0,0 +1,42 @@ + +package ovh.herisson.Clyde.Tables; + + +/****************************************************** + * @file Schedule.java + * @author William Karpinski + * @scope Extension Horaire + * + * Represent a schedule linked to a curriculum + ******************************************************/ +import jakarta.persistence.*; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; + +@Entity +public class Schedule { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int scheduleID; + + @OneToOne + @JoinColumn(name = "Curriculum") + @OnDelete(action = OnDeleteAction.SET_NULL) + private Curriculum curriculum; + + public Schedule(Curriculum curriculum){ + this.curriculum = curriculum; + } + + public Schedule() {} + + + public int getScheduleID(){ + return scheduleID; +} + + public Curriculum getCurriculum(){ + return curriculum; +} + +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/ScheduleLesson.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/ScheduleLesson.java new file mode 100644 index 0000000..9dca028 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/ScheduleLesson.java @@ -0,0 +1,63 @@ +package ovh.herisson.Clyde.Tables; + + +/****************************************************** + * @file ScheduleLesson.java + * @author William Karpinski + * @scope Extension Horaire + * + * Used to link schedules and lessons to each others + ******************************************************/ + +import jakarta.persistence.*; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; + + +@Entity +public class ScheduleLesson{ + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int id; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "Schedule") + @OnDelete(action = OnDeleteAction.SET_NULL) + private Schedule schedule; + + + @ManyToOne(fetch = FetchType.EAGER) + @OnDelete(action = OnDeleteAction.SET_NULL) + @JoinColumn(name = "Lesson") + private Lesson lesson; + + public ScheduleLesson(Schedule schedule,Lesson lesson){ + this.schedule = schedule; + this.lesson = lesson; + } + + public ScheduleLesson() { + } + + public int getID(){ + return id; + } + + public Lesson getLesson(){ + return lesson; + } + + public Schedule getSchedule(){ + return schedule; + } + + public void setLesson(Lesson lesson){ + this.lesson = lesson; + } + + public void setSchedule(Schedule schedule){ + this.schedule = schedule; + } + + +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java index 3c9b6ec..6b724de 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java @@ -34,6 +34,7 @@ public class User { private Date birthDate; private String profilePictureUrl; private Role role; + private String identityCardUrl; @JsonIgnore private String password; @@ -65,8 +66,10 @@ public class User { this.password = password; } + + //This constructor is used to add a student public User(String lastName, String firstName, String email, String address, - String country, Date birthDate, String profilePictureUrl, String password) + String country, Date birthDate, String profilePictureUrl, String password,String identityCardUrl) { this.lastName = lastName; this.firstName = firstName; @@ -77,5 +80,6 @@ public class User { this.profilePictureUrl = profilePictureUrl; this.password = password; this.role = Role.Student; + this.identityCardUrl = identityCardUrl; } } diff --git a/frontend/public/i18n/EN.txt b/frontend/public/i18n/EN.txt index 103c42e..34665e6 100644 --- a/frontend/public/i18n/EN.txt +++ b/frontend/public/i18n/EN.txt @@ -29,16 +29,76 @@ app.settings=Settings app.messages=Messages app.forum=Forum app.schedules=Schedules +app.manageSchedules=Manage Schedules app.inscription.requests=Inscription Requests app.manage.courses=Manage Courses app.language=Language app.manage.profile=Manage profile app.studentList=Students List app.users=Users -app.payments = Payments +app.manageOwnLessons=Manage Owned Courses Schedule +app.lessonRequests=Schedule Requests +app.payments=Payments request.moreInfos=More Infos request.accept=Accept request.refuse=Refuse +Pending=Pending +Delete=Delete +Modify=Modify +Create=Créer +requestType=Request Type +day=Day +start=Start +end=End +monday=Monday +tuesday=Tuesday +wednesday=Wednesday +thursday=Thursday +friday=Friday +saturday=Saturday +sunday=Sunday +january=January +february=February +march=March +april=April +may=May +june=June +july=July +august=August +september=September +october=October +november=November +december=December +Grid=Grid +Week=Week +Month=Month +List=List +Type=Type +Teacher=Teacher +Course=Course +TP=TP +TD=TD +Exam=Exam +OwnSchedule=Own Schedule +SwitchToJSON=Switch to JSON FILE +schedule.previous=Previous +schedule.next=Next +schedule.current=Current +schedule.settings=Settings +schedule.courses=Courses +schedule.teachers=Teacher(s) +schedule.askChanges=Ask Changes +schedule.askCreate=Ask to create course +schedule.askDeletion=Ask Deletion +schedule.createSchedule=Create Schedule +schedule.createLesson=Create course +schedule.deleteMod=Unable deletion +schedule.noDeleteMod=Disable deletion +schedule=Schedule +old_day=Precedent day +old_start=Precedent start +old_end=Precedent end +old_type=Precedent type courses.createCourse=Create course courses.deleteCourse=Delete course courses.modify=Modify @@ -83,7 +143,7 @@ dltaxdoc=Download tax justification document dlresidency=Download residency justification document enteramount=Please enter the amount to provide : oldcursus=Old curriculums -newcursus = New curriculums +newcursus=New curriculums year=Year reason=Reason : selectedcursus=Selected curriculum : @@ -145,3 +205,6 @@ chcur=Change from a cursus to another iwouldlike=I would like to : newcurr=New curriculum cursusprereq=The cursus you selected has some prerequisites ensure that your external curriculum data is updated in your profile +imposecurriculum=Impose a curriculum +impose=Impose +gotimposed=The selected curriculum has been imposed diff --git a/frontend/public/i18n/FR.txt b/frontend/public/i18n/FR.txt index 4f2d2e4..09d8e13 100644 --- a/frontend/public/i18n/FR.txt +++ b/frontend/public/i18n/FR.txt @@ -29,16 +29,76 @@ app.settings=Options app.messages=Messages app.forum=Forum app.schedules=Horaires +app.manageSchedules=Gérer les horaires app.inscription.requests=Demandes d'Inscription app.manage.courses=Gérer les cours app.language=Langue app.manage.profile=Gérer le profil app.studentList=Liste des étudiants app.users=Utilisateurs -app.payments = Payements +app.manageOwnLessons=Gérer ses horaires de cours +app.lessonRequests=Requêtes d'horaire +app.payments=Payements request.moreInfos=Plus d'Infos request.accept=Accepter request.refuse=Refuser +Pending=En attente +Delete=Supprimer +Modify=Modifier +Create=Créer +requestType=Type de Requête +day=Jour +start=Début +end=Fin +monday=Lundi +tuesday=Mardi +wednesday=Mercredi +thursday=Jeudi +friday=Vendredi +saturday=Samedi +sunday=Dimanche +january=Janvier +february=Février +march=Mars +april=Avril +may=Mai +june=Juin +july=Juillet +august=Août +september=Septembre +october=Octobre +november=Novembre +december=Decembre +Grid=Grille +Week=Semaine +Month=Mois +List=Liste +Type=Type +Teacher=Professeur +Course=Cours +TP=TP +TD=TD +Exam=Exam +OwnSchedule=Mon Horaire +SwitchToJSON=Afficher le JSON +schedule.previous=Précédent +schedule.next=Prochain +schedule.current=Actuel +schedule.settings=Options +schedule.courses=Cours +schedule.teachers=Professeurs(s) +schedule.askChanges=Demander Changement +schedule.askCreate=Demander de créer un cours +schedule.askDeletion=Demander suppression +schedule.createSchedule=Créer Horaire +schedule.createLesson=Créer cours +schedule.deleteMod=Activer suppression +schedule.noDeleteMod=Désactiver suppression +schedule=Horaire +old_day=Ancien Jour +old_start=Ancien Début +old_end=Ancienne Fin +old_type=Ancien Type courses.createCourse=Créer un cours courses.deleteCourse=Supprimer un cours courses.modify=Modifier @@ -145,3 +205,6 @@ chcur=Changer d'un cursus vers un autre iwouldlike=Je voudrais : newcurr=Nouveau cursus cursusprereq=Le cursus que vous avez selectionné a des prérequis assurez vous que votre dossier de parcours est a jour dans votre profil +imposecurriculum=Imposer un cursusgotimposed +impose=Imposer +gotimposed=Le cursus selectionné a été imposé diff --git a/frontend/src/App.vue b/frontend/src/App.vue index dfa5ca9..45bdeb2 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -237,6 +237,7 @@ window.addEventListener('hashchange', () => { .text { right: 0%; width: 0%; + visibility: collapse; opacity: 0; color: white; font-size: 1.2em; @@ -245,7 +246,8 @@ window.addEventListener('hashchange', () => { } ul.vertical:hover .text { - opacity: 1; + opacity:1; + visibility:visible; width: 60%; transition-duration: .3s; padding-left: 15px; diff --git a/frontend/src/Apps/Inscription/AboutChangeCurriculum.vue b/frontend/src/Apps/Inscription/AboutChangeCurriculum.vue index 0f2e21d..588221c 100644 --- a/frontend/src/Apps/Inscription/AboutChangeCurriculum.vue +++ b/frontend/src/Apps/Inscription/AboutChangeCurriculum.vue @@ -1,15 +1,12 @@ diff --git a/frontend/src/Apps/Inscription/AboutScholarship.vue b/frontend/src/Apps/Inscription/AboutScholarship.vue index 45c9e36..920bbea 100644 --- a/frontend/src/Apps/Inscription/AboutScholarship.vue +++ b/frontend/src/Apps/Inscription/AboutScholarship.vue @@ -1,8 +1,7 @@