Compare commits
41 Commits
wal/front/
...
4199663d64
Author | SHA1 | Date | |
---|---|---|---|
4199663d64 | |||
34c0a2bfe8 | |||
706481ed1a | |||
0c04bed799 | |||
9d0b3da9d3 | |||
76c3b76153 | |||
21a5dbdb22 | |||
e6e147af26 | |||
194b14f02b | |||
3c721de18b | |||
5bb7606721
|
|||
b049c46571
|
|||
648b73b585 | |||
7ca5c34afe
|
|||
2b9bdf8dac
|
|||
ccb954e348
|
|||
8442101c40 | |||
bce53305b3 | |||
47e4fb2f8c | |||
4a314449ad | |||
ce56e37a33
|
|||
1c61a356a4
|
|||
2bdffe6ab4
|
|||
a3c9d6a7c0 | |||
729d1ad504
|
|||
1522d74ed3
|
|||
b4499e04c7
|
|||
94f12f0a86 | |||
839ca414ce | |||
eafff6ec2d | |||
914f6bdf36
|
|||
66e7fa24a1
|
|||
7b9f021c24
|
|||
2dfa0a0ee0
|
|||
9e0db361b8 | |||
7a13d412f1 | |||
67fa630ecf | |||
ad0e7b3e35 | |||
9de4b06e75 | |||
123fa97611 | |||
acd1262955
|
@ -16,6 +16,8 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
compileOnly("org.projectlombok:lombok")
|
||||||
|
annotationProcessor("org.projectlombok:lombok")
|
||||||
implementation("org.springframework.boot:spring-boot-starter-jdbc")
|
implementation("org.springframework.boot:spring-boot-starter-jdbc")
|
||||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||||
implementation("org.springframework.boot:spring-boot-starter-mail")
|
implementation("org.springframework.boot:spring-boot-starter-mail")
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package ovh.herisson.Clyde.DTO.Msg;
|
||||||
|
|
||||||
|
/******************************************************
|
||||||
|
* @file DiscussionDTO.java
|
||||||
|
* @author Anthony Debucquoy
|
||||||
|
* @scope Extension messagerie
|
||||||
|
*
|
||||||
|
* File to format a discussion using messageDTO
|
||||||
|
******************************************************/
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import ovh.herisson.Clyde.Tables.User;
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Discussion;
|
||||||
|
import ovh.herisson.Clyde.DTO.Msg.MessagesDTO;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DiscussionDTO {
|
||||||
|
private long id;
|
||||||
|
private String name;
|
||||||
|
private List<User> members;
|
||||||
|
private List<MessagesDTO> msgs;
|
||||||
|
|
||||||
|
public static DiscussionDTO construct(Discussion d, User u){
|
||||||
|
List<MessagesDTO> msgsdto = new ArrayList<>();
|
||||||
|
d.getMsgs().forEach(x -> msgsdto.add(MessagesDTO.construct(x, u)));
|
||||||
|
return new DiscussionDTO(d.getId(), d.getName(), d.getMembers(), msgsdto);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package ovh.herisson.Clyde.DTO.Msg;
|
||||||
|
|
||||||
|
/******************************************************
|
||||||
|
* @file MessagesDTO.java
|
||||||
|
* @author Anthony Debucquoy
|
||||||
|
* @scope Extension messagerie
|
||||||
|
*
|
||||||
|
* File to Format the response adding the sender field
|
||||||
|
******************************************************/
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import ovh.herisson.Clyde.Tables.User;
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Message;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MessagesDTO {
|
||||||
|
private long id;
|
||||||
|
private String content;
|
||||||
|
private User author;
|
||||||
|
private boolean sender;
|
||||||
|
private Date created;
|
||||||
|
//TODO: Attachment
|
||||||
|
|
||||||
|
public static MessagesDTO construct(Message m, User user){
|
||||||
|
boolean sender = false;
|
||||||
|
if(m.getAuthor().equals(user))
|
||||||
|
sender = true;
|
||||||
|
return new MessagesDTO(m.getId(), m.getContent(), m.getAuthor(), sender, m.getCreated());
|
||||||
|
}
|
||||||
|
}
|
@ -135,4 +135,5 @@ public class CourseController {
|
|||||||
courseServ.delete(courseServ.findById(id));
|
courseServ.delete(courseServ.findById(id));
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,13 @@ package ovh.herisson.Clyde.EndPoints;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import ovh.herisson.Clyde.Repositories.ExternalCurriculumRepository;
|
||||||
|
import ovh.herisson.Clyde.Repositories.InscriptionRepository;
|
||||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||||
import ovh.herisson.Clyde.Services.*;
|
import ovh.herisson.Clyde.Services.*;
|
||||||
import ovh.herisson.Clyde.Tables.Curriculum;
|
import ovh.herisson.Clyde.Tables.*;
|
||||||
import ovh.herisson.Clyde.Tables.Role;
|
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@ -21,12 +23,18 @@ public class CurriculumController {
|
|||||||
|
|
||||||
private final UserCurriculumService userCurriculumServ;
|
private final UserCurriculumService userCurriculumServ;
|
||||||
private final CurriculumCourseService curriculumCourseServ;
|
private final CurriculumCourseService curriculumCourseServ;
|
||||||
|
private final InscriptionRepository ir;
|
||||||
|
private final UserService userServ;
|
||||||
|
|
||||||
public CurriculumController(CurriculumService curriculumServ, AuthenticatorService authServ, UserCurriculumService userCurriculumServ, CurriculumCourseService curriculumCourseServ){
|
private final ExternalCurriculumRepository ecr;
|
||||||
|
public CurriculumController(CurriculumService curriculumServ, AuthenticatorService authServ, UserCurriculumService userCurriculumServ, CurriculumCourseService curriculumCourseServ, InscriptionRepository ir, UserService userServ, ExternalCurriculumRepository ecr){
|
||||||
this.curriculumServ = curriculumServ;
|
this.curriculumServ = curriculumServ;
|
||||||
this.authServ = authServ;
|
this.authServ = authServ;
|
||||||
this.userCurriculumServ = userCurriculumServ;
|
this.userCurriculumServ = userCurriculumServ;
|
||||||
this.curriculumCourseServ = curriculumCourseServ;
|
this.curriculumCourseServ = curriculumCourseServ;
|
||||||
|
this.ir = ir;
|
||||||
|
this.userServ = userServ;
|
||||||
|
this.ecr = ecr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/curriculum/{id}")
|
@GetMapping("/curriculum/{id}")
|
||||||
@ -52,6 +60,22 @@ public class CurriculumController {
|
|||||||
return new ResponseEntity<>(curriculumCourseServ.getDepthCurriculum(curriculum),HttpStatus.OK);
|
return new ResponseEntity<>(curriculumCourseServ.getDepthCurriculum(curriculum),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Return the list of all curicullums of an user
|
||||||
|
@GetMapping("/onescurriculum/{userId}")
|
||||||
|
public ResponseEntity<Map<String ,Object>> findOnesCurriculum(@RequestHeader("Authorization") String token, @PathVariable String userId){
|
||||||
|
if (authServ.getUserFromToken(token) == null)
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
|
||||||
|
User u = userServ.getUserById(Long.parseLong(userId));
|
||||||
|
HashMap<String,Object> toReturn = userCurriculumServ.findAllCurriculumByStudent(u);
|
||||||
|
|
||||||
|
if (toReturn == null)
|
||||||
|
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||||
|
|
||||||
|
return new ResponseEntity<>(toReturn,HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/curriculums")
|
@GetMapping("/curriculums")
|
||||||
public ResponseEntity<Iterable<Map<String, Object>>> findAllIndDepth(){
|
public ResponseEntity<Iterable<Map<String, Object>>> findAllIndDepth(){
|
||||||
return new ResponseEntity<>(curriculumCourseServ.getAllDepthCurriculum(),HttpStatus.OK);
|
return new ResponseEntity<>(curriculumCourseServ.getAllDepthCurriculum(),HttpStatus.OK);
|
||||||
@ -94,4 +118,5 @@ public class CurriculumController {
|
|||||||
curriculumServ.delete(toDelete);
|
curriculumServ.delete(toDelete);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
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.Tables.ExternalCurriculum;
|
||||||
|
import ovh.herisson.Clyde.Tables.InscriptionRequest;
|
||||||
|
import ovh.herisson.Clyde.Tables.RequestState;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||||
|
public class ExternalCurriculumController {
|
||||||
|
|
||||||
|
public final ExternalCurriculumRepository ecr;
|
||||||
|
public final InscriptionRepository inscriptionRepository;
|
||||||
|
|
||||||
|
public ExternalCurriculumController(ExternalCurriculumRepository ecr, InscriptionRepository inscriptionRepository) {
|
||||||
|
this.ecr = ecr;
|
||||||
|
this.inscriptionRepository = inscriptionRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
//everyone can post some externalcurriculums (the validity of the elements is assured by the inscription service)
|
||||||
|
@PostMapping("/externalcurriculum")
|
||||||
|
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);
|
||||||
|
|
||||||
|
return new ResponseEntity<>(ecr.save(toSave), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/externalcurriculum/{inscReqId}")
|
||||||
|
public ResponseEntity<ArrayList<ExternalCurriculum>> getExternalCurrListByInscrReq(@PathVariable long inscReqId){
|
||||||
|
InscriptionRequest ir = inscriptionRepository.findById(inscReqId);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package ovh.herisson.Clyde.EndPoints;
|
package ovh.herisson.Clyde.EndPoints;
|
||||||
|
|
||||||
|
import org.apache.tomcat.util.http.parser.Authorization;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -79,4 +80,22 @@ public class InscriptionController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Allow teacher or admin to accept or refuse the equivalence
|
||||||
|
@PatchMapping("/request/registerequiv/{id}/{newstate}")
|
||||||
|
public ResponseEntity<Object> editRegisterEquiv(@RequestHeader("Authorization") String token, @PathVariable long id, @PathVariable RequestState newstate){
|
||||||
|
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher}, token))
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
|
||||||
|
InscriptionRequest toEdit = inscriptionServ.getById(id);
|
||||||
|
toEdit.setEquivalenceState(newstate);
|
||||||
|
|
||||||
|
inscriptionServ.save(toEdit);
|
||||||
|
|
||||||
|
if (toEdit.getState() == RequestState.Accepted && (toEdit.getEquivalenceState() == RequestState.Accepted || toEdit.getEquivalenceState() == RequestState.Unrequired))
|
||||||
|
{
|
||||||
|
inscriptionServ.createUser(toEdit);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,15 @@ import org.springframework.http.HttpHeaders;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
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.Responses.UnauthorizedResponse;
|
||||||
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||||
import ovh.herisson.Clyde.Services.ProtectionService;
|
import ovh.herisson.Clyde.Services.ProtectionService;
|
||||||
|
import ovh.herisson.Clyde.Tables.Curriculum;
|
||||||
import ovh.herisson.Clyde.Tables.InscriptionRequest;
|
import ovh.herisson.Clyde.Tables.InscriptionRequest;
|
||||||
|
import ovh.herisson.Clyde.Tables.RequestState;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -16,7 +21,7 @@ import java.util.Map;
|
|||||||
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||||
public class LoginController {
|
public class LoginController {
|
||||||
private final AuthenticatorService authServ;
|
private final AuthenticatorService authServ;
|
||||||
|
private final CurriculumRepository curriculumRepository;
|
||||||
static public class RequestLogin{
|
static public class RequestLogin{
|
||||||
private final String identifier;
|
private final String identifier;
|
||||||
private final String password;
|
private final String password;
|
||||||
@ -29,8 +34,9 @@ public class LoginController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoginController(AuthenticatorService authServ){
|
public LoginController(AuthenticatorService authServ, CurriculumRepository curriculumRepository){
|
||||||
this.authServ = authServ;
|
this.authServ = authServ;
|
||||||
|
this.curriculumRepository = curriculumRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(value = "/login")
|
@PostMapping(value = "/login")
|
||||||
@ -48,9 +54,18 @@ public class LoginController {
|
|||||||
|
|
||||||
@PostMapping("/register")
|
@PostMapping("/register")
|
||||||
public ResponseEntity<Map<String,Object>> register(@RequestBody InscriptionRequest inscriptionRequest){
|
public ResponseEntity<Map<String,Object>> register(@RequestBody InscriptionRequest inscriptionRequest){
|
||||||
|
//We ensure here that if the targeted cursus year is more than first grade then we need the teacher equivalence approval
|
||||||
|
Curriculum curr = curriculumRepository.findById(inscriptionRequest.getCurriculumId());
|
||||||
|
|
||||||
|
if (curr.getYear() > 1){
|
||||||
|
inscriptionRequest.setEquivalenceState(RequestState.Pending);
|
||||||
|
}else{
|
||||||
|
inscriptionRequest.setEquivalenceState(RequestState.Unrequired);
|
||||||
|
}
|
||||||
|
|
||||||
InscriptionRequest returnedInscriptionRequest = authServ.register(inscriptionRequest);
|
InscriptionRequest returnedInscriptionRequest = authServ.register(inscriptionRequest);
|
||||||
|
|
||||||
|
|
||||||
return new ResponseEntity<>(ProtectionService.requestWithoutPassword(returnedInscriptionRequest), HttpStatus.CREATED);
|
return new ResponseEntity<>(ProtectionService.requestWithoutPassword(returnedInscriptionRequest), HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
package ovh.herisson.Clyde.EndPoints;
|
||||||
|
|
||||||
|
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.Responses.UnauthorizedResponse;
|
||||||
|
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||||
|
import ovh.herisson.Clyde.Tables.Minerval;
|
||||||
|
import ovh.herisson.Clyde.Tables.Role;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||||
|
public class MinervalController {
|
||||||
|
private final AuthenticatorService authServ;
|
||||||
|
private final MinervalRepository mr;
|
||||||
|
|
||||||
|
public MinervalController(AuthenticatorService authServ, MinervalRepository mr) {
|
||||||
|
this.authServ = authServ;
|
||||||
|
this.mr = mr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//A new minerval entry is posted when the inscription service accept a registration request
|
||||||
|
@PostMapping("/minerval/{studentRegNo}")
|
||||||
|
public ResponseEntity<Object> postMinerval(@RequestHeader("Authorization") String token, @PathVariable long studentRegNo){
|
||||||
|
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary,Role.InscriptionService},token))
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
|
||||||
|
Calendar c = new GregorianCalendar();
|
||||||
|
|
||||||
|
mr.save(new Minerval(studentRegNo, 0, 835, c.get(Calendar.YEAR)));
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/minerval/{studentRegNo}")
|
||||||
|
public ResponseEntity<Minerval> getCurrentMinervalbyRegNo(@PathVariable long studentRegNo){
|
||||||
|
ArrayList<Minerval> mlist = mr.getMinervalsByStudentRegNoOrderByYearDesc(studentRegNo);
|
||||||
|
|
||||||
|
//The list is ordered by year in descending order then the index 0 contains the actual minerval (for this year)
|
||||||
|
Minerval m = mlist.get(0);
|
||||||
|
return new ResponseEntity<>(m, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PatchMapping("/minerval")
|
||||||
|
public ResponseEntity<Object> updateMinerval(@RequestBody Minerval updatedMinerval){
|
||||||
|
Minerval minerval = mr.findById(updatedMinerval.getId());
|
||||||
|
|
||||||
|
minerval.setPaidAmount(updatedMinerval.getPaidAmount());
|
||||||
|
minerval.setToPay(updatedMinerval.getToPay());
|
||||||
|
mr.save(minerval);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
@ -2,8 +2,7 @@ package ovh.herisson.Clyde.EndPoints;
|
|||||||
|
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import ovh.herisson.Clyde.Repositories.TokenRepository;
|
import ovh.herisson.Clyde.Repositories.*;
|
||||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
|
||||||
import ovh.herisson.Clyde.Services.*;
|
import ovh.herisson.Clyde.Services.*;
|
||||||
import ovh.herisson.Clyde.Tables.*;
|
import ovh.herisson.Clyde.Tables.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -22,19 +21,28 @@ public class MockController {
|
|||||||
public final CurriculumCourseService CurriculumCourseService;
|
public final CurriculumCourseService CurriculumCourseService;
|
||||||
public final CurriculumService curriculumService;
|
public final CurriculumService curriculumService;
|
||||||
public final CourseService courseService;
|
public final CourseService courseService;
|
||||||
|
public final ExternalCurriculumRepository externalCurriculumRepository;
|
||||||
public final InscriptionService inscriptionService;
|
public final InscriptionService inscriptionService;
|
||||||
ArrayList<User> mockUsers;
|
ArrayList<User> mockUsers;
|
||||||
|
|
||||||
|
public final UserCurriculumRepository ucr;
|
||||||
|
|
||||||
public MockController(UserRepository userRepo, TokenRepository tokenRepo, TokenService tokenService, CurriculumCourseService CurriculumCourseService, CurriculumService curriculumService, CourseService courseService, InscriptionService inscriptionService){
|
public final MinervalRepository minervalRepository;
|
||||||
|
|
||||||
|
public final ScholarshipRequestRepository scholarshipRequestRepository;
|
||||||
|
|
||||||
|
public MockController(UserRepository userRepo, TokenRepository tokenRepo, TokenService tokenService, CurriculumCourseService CurriculumCourseService, CurriculumService curriculumService, CourseService courseService, ExternalCurriculumRepository externalCurriculumRepository, InscriptionService inscriptionService, UserCurriculumRepository ucr, MinervalRepository minervalRepository, ScholarshipRequestRepository scholarshipRequestRepository){
|
||||||
this.tokenRepo = tokenRepo;
|
this.tokenRepo = tokenRepo;
|
||||||
this.userRepo = userRepo;
|
this.userRepo = userRepo;
|
||||||
this.tokenService = tokenService;
|
this.tokenService = tokenService;
|
||||||
this.CurriculumCourseService = CurriculumCourseService;
|
this.CurriculumCourseService = CurriculumCourseService;
|
||||||
this.curriculumService = curriculumService;
|
this.curriculumService = curriculumService;
|
||||||
this.courseService = courseService;
|
this.courseService = courseService;
|
||||||
|
this.externalCurriculumRepository = externalCurriculumRepository;
|
||||||
this.inscriptionService = inscriptionService;
|
this.inscriptionService = inscriptionService;
|
||||||
|
this.ucr = ucr;
|
||||||
|
this.minervalRepository = minervalRepository;
|
||||||
|
this.scholarshipRequestRepository = scholarshipRequestRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Saves an example of each user type by :
|
/** Saves an example of each user type by :
|
||||||
@ -47,28 +55,41 @@ public class MockController {
|
|||||||
public void postMock(){
|
public void postMock(){
|
||||||
|
|
||||||
// user part
|
// user part
|
||||||
|
|
||||||
|
|
||||||
User herobrine = new User("brine","hero","admin@admin.com","behind","ShadowsLand",new Date(0), null,Role.Admin,passwordEncoder.encode("admin"));
|
User herobrine = new User("brine","hero","admin@admin.com","behind","ShadowsLand",new Date(0), null,Role.Admin,passwordEncoder.encode("admin"));
|
||||||
User joe = new User("Mama","Joe","student@student.com","roundabout","England",new Date(0), null,Role.Student,passwordEncoder.encode("student"));
|
User joe = new User("Mama","Joe","student@student.com","roundabout","England",new Date(0), null,Role.Student,passwordEncoder.encode("student"));
|
||||||
User meh = new User("Polo","Marco","secretary@secretary.com","a Box","Monaco",new Date(0), null,Role.Secretary,passwordEncoder.encode("secretary"));
|
User meh = new User("Polo","Marco","secretary@secretary.com","a Box","Monaco",new Date(0), null,Role.Secretary,passwordEncoder.encode("secretary"));
|
||||||
User joke = new User("Gaillard","Corentin","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher"));
|
User joke = new User("Gaillard","Corentin","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher"));
|
||||||
User jojo = new User("Bridoux","Justin","teacher2@teacher2.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher"));
|
User jojo = new User("Bridoux","Justin","teacher2@teacher2.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher"));
|
||||||
User lena = new User("Louille","Lena","inscriptionService@InscriptionService.com","no","yes",new Date(0), null,Role.InscriptionService,passwordEncoder.encode("inscriptionService"));
|
User lena = new User("Louille","Lena","inscriptionService@InscriptionService.com","no","yes",new Date(0), null,Role.InscriptionService,passwordEncoder.encode("inscriptionService"));
|
||||||
mockUsers = new ArrayList<>(Arrays.asList(herobrine,joe,meh,joke,lena,jojo));
|
User popo = new User("Smith", "Paul", "paulsmith@gmail.com", "306 rue du poulet", "belgique", new Date(0), null, Role.Student, passwordEncoder.encode("jesuispaulleroi"));
|
||||||
|
mockUsers = new ArrayList<>(Arrays.asList(herobrine,joe,meh,joke,lena,jojo, popo));
|
||||||
|
|
||||||
userRepo.saveAll(mockUsers);
|
userRepo.saveAll(mockUsers);
|
||||||
|
|
||||||
|
Minerval minerval = new Minerval(joe.getRegNo(), 0, 852, 2023);
|
||||||
|
minervalRepository.save(minerval);
|
||||||
// Course / Curriculum part
|
// Course / Curriculum part
|
||||||
|
|
||||||
Curriculum infoBab1 = new Curriculum(1,"info");
|
Curriculum infoBab1 = new Curriculum(1,"info");
|
||||||
Curriculum chemistryBab1 = new Curriculum(1,"chemistry");
|
Curriculum chemistryBab1 = new Curriculum(1,"chemistry");
|
||||||
Curriculum psychologyBab1 = new Curriculum(1,"psychology");
|
Curriculum psychologyBab1 = new Curriculum(1,"psychology");
|
||||||
|
Curriculum infoBab2 = new Curriculum(2,"info");
|
||||||
|
Curriculum masterinfo1 = new Curriculum(4, "info");
|
||||||
|
Curriculum masterinfo2 = new Curriculum(5, "info");
|
||||||
|
|
||||||
curriculumService.save(infoBab1);
|
curriculumService.save(infoBab1);
|
||||||
curriculumService.save(chemistryBab1);
|
curriculumService.save(chemistryBab1);
|
||||||
curriculumService.save(psychologyBab1);
|
curriculumService.save(psychologyBab1);
|
||||||
|
curriculumService.save(infoBab2);
|
||||||
|
curriculumService.save(masterinfo1);
|
||||||
|
curriculumService.save(masterinfo2);
|
||||||
|
|
||||||
|
ucr.save(new UserCurriculum(joe, infoBab1, 2022));
|
||||||
|
ucr.save(new UserCurriculum(joe, chemistryBab1, 2023));
|
||||||
|
ucr.save(new UserCurriculum(joe, infoBab1, 2023));
|
||||||
|
ucr.save(new UserCurriculum(joe, psychologyBab1, 2020));
|
||||||
|
ucr.save(new UserCurriculum(popo, infoBab1, 2022));
|
||||||
|
ucr.save(new UserCurriculum(popo, infoBab2, 2023));
|
||||||
|
|
||||||
Course progra1 = new Course(5,"Programmation et algorithmique 1",joke);
|
Course progra1 = new Course(5,"Programmation et algorithmique 1",joke);
|
||||||
Course chemistry1 = new Course(12, "Thermochimie",joke);
|
Course chemistry1 = new Course(12, "Thermochimie",joke);
|
||||||
@ -80,10 +101,12 @@ public class MockController {
|
|||||||
courseService.save(psycho1);
|
courseService.save(psycho1);
|
||||||
courseService.save(commun);
|
courseService.save(commun);
|
||||||
|
|
||||||
|
ScholarshipRequest ssr1 = new ScholarshipRequest(joe, RequestState.Pending, 0, new Date(), "test", "test");
|
||||||
|
scholarshipRequestRepository.save(ssr1);
|
||||||
|
|
||||||
CurriculumCourseService.save(new CurriculumCourse(infoBab1,progra1));
|
CurriculumCourseService.save(new CurriculumCourse(infoBab1,progra1));
|
||||||
CurriculumCourseService.save(new CurriculumCourse(infoBab1,commun));
|
CurriculumCourseService.save(new CurriculumCourse(infoBab1,commun));
|
||||||
|
CurriculumCourseService.save(new CurriculumCourse(infoBab1, psycho1));
|
||||||
CurriculumCourseService.save(new CurriculumCourse(psychologyBab1,psycho1));
|
CurriculumCourseService.save(new CurriculumCourse(psychologyBab1,psycho1));
|
||||||
CurriculumCourseService.save(new CurriculumCourse(psychologyBab1,commun));
|
CurriculumCourseService.save(new CurriculumCourse(psychologyBab1,commun));
|
||||||
|
|
||||||
@ -92,10 +115,12 @@ public class MockController {
|
|||||||
CurriculumCourseService.save(new CurriculumCourse(chemistryBab1,chemistry1));
|
CurriculumCourseService.save(new CurriculumCourse(chemistryBab1,chemistry1));
|
||||||
|
|
||||||
|
|
||||||
InscriptionRequest inscriptionRequest = new InscriptionRequest("helen","prenom","non","helen@gmail.com","america",new Date(),(long) 1,RequestState.Pending,"yes.png","password");
|
InscriptionRequest inscriptionRequest = new InscriptionRequest("helen","prenom","non","helen@gmail.com","america",new Date(),(long) 4,RequestState.Pending,"yes.png","password", null, new Date(), RequestState.Pending);
|
||||||
|
|
||||||
inscriptionService.save(inscriptionRequest);
|
inscriptionService.save(inscriptionRequest);
|
||||||
|
|
||||||
|
ExternalCurriculum externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null, RequestState.Pending);
|
||||||
|
externalCurriculumRepository.save(externalCurriculum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,126 @@
|
|||||||
|
package ovh.herisson.Clyde.EndPoints.Msg;
|
||||||
|
|
||||||
|
/******************************************************
|
||||||
|
* @file MessagesController.java
|
||||||
|
* @author Anthony Debucquoy
|
||||||
|
* @scope Extension messagerie
|
||||||
|
*
|
||||||
|
* Entry point for the messages application
|
||||||
|
******************************************************/
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PatchMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import ovh.herisson.Clyde.DTO.Msg.DiscussionDTO;
|
||||||
|
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||||
|
import ovh.herisson.Clyde.Repositories.Msg.DiscussionRepository;
|
||||||
|
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||||
|
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||||
|
import ovh.herisson.Clyde.Services.UserService;
|
||||||
|
import ovh.herisson.Clyde.Services.Msg.DiscussionService;
|
||||||
|
import ovh.herisson.Clyde.Tables.User;
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Discussion;
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Message;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MessagesController {
|
||||||
|
|
||||||
|
private AuthenticatorService authServ;
|
||||||
|
private DiscussionService discServ;
|
||||||
|
private DiscussionRepository discRepo;
|
||||||
|
private UserService userServ;
|
||||||
|
|
||||||
|
@GetMapping("/discussions")
|
||||||
|
public ResponseEntity<Iterable<Discussion>> getDiscussions(@RequestHeader("Authorization") String token ){
|
||||||
|
User user = authServ.getUserFromToken(token);
|
||||||
|
if(user == null){
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
Iterable<Discussion> mock = discServ.getOwned(authServ.getUserFromToken(token));
|
||||||
|
|
||||||
|
return new ResponseEntity<>(mock, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/discussion/{id}")
|
||||||
|
public ResponseEntity<DiscussionDTO> getDiscussion(@RequestHeader("Authorization") String token, @PathVariable long id){
|
||||||
|
User user = authServ.getUserFromToken(token);
|
||||||
|
if(user == null || !discServ.hasDiscussion(user, id) ){
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(DiscussionDTO.construct(discRepo.findById(id).orElse(null), authServ.getUserFromToken(token)), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PatchMapping("/discussion/{id}")
|
||||||
|
public ResponseEntity<Discussion> AlterDiscussion(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody Discussion data){
|
||||||
|
User user = authServ.getUserFromToken(token);
|
||||||
|
if(user == null){
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
Discussion disc = discRepo.findById(id).orElse(null);
|
||||||
|
disc.setName(data.getName());
|
||||||
|
discRepo.save(disc);
|
||||||
|
return new ResponseEntity<>(disc, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PatchMapping("/discussion/{id}/add")
|
||||||
|
public ResponseEntity<Discussion> invite(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody User data){
|
||||||
|
User user = authServ.getUserFromToken(token);
|
||||||
|
if(user == null){
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
Discussion disc = discRepo.findById(id).orElse(null);
|
||||||
|
User invited = userServ.getUserById(data.getRegNo());
|
||||||
|
disc.addMember(invited);
|
||||||
|
discRepo.save(disc);
|
||||||
|
return new ResponseEntity<>(disc, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PatchMapping("/discussion/{id}/remove")
|
||||||
|
public ResponseEntity<Discussion> removeMember(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody User data){
|
||||||
|
User user = authServ.getUserFromToken(token);
|
||||||
|
if(user == null){
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
Discussion disc = discRepo.findById(id).orElse(null);
|
||||||
|
User member = userServ.getUserById(data.getRegNo());
|
||||||
|
disc.delMember(member);
|
||||||
|
discRepo.save(disc);
|
||||||
|
return new ResponseEntity<>(disc, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/discussion/{id}")
|
||||||
|
public ResponseEntity<Discussion> sendMessage(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody Message msg){
|
||||||
|
User user = authServ.getUserFromToken(token);
|
||||||
|
if(user == null){
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
Discussion disc = discRepo.findById(id).orElse(null);
|
||||||
|
msg.setAuthor(user);
|
||||||
|
if(disc != null)
|
||||||
|
discServ.CreateMessage(disc, msg);
|
||||||
|
return new ResponseEntity<>(disc, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/discussion")
|
||||||
|
public ResponseEntity<Discussion> createDiscussion(@RequestHeader("Authorization") String token, @RequestBody Discussion data){
|
||||||
|
return new ResponseEntity<>(discServ.create(data.getName(), authServ.getUserFromToken(token)), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
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.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 java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||||
|
public class PaymentController {
|
||||||
|
|
||||||
|
private final PaymentRepository paymentRepository;
|
||||||
|
|
||||||
|
public PaymentController(PaymentRepository paymentRepository){
|
||||||
|
this.paymentRepository = paymentRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Post a payment record
|
||||||
|
@PostMapping("/payment")
|
||||||
|
public ResponseEntity<Object> postPayment(@RequestBody Payment payment){
|
||||||
|
paymentRepository.save(payment);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Get all payment records of a student
|
||||||
|
@GetMapping("/payment/{studentRegNo}")
|
||||||
|
public ResponseEntity<ArrayList<Payment>> getPaymentsByUser(@PathVariable long studentRegNo){
|
||||||
|
ArrayList<Payment> toReturn = paymentRepository.getPaymentsByStudentRegNo(studentRegNo);
|
||||||
|
return new ResponseEntity<>(toReturn, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
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.CourseRepository;
|
||||||
|
import ovh.herisson.Clyde.Repositories.ExemptionsRequestRepository;
|
||||||
|
import ovh.herisson.Clyde.Repositories.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 java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
|
||||||
|
public class RequestsController {
|
||||||
|
|
||||||
|
public final ExemptionsRequestRepository err;
|
||||||
|
public final ScholarshipRequestRepository srr;
|
||||||
|
public final UserRepository userRepository;
|
||||||
|
public final AuthenticatorService authServ;
|
||||||
|
|
||||||
|
public final CourseRepository courseRepository;
|
||||||
|
|
||||||
|
public RequestsController(ExemptionsRequestRepository err, ScholarshipRequestRepository srr, UserRepository userRepository, AuthenticatorService authServ, CourseRepository courseRepository) {
|
||||||
|
this.err = err;
|
||||||
|
this.srr = srr;
|
||||||
|
this.userRepository = userRepository;
|
||||||
|
this.authServ = authServ;
|
||||||
|
this.courseRepository = courseRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value="/exemptionreq")
|
||||||
|
public ResponseEntity<String> createExemptionReq(@RequestBody Map<String, Object> exemptionsRequestInfo){
|
||||||
|
User user = userRepository.findById((Integer) exemptionsRequestInfo.get("userRegNo"));
|
||||||
|
Course course = courseRepository.findById((Integer) exemptionsRequestInfo.get("courseId"));
|
||||||
|
|
||||||
|
ExemptionsRequest exemptionsRequest = new ExemptionsRequest(user, course, (String) exemptionsRequestInfo.get("justifDocument"), RequestState.Pending, new Date());
|
||||||
|
|
||||||
|
err.save(exemptionsRequest);
|
||||||
|
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value="/scholarshipreq")
|
||||||
|
public ResponseEntity<String> createScholarshipReq(@RequestBody Map<String, Object> scholarshipRequestInfo){
|
||||||
|
User user = userRepository.findById((Integer)scholarshipRequestInfo.get("userId"));
|
||||||
|
ScholarshipRequest toCreate = new ScholarshipRequest(user, RequestState.Pending, 0, new Date(), (String) scholarshipRequestInfo.get("taxDocUrl"), (String) scholarshipRequestInfo.get("residencyDocUrl"));
|
||||||
|
|
||||||
|
srr.save(toCreate);
|
||||||
|
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Get all the exemptions Request
|
||||||
|
@GetMapping(value = "/exemptionsreq")
|
||||||
|
public ResponseEntity<ArrayList<ExemptionsRequest>> getAllExemptionsRequests(@RequestHeader("Authorization") String token){
|
||||||
|
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary,Role.InscriptionService},token))
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
|
||||||
|
ArrayList<ExemptionsRequest> toReturn = new ArrayList<>();
|
||||||
|
|
||||||
|
err.findAll().forEach(toReturn::add);
|
||||||
|
|
||||||
|
return new ResponseEntity<>(toReturn, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Get all the scholarships requests
|
||||||
|
@GetMapping(value = "/scholarshipreq")
|
||||||
|
public ResponseEntity<ArrayList<ScholarshipRequest>> getAllScholarshipRequests(@RequestHeader("Authorization") String token){
|
||||||
|
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary,Role.InscriptionService},token))
|
||||||
|
return new UnauthorizedResponse<>(null);
|
||||||
|
|
||||||
|
ArrayList<ScholarshipRequest> toReturn = new ArrayList<>();
|
||||||
|
|
||||||
|
srr.findAll().forEach(toReturn::add);
|
||||||
|
|
||||||
|
return new ResponseEntity<>(toReturn, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package ovh.herisson.Clyde.Repositories;
|
||||||
|
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import ovh.herisson.Clyde.Tables.ExemptionsRequest;
|
||||||
|
|
||||||
|
public interface ExemptionsRequestRepository extends CrudRepository<ExemptionsRequest, Long> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package ovh.herisson.Clyde.Repositories;
|
||||||
|
|
||||||
|
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 java.util.ArrayList;
|
||||||
|
|
||||||
|
public interface ExternalCurriculumRepository extends CrudRepository<ExternalCurriculum, Long> {
|
||||||
|
ArrayList<ExternalCurriculum> getExternalCurriculumByInscriptionRequest(InscriptionRequest ir);
|
||||||
|
|
||||||
|
ExternalCurriculum getExternalCurriculumById(long id);
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package ovh.herisson.Clyde.Repositories;
|
||||||
|
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import ovh.herisson.Clyde.Tables.Minerval;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public interface MinervalRepository extends CrudRepository<Minerval, Long> {
|
||||||
|
public ArrayList<Minerval> getMinervalsByStudentRegNoOrderByYearDesc(Long studentRegNo);
|
||||||
|
|
||||||
|
public Minerval findById(long id);
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package ovh.herisson.Clyde.Repositories.Msg;
|
||||||
|
|
||||||
|
/******************************************************
|
||||||
|
* @file DiscussionRepository.java
|
||||||
|
* @author Anthony Debucquoy
|
||||||
|
* @scope Extension messagerie
|
||||||
|
*
|
||||||
|
* Repository of Discussion allowing to fetch discussion by user
|
||||||
|
******************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Discussion;
|
||||||
|
|
||||||
|
public interface DiscussionRepository extends CrudRepository<Discussion, Long>{
|
||||||
|
|
||||||
|
@Query("SELECT d FROM Discussion d INNER JOIN FETCH d.members dm WHERE dm.id = ?1")
|
||||||
|
List<Discussion> findByMembership(long userid);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package ovh.herisson.Clyde.Repositories.Msg;
|
||||||
|
|
||||||
|
/******************************************************
|
||||||
|
* @file MessageRepository.java
|
||||||
|
* @author Anthony Debucquoy
|
||||||
|
* @scope Extension messagerie
|
||||||
|
******************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Message;
|
||||||
|
|
||||||
|
public interface MessageRepository extends CrudRepository<Message, Long> {}
|
@ -0,0 +1,10 @@
|
|||||||
|
package ovh.herisson.Clyde.Repositories;
|
||||||
|
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import ovh.herisson.Clyde.Tables.Payment;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public interface PaymentRepository extends CrudRepository<Payment, Long> {
|
||||||
|
public ArrayList<Payment> getPaymentsByStudentRegNo(long regNo);
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package ovh.herisson.Clyde.Repositories;
|
||||||
|
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import ovh.herisson.Clyde.Tables.ScholarshipRequest;
|
||||||
|
|
||||||
|
public interface ScholarshipRequestRepository extends CrudRepository<ScholarshipRequest, Long> {
|
||||||
|
|
||||||
|
}
|
@ -6,8 +6,12 @@ import ovh.herisson.Clyde.Tables.Curriculum;
|
|||||||
import ovh.herisson.Clyde.Tables.User;
|
import ovh.herisson.Clyde.Tables.User;
|
||||||
import ovh.herisson.Clyde.Tables.UserCurriculum;
|
import ovh.herisson.Clyde.Tables.UserCurriculum;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public interface UserCurriculumRepository extends CrudRepository<UserCurriculum, Long> {
|
public interface UserCurriculumRepository extends CrudRepository<UserCurriculum, Long> {
|
||||||
|
|
||||||
@Query("select uc.curriculum from UserCurriculum uc where uc.user = ?1")
|
@Query("select uc.curriculum from UserCurriculum uc where uc.user = ?1")
|
||||||
Curriculum findByUser(User student);
|
Curriculum findByUser(User student);
|
||||||
|
|
||||||
|
ArrayList<UserCurriculum> findByUserOrderByCurriculum(User student);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ public class CurriculumService {
|
|||||||
public Curriculum findById(long id){
|
public Curriculum findById(long id){
|
||||||
return curriculumRepo.findById(id);
|
return curriculumRepo.findById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(Curriculum curriculum) {
|
public void delete(Curriculum curriculum) {
|
||||||
curriculumRepo.delete(curriculum);
|
curriculumRepo.delete(curriculum);
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,8 @@ package ovh.herisson.Clyde.Services;
|
|||||||
|
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
|
import ovh.herisson.Clyde.Repositories.*;
|
||||||
import ovh.herisson.Clyde.Repositories.InscriptionRepository;
|
import ovh.herisson.Clyde.Tables.*;
|
||||||
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
|
|
||||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
|
||||||
import ovh.herisson.Clyde.Tables.InscriptionRequest;
|
|
||||||
import ovh.herisson.Clyde.Tables.RequestState;
|
|
||||||
import ovh.herisson.Clyde.Tables.User;
|
|
||||||
import ovh.herisson.Clyde.Tables.UserCurriculum;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class InscriptionService {
|
public class InscriptionService {
|
||||||
@ -22,14 +16,16 @@ public class InscriptionService {
|
|||||||
|
|
||||||
private final CurriculumRepository curriculumRepo;
|
private final CurriculumRepository curriculumRepo;
|
||||||
|
|
||||||
|
private final MinervalRepository minervalRepository;
|
||||||
private final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
private final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||||
|
|
||||||
|
|
||||||
public InscriptionService(InscriptionRepository inscriptionRepo, UserRepository userRepo, UserCurriculumRepository userCurriculumRepo, CurriculumRepository curriculumRepo){
|
public InscriptionService(InscriptionRepository inscriptionRepo, UserRepository userRepo, UserCurriculumRepository userCurriculumRepo, CurriculumRepository curriculumRepo, MinervalRepository minervalRepository){
|
||||||
this.inscriptionRepo = inscriptionRepo;
|
this.inscriptionRepo = inscriptionRepo;
|
||||||
this.userRepo = userRepo;
|
this.userRepo = userRepo;
|
||||||
this.userCurriculumRepo = userCurriculumRepo;
|
this.userCurriculumRepo = userCurriculumRepo;
|
||||||
this.curriculumRepo = curriculumRepo;
|
this.curriculumRepo = curriculumRepo;
|
||||||
|
this.minervalRepository = minervalRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InscriptionRequest save(InscriptionRequest inscriptionRequest){
|
public InscriptionRequest save(InscriptionRequest inscriptionRequest){
|
||||||
@ -51,21 +47,20 @@ public class InscriptionService {
|
|||||||
if (inscrRequest == null)
|
if (inscrRequest == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// if th state is the same we don't send an email
|
inscrRequest.setState(requestState);
|
||||||
if (requestState == inscrRequest.getState())
|
save(inscrRequest);
|
||||||
return false;
|
|
||||||
|
|
||||||
/** todo send an email to tell the poster of the inscrRequest (inscrRequest.getEmail())
|
//saves the user from the request if accepted from teacher and inscription services
|
||||||
* to notify them that the state of their request changed
|
if (requestState == RequestState.Accepted && (inscrRequest.getEquivalenceState() == RequestState.Accepted || inscrRequest.getEquivalenceState() == RequestState.Unrequired))
|
||||||
* FooEmailFormat toSend = (String.format("Your request state changed from %s to %s"),
|
|
||||||
* inscrRequest.getState(), requestState)
|
|
||||||
* FooEmailSender.send(toSend, inscrRequest.getEmail())
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
//saves the user from the request if accepted
|
|
||||||
if (requestState == RequestState.Accepted)
|
|
||||||
{
|
{
|
||||||
|
return createUser(inscrRequest);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean createUser(InscriptionRequest inscrRequest){
|
||||||
|
//We must send an email here
|
||||||
|
|
||||||
if (curriculumRepo.findById(inscrRequest.getCurriculumId()) == null)
|
if (curriculumRepo.findById(inscrRequest.getCurriculumId()) == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -81,13 +76,14 @@ public class InscriptionService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
userRepo.save(userFromRequest);
|
userRepo.save(userFromRequest);
|
||||||
userCurriculumRepo.save(new UserCurriculum(userFromRequest, curriculumRepo.findById(inscrRequest.getCurriculumId())));
|
userCurriculumRepo.save(new UserCurriculum(userFromRequest, curriculumRepo.findById(inscrRequest.getCurriculumId()),0));
|
||||||
}
|
|
||||||
inscrRequest.setState(requestState);
|
//Create a minerval for the new student
|
||||||
save(inscrRequest);
|
Minerval minerval = new Minerval(userFromRequest.getRegNo(), 0, 852, 2023);
|
||||||
|
minervalRepository.save(minerval);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(InscriptionRequest toDelete) {
|
public void delete(InscriptionRequest toDelete) {
|
||||||
inscriptionRepo.delete(toDelete);
|
inscriptionRepo.delete(toDelete);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,57 @@
|
|||||||
|
package ovh.herisson.Clyde.Services.Msg;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/******************************************************
|
||||||
|
* @file DiscussionService.java
|
||||||
|
* @author Anthony Debucquoy
|
||||||
|
* @scope Extension messagerie
|
||||||
|
*
|
||||||
|
* Various function utilised by the messages application
|
||||||
|
******************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.util.JSONPObject;
|
||||||
|
|
||||||
|
import ovh.herisson.Clyde.Repositories.Msg.DiscussionRepository;
|
||||||
|
import ovh.herisson.Clyde.Tables.User;
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Discussion;
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Message;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DiscussionService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DiscussionRepository discRepo;
|
||||||
|
|
||||||
|
public Discussion create(String name, User author){
|
||||||
|
return discRepo.save(new Discussion(name, author));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* list discussions owned by a certain user
|
||||||
|
*/
|
||||||
|
public Iterable<Discussion> getOwned(User author){
|
||||||
|
return discRepo.findByMembership(author.getRegNo());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a message and link it to it's discussion
|
||||||
|
*/
|
||||||
|
public Discussion CreateMessage(Discussion disc, Message msg){
|
||||||
|
disc.addMessage(msg);
|
||||||
|
return discRepo.save(disc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a user is in a discussion
|
||||||
|
*/
|
||||||
|
public boolean hasDiscussion(User user, long id) {
|
||||||
|
Discussion disc = discRepo.findById(id).orElse(null);
|
||||||
|
List<User> members = disc.getMembers();
|
||||||
|
return members.contains(user);
|
||||||
|
}
|
||||||
|
}
|
@ -87,7 +87,9 @@ public class ProtectionService {
|
|||||||
toReturn.put("curriculum", inscriptionRequest.getCurriculumId());
|
toReturn.put("curriculum", inscriptionRequest.getCurriculumId());
|
||||||
toReturn.put("state", inscriptionRequest.getState());
|
toReturn.put("state", inscriptionRequest.getState());
|
||||||
toReturn.put("profilePictureUrl", inscriptionRequest.getProfilePicture());
|
toReturn.put("profilePictureUrl", inscriptionRequest.getProfilePicture());
|
||||||
|
toReturn.put("identityCard", inscriptionRequest.getIdentityCard());
|
||||||
|
toReturn.put("submissionDate", inscriptionRequest.getSubmissionDate());
|
||||||
|
toReturn.put("equivalenceState", inscriptionRequest.getEquivalenceState());
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,20 +1,52 @@
|
|||||||
package ovh.herisson.Clyde.Services;
|
package ovh.herisson.Clyde.Services;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
|
||||||
|
import ovh.herisson.Clyde.Repositories.ExternalCurriculumRepository;
|
||||||
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
|
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
|
||||||
import ovh.herisson.Clyde.Tables.Curriculum;
|
import ovh.herisson.Clyde.Tables.*;
|
||||||
import ovh.herisson.Clyde.Tables.User;
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class UserCurriculumService {
|
public class UserCurriculumService {
|
||||||
|
|
||||||
private final UserCurriculumRepository userCurriculumRepository;
|
private final UserCurriculumRepository userCurriculumRepository;
|
||||||
|
private final CurriculumRepository curriculumRepo;
|
||||||
|
|
||||||
public UserCurriculumService(UserCurriculumRepository userCurriculumRepository) {
|
private final ExternalCurriculumRepository externalCurriculumRepo;
|
||||||
|
public UserCurriculumService(UserCurriculumRepository userCurriculumRepository, CurriculumRepository curriculumRepo, ExternalCurriculumRepository externalCurriculumRepo) {
|
||||||
this.userCurriculumRepository = userCurriculumRepository;
|
this.userCurriculumRepository = userCurriculumRepository;
|
||||||
|
this.curriculumRepo = curriculumRepo;
|
||||||
|
this.externalCurriculumRepo = externalCurriculumRepo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Curriculum findByUser(User student){
|
public Curriculum findByUser(User student){
|
||||||
return userCurriculumRepository.findByUser(student);
|
return userCurriculumRepository.findByUser(student);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashMap<String,Object> findAllCurriculumByStudent(User student) {
|
||||||
|
ArrayList<UserCurriculum> list = userCurriculumRepository.findByUserOrderByCurriculum(student);
|
||||||
|
|
||||||
|
ArrayList<HashMap<String, Object>> curriculumlist = new ArrayList<HashMap<String, Object>>();
|
||||||
|
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
HashMap<String, Object> element = new HashMap<>();
|
||||||
|
Curriculum c = list.get(i).getCurriculum();
|
||||||
|
|
||||||
|
|
||||||
|
element.put("curriculumId", c.getCurriculumId());
|
||||||
|
element.put("year", c.getYear());
|
||||||
|
element.put("option", c.getOption());
|
||||||
|
element.put("dateyear", list.get(i).getYear());
|
||||||
|
curriculumlist.add(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, Object> toReturn = new HashMap<String, Object>();
|
||||||
|
toReturn.put("curriculumList", curriculumlist);
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,80 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import org.hibernate.annotations.OnDelete;
|
||||||
|
import org.hibernate.annotations.OnDeleteAction;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class ExemptionsRequest {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
@JoinColumn(name = "Users")
|
||||||
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
|
private User user;
|
||||||
|
|
||||||
|
@JoinColumn(name = "Course")
|
||||||
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
|
private Course course;
|
||||||
|
private String justifDocument;
|
||||||
|
|
||||||
|
private RequestState state;
|
||||||
|
|
||||||
|
private Date date;
|
||||||
|
|
||||||
|
public ExemptionsRequest(User user, Course course, String justifDocument, RequestState state, Date date){
|
||||||
|
this.user = user;
|
||||||
|
this.course = course;
|
||||||
|
this.justifDocument = justifDocument;
|
||||||
|
this.state = state;
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ExemptionsRequest(){}
|
||||||
|
|
||||||
|
public User getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(User user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Course getCourse() {
|
||||||
|
return course;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourse(Course course) {
|
||||||
|
this.course = course;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJustifDocument() {
|
||||||
|
return justifDocument;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJustifDocument(String justifDocument) {
|
||||||
|
this.justifDocument = justifDocument;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public RequestState getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(RequestState state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDate() {
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate(Date date) {
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,111 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
//This table stores a student's curriculum from another university
|
||||||
|
@Entity
|
||||||
|
public class ExternalCurriculum {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
|
@JoinColumn(name="InscriptionRequest")
|
||||||
|
private InscriptionRequest inscriptionRequest;
|
||||||
|
|
||||||
|
private String school;
|
||||||
|
|
||||||
|
private String formation;
|
||||||
|
|
||||||
|
//This string denotes the completion of the external formation or the last year completed by the student in this formation
|
||||||
|
private String completion;
|
||||||
|
|
||||||
|
private int startYear;
|
||||||
|
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){
|
||||||
|
this.inscriptionRequest = ir;
|
||||||
|
this.school = school;
|
||||||
|
this.formation = formation;
|
||||||
|
this.completion = completion;
|
||||||
|
this.startYear = startYear;
|
||||||
|
this.endYear = endYear;
|
||||||
|
this.justifdocUrl = justifdocUrl;
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InscriptionRequest getInscriptionRequest() {
|
||||||
|
return inscriptionRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInscriptionRequest(InscriptionRequest inscriptionRequest) {
|
||||||
|
this.inscriptionRequest = inscriptionRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSchool() {
|
||||||
|
return school;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSchool(String school) {
|
||||||
|
this.school = school;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFormation() {
|
||||||
|
return formation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormation(String formation) {
|
||||||
|
this.formation = formation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCompletion(){
|
||||||
|
return completion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompletion(String completion) {
|
||||||
|
this.completion = completion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStartYear() {
|
||||||
|
return startYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartYear(int startYear) {
|
||||||
|
this.startYear = startYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getEndYear() {
|
||||||
|
return endYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndYear(int endYear) {
|
||||||
|
this.endYear = endYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJustifdocUrl(String justifdocUrl) {
|
||||||
|
this.justifdocUrl = justifdocUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJustifdocUrl() {
|
||||||
|
return justifdocUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RequestState getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(RequestState state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,7 @@
|
|||||||
package ovh.herisson.Clyde.Tables;
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
public enum FileType {
|
public enum FileType {
|
||||||
|
|
||||||
ProfilePicture,
|
ProfilePicture,
|
||||||
|
EducationCertificate,
|
||||||
EducationCertificate
|
JustificationDocument
|
||||||
}
|
}
|
||||||
|
@ -15,14 +15,16 @@ public class InscriptionRequest {
|
|||||||
private String email;
|
private String email;
|
||||||
private String country;
|
private String country;
|
||||||
private Date birthDate;
|
private Date birthDate;
|
||||||
|
|
||||||
private Long curriculumId;
|
private Long curriculumId;
|
||||||
private RequestState state;
|
private RequestState state;
|
||||||
private String profilePicture;
|
private String profilePicture;
|
||||||
|
|
||||||
private String password;
|
private String password;
|
||||||
|
private String identityCard;
|
||||||
|
private Date submissionDate;
|
||||||
|
private RequestState equivalenceState;
|
||||||
public InscriptionRequest(){}
|
public InscriptionRequest(){}
|
||||||
public InscriptionRequest(String lastName, String firstName, String address, String email, String country, Date birthDate,Long curriculumId, RequestState state, String profilePicture, String password){
|
|
||||||
|
public InscriptionRequest(String lastName, String firstName, String address, String email, String country, Date birthDate,Long curriculumId, RequestState state, String profilePicture, String password, String identityCard, Date submissionDate, RequestState equivalenceState){
|
||||||
this.lastName = lastName;
|
this.lastName = lastName;
|
||||||
this.firstName = firstName;
|
this.firstName = firstName;
|
||||||
this.address = address;
|
this.address = address;
|
||||||
@ -33,6 +35,9 @@ public class InscriptionRequest {
|
|||||||
this.state = state;
|
this.state = state;
|
||||||
this.profilePicture = profilePicture;
|
this.profilePicture = profilePicture;
|
||||||
this.password = password;
|
this.password = password;
|
||||||
|
this.identityCard = identityCard;
|
||||||
|
this.submissionDate = submissionDate;
|
||||||
|
this.equivalenceState = equivalenceState;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
@ -118,4 +123,28 @@ public class InscriptionRequest {
|
|||||||
public void setPassword(String password) {
|
public void setPassword(String password) {
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIdentityCard() {
|
||||||
|
return identityCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdentityCard(String identityCard) {
|
||||||
|
this.identityCard = identityCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getSubmissionDate() {
|
||||||
|
return submissionDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmissionDate(Date submissionDate) {
|
||||||
|
this.submissionDate = submissionDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RequestState getEquivalenceState() {
|
||||||
|
return equivalenceState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEquivalenceState(RequestState equivalenceState) {
|
||||||
|
this.equivalenceState = equivalenceState;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Minerval {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
private long studentRegNo;
|
||||||
|
private int paidAmount;
|
||||||
|
private int toPay;
|
||||||
|
|
||||||
|
//If the academic year is 2023-2024 then 2023 will be stored here (we take the lowest year)
|
||||||
|
private int year;
|
||||||
|
public Minerval(){}
|
||||||
|
|
||||||
|
public Minerval(long studentRegNo, int paidAmount, int toPay, int year){
|
||||||
|
this.studentRegNo = studentRegNo;
|
||||||
|
this.paidAmount = paidAmount;
|
||||||
|
this.toPay = toPay;
|
||||||
|
this.year = year;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getStudentRegNo() {
|
||||||
|
return studentRegNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStudentRegNo(long studentRegNo) {
|
||||||
|
this.studentRegNo = studentRegNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPaidAmount() {
|
||||||
|
return paidAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaidAmount(int paidAmount) {
|
||||||
|
this.paidAmount = paidAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getToPay() {
|
||||||
|
return toPay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToPay(int toPay) {
|
||||||
|
this.toPay = toPay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getYear() {
|
||||||
|
return year;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYear(int year) {
|
||||||
|
this.year = year;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables.Msg;
|
||||||
|
|
||||||
|
/******************************************************
|
||||||
|
* @file Discussion.java
|
||||||
|
* @author Anthony Debucquoy
|
||||||
|
* @scope Extension messagerie
|
||||||
|
*
|
||||||
|
* Discussion allow to regroupe multiple user in and message together
|
||||||
|
* for the messages application to work
|
||||||
|
******************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import jakarta.persistence.CascadeType;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.JoinTable;
|
||||||
|
import jakarta.persistence.ManyToMany;
|
||||||
|
import jakarta.persistence.OneToMany;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import ovh.herisson.Clyde.Tables.User;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class Discussion{
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private long id;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(
|
||||||
|
name = "discussion_members",
|
||||||
|
joinColumns = @JoinColumn(name = "discussion_id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "user_id")
|
||||||
|
)
|
||||||
|
private List<User> members;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy="discussion", orphanRemoval = true, cascade = CascadeType.ALL)
|
||||||
|
private List<Message> msgs;
|
||||||
|
|
||||||
|
public Discussion(String name){
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Discussion(String name, User user){
|
||||||
|
this.name = name;
|
||||||
|
this.members = List.of(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addMessage(Message msg){
|
||||||
|
msg.setDiscussion(this);
|
||||||
|
msgs.add(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addMember(User user) {
|
||||||
|
members.add(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void delMember(User user) {
|
||||||
|
members.remove(user);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables.Msg;
|
||||||
|
|
||||||
|
/******************************************************
|
||||||
|
* @file Message.java
|
||||||
|
* @author Anthony Debucquoy
|
||||||
|
* @scope Extension messagerie
|
||||||
|
*
|
||||||
|
* Represent a message sent to a discussion
|
||||||
|
******************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
import org.hibernate.annotations.CreationTimestamp;
|
||||||
|
import org.hibernate.annotations.UpdateTimestamp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import jakarta.persistence.CascadeType;
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import jakarta.persistence.OneToMany;
|
||||||
|
import jakarta.persistence.OneToOne;
|
||||||
|
import jakarta.persistence.PrePersist;
|
||||||
|
import jakarta.persistence.Temporal;
|
||||||
|
import jakarta.persistence.TemporalType;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import ovh.herisson.Clyde.Tables.User;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Entity
|
||||||
|
public class Message {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private long id;
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@CreationTimestamp
|
||||||
|
@Column(nullable = false)
|
||||||
|
private Date created;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
private User author;
|
||||||
|
|
||||||
|
public User getAuthor() {
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
|
@OneToOne
|
||||||
|
private Message response;
|
||||||
|
|
||||||
|
@ManyToOne(optional = false)
|
||||||
|
@JsonIgnore
|
||||||
|
private Discussion discussion;
|
||||||
|
|
||||||
|
}
|
84
backend/src/main/java/ovh/herisson/Clyde/Tables/Payment.java
Normal file
84
backend/src/main/java/ovh/herisson/Clyde/Tables/Payment.java
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Payment {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
private long studentRegNo;
|
||||||
|
private String card;
|
||||||
|
private String client;
|
||||||
|
private Date expDate;
|
||||||
|
private int amount;
|
||||||
|
private Date date;
|
||||||
|
public Payment(){}
|
||||||
|
|
||||||
|
public Payment(long studentRegNo, String card, String client, Date expDate, int amount, Date date){
|
||||||
|
this.studentRegNo = studentRegNo;
|
||||||
|
this.card = card;
|
||||||
|
this.client = client;
|
||||||
|
this.expDate = expDate;
|
||||||
|
this.amount = amount;
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getStudentRegNo() {
|
||||||
|
return studentRegNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStudentRegNo(long studentRegNo) {
|
||||||
|
this.studentRegNo = studentRegNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCard() {
|
||||||
|
return card;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCard(String card) {
|
||||||
|
this.card = card;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClient() {
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClient(String client) {
|
||||||
|
this.client = client;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getExpDate() {
|
||||||
|
return expDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpDate(Date expDate) {
|
||||||
|
this.expDate = expDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmount(int amount) {
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDate() {
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate(Date date) {
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
}
|
@ -3,5 +3,6 @@ package ovh.herisson.Clyde.Tables;
|
|||||||
public enum RequestState {
|
public enum RequestState {
|
||||||
Accepted,
|
Accepted,
|
||||||
Refused,
|
Refused,
|
||||||
Pending
|
Pending,
|
||||||
|
Unrequired
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,86 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import org.hibernate.annotations.OnDelete;
|
||||||
|
import org.hibernate.annotations.OnDeleteAction;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class ScholarshipRequest {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
@JoinColumn(name="Users")
|
||||||
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
|
private User user;
|
||||||
|
private RequestState state;
|
||||||
|
private Date date;
|
||||||
|
private int amount;
|
||||||
|
private String taxDocUrl;
|
||||||
|
private String residencyDocUrl;
|
||||||
|
|
||||||
|
public ScholarshipRequest(User user, RequestState state, int amount, Date date, String taxDocUrl, String residencyDocUrl){
|
||||||
|
this.user = user;
|
||||||
|
this.state = state;
|
||||||
|
this.amount = amount;
|
||||||
|
this.date = date;
|
||||||
|
this.taxDocUrl = taxDocUrl;
|
||||||
|
this.residencyDocUrl = residencyDocUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScholarshipRequest(){}
|
||||||
|
|
||||||
|
public User getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(User user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RequestState getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(RequestState state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmount(int amount) {
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDate() {
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate(Date date) {
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResidencyDocUrl() {
|
||||||
|
return residencyDocUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResidencyDocUrl(String residencyDocUrl) {
|
||||||
|
this.residencyDocUrl = residencyDocUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaxDocUrl() {
|
||||||
|
return taxDocUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaxDocUrl(String taxDocUrl) {
|
||||||
|
this.taxDocUrl = taxDocUrl;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class UninscriptionRequest {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int id;
|
||||||
|
private RequestState state;
|
||||||
|
|
||||||
|
public UninscriptionRequest(RequestState state){
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UninscriptionRequest(){}
|
||||||
|
|
||||||
|
public RequestState getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(RequestState state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,11 @@
|
|||||||
package ovh.herisson.Clyde.Tables;
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Discussion;
|
||||||
|
import ovh.herisson.Clyde.Tables.Msg.Message;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@ -20,6 +24,15 @@ public class User {
|
|||||||
private String profilePictureUrl;
|
private String profilePictureUrl;
|
||||||
private ovh.herisson.Clyde.Tables.Role role;
|
private ovh.herisson.Clyde.Tables.Role role;
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
////// Extension Messagerie /////
|
||||||
|
@OneToMany(mappedBy = "author", cascade = CascadeType.ALL)
|
||||||
|
private List<Message> msgs;
|
||||||
|
/////////////////////////////////
|
||||||
|
|
||||||
|
@ManyToMany( mappedBy = "members" )
|
||||||
|
private List<Discussion> discussions;
|
||||||
|
|
||||||
public User(String lastName, String firstName, String email, String address,
|
public User(String lastName, String firstName, String email, String address,
|
||||||
String country, Date birthDate, String profilePictureUrl, Role role, String password)
|
String country, Date birthDate, String profilePictureUrl, Role role, String password)
|
||||||
{
|
{
|
||||||
|
@ -21,9 +21,12 @@ public class UserCurriculum {
|
|||||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||||
private Curriculum curriculum;
|
private Curriculum curriculum;
|
||||||
|
|
||||||
public UserCurriculum(User user, Curriculum curriculum){
|
private int year;
|
||||||
|
|
||||||
|
public UserCurriculum(User user, Curriculum curriculum, int year){
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.curriculum = curriculum;
|
this.curriculum = curriculum;
|
||||||
|
this.year = year;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserCurriculum() {}
|
public UserCurriculum() {}
|
||||||
@ -47,4 +50,12 @@ public class UserCurriculum {
|
|||||||
public void setCurriculum(Curriculum curriculum) {
|
public void setCurriculum(Curriculum curriculum) {
|
||||||
this.curriculum = curriculum;
|
this.curriculum = curriculum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getYear() {
|
||||||
|
return year;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYear(int year) {
|
||||||
|
this.year = year;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,6 @@ window.addEventListener('hashchange', () => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<Suspense>
|
<Suspense>
|
||||||
|
|
||||||
<component :is="currentView" />
|
<component :is="currentView" />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
@ -97,6 +96,8 @@ window.addEventListener('hashchange', () => {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
.container{
|
.container{
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
display:grid;
|
display:grid;
|
||||||
grid-template-columns:[firstCol-start]70px[firstCol-end secondCol-start]auto[endCol];
|
grid-template-columns:[firstCol-start]70px[firstCol-end secondCol-start]auto[endCol];
|
||||||
grid-template-rows:[firstRow-start]61px[firstRow-end secondRow-start] auto [endRow];
|
grid-template-rows:[firstRow-start]61px[firstRow-end secondRow-start] auto [endRow];
|
||||||
@ -109,6 +110,8 @@ window.addEventListener('hashchange', () => {
|
|||||||
|
|
||||||
.page {
|
.page {
|
||||||
grid-area:page;
|
grid-area:page;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
place-self:center;
|
place-self:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
132
frontend/src/Apps/AboutRequest.vue
Normal file
132
frontend/src/Apps/AboutRequest.vue
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
<script setup>
|
||||||
|
import i18n from "@/i18n.js"
|
||||||
|
import {getSelf, getUser} from '../rest/Users.js'
|
||||||
|
import {getcurriculum,getSomeonesCurriculumList} from "@/rest/curriculum.js";
|
||||||
|
import {getRegisters} from "@/rest/ServiceInscription.js";
|
||||||
|
import {get} from "jsdom/lib/jsdom/named-properties-tracker.js";
|
||||||
|
import {getExternalCurriculumByInscrReq} from "@/rest/externalCurriculum.js";
|
||||||
|
import {ref} from "vue";
|
||||||
|
import ExternalCurriculumList from "@/Apps/ExternalCurriculumList.vue";
|
||||||
|
import {editEquivalenceState} from "@/rest/requests.js";
|
||||||
|
|
||||||
|
const props = defineProps(['target']);
|
||||||
|
const request = await getRegisters(props.target);
|
||||||
|
const cursus = await getcurriculum(request.curriculum);
|
||||||
|
const user = await getSelf();
|
||||||
|
const list = ref(false);
|
||||||
|
const externalCurriculum = await getExternalCurriculumByInscrReq(request.id)
|
||||||
|
|
||||||
|
function getPP(){
|
||||||
|
if(request.profilePictureUrl === null){
|
||||||
|
return "/Clyde.png"
|
||||||
|
}
|
||||||
|
return request.profilePictureUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function editEquivalence(id, newstate){
|
||||||
|
await editEquivalenceState(id, newstate)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="body" v-if="list == false">
|
||||||
|
<div class="container">
|
||||||
|
<div class="profilPic">
|
||||||
|
<img class="subContainter" :src=getPP()>
|
||||||
|
</div>
|
||||||
|
<div class = "globalInfos">
|
||||||
|
<div class="infosContainer">
|
||||||
|
<div>
|
||||||
|
FirstName/Name : {{request.firstName}} {{request.lastName}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
E-mail: {{request.email}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Adresse : {{request.address}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Pays : {{request.country}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Date de naissance : {{request.birthDate}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Cursus voulu : BAB {{cursus.year}} {{cursus.option}}
|
||||||
|
</div>
|
||||||
|
<div v-if="cursus.year > 1">
|
||||||
|
<button style="background-color:rgb(105,05,105);margin-left: 5%" @click="list=!list" v-if="(user.role == 'Teacher' || user.role == 'Admin')&& request.equivalenceState == 'Pending'">See external curriculums</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="list==true">
|
||||||
|
<ExternalCurriculumList :ext-curr-list="externalCurriculum" :inscr-req-id="request.id"></ExternalCurriculumList>
|
||||||
|
<div>
|
||||||
|
<button @click="editEquivalence(request.id, 'Accepted'); request.equivalenceState='Accepted'">Accept Equivalence</button>
|
||||||
|
<button @click="editEquivalence(request.id, 'Refused'); request.equivalenceState='Refused'">Refuse Equivalence</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.container{
|
||||||
|
min-width:675px;
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns:10vw 50vw;
|
||||||
|
grid-template-rows:200px auto;
|
||||||
|
column-gap:2.7%;
|
||||||
|
row-gap:45px;
|
||||||
|
grid-template-areas:
|
||||||
|
"profilPic globalInfos"
|
||||||
|
"minfos minfos";
|
||||||
|
}
|
||||||
|
|
||||||
|
.profilPic{
|
||||||
|
grid-area:profilPic;
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.globalInfos {
|
||||||
|
grid-area:globalInfos;
|
||||||
|
align-self :center;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
min-width:960px;
|
||||||
|
width:100%;
|
||||||
|
display:flex;
|
||||||
|
align-items:center;
|
||||||
|
justify-content:center;
|
||||||
|
margin-top:5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subContainter{
|
||||||
|
width:100%;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
border-radius:20px;
|
||||||
|
border:4px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infosContainer {
|
||||||
|
padding-bottom:50px;
|
||||||
|
border:2px solid black;
|
||||||
|
font-size:25px;
|
||||||
|
color:white;
|
||||||
|
padding:20px;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
border-radius:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button{
|
||||||
|
font-size:15px;
|
||||||
|
height:50px;
|
||||||
|
width:100px;
|
||||||
|
border:none;
|
||||||
|
border-radius:20px;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
182
frontend/src/Apps/AboutStudent.vue
Normal file
182
frontend/src/Apps/AboutStudent.vue
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
<script setup>
|
||||||
|
import i18n from "@/i18n.js"
|
||||||
|
import {getUser} from '../rest/Users.js'
|
||||||
|
import {getSomeonesCurriculumList} from "@/rest/curriculum.js";
|
||||||
|
|
||||||
|
const props = defineProps(['target']);
|
||||||
|
let user = await getUser(props.target);
|
||||||
|
let UserCurriculum = await getSomeonesCurriculumList(props.target);
|
||||||
|
|
||||||
|
function getPP(){
|
||||||
|
if(user.profilePictureUrl === null){
|
||||||
|
return "/Clyde.png"
|
||||||
|
}
|
||||||
|
return user.profilePictureUrl
|
||||||
|
}
|
||||||
|
|
||||||
|
//Cette function renvoie l'année académique concernée si on est dans l'année 2023-2024 elle renvoie 2023
|
||||||
|
//car dans la db l'année scolaire 2023-2024 est representée juste par 2023 (le même système s'applique pour chaque années on prend la borne inférieure
|
||||||
|
function getYear(){
|
||||||
|
let date = new Date();
|
||||||
|
if (date.getMonth() <= 6){
|
||||||
|
return date.getFullYear()-1
|
||||||
|
}
|
||||||
|
return date.getFullYear()
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="body">
|
||||||
|
<div class="container">
|
||||||
|
<div class="profilPic">
|
||||||
|
<img class="subContainter" :src=getPP()>
|
||||||
|
</div>
|
||||||
|
<div class = "globalInfos">
|
||||||
|
<div class="infosContainer">
|
||||||
|
<div>
|
||||||
|
FirstName/Name : {{user.firstName}} {{user.lastName}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
E-mail: {{user.email}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Adresse : {{user.address}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Pays : {{user.country}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Date de naissance : {{user.birthDate}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="moreInfos">
|
||||||
|
<div class = "oldcursus">
|
||||||
|
<div class="listTitle">
|
||||||
|
Anciens Cursus
|
||||||
|
</div>
|
||||||
|
<div class="listElement">
|
||||||
|
<div class=" containerElement" v-for="item in UserCurriculum.curriculumList">
|
||||||
|
<div class="year" v-if="parseInt(item.dateyear) !== getYear()">Bac {{item.year}}</div>
|
||||||
|
<div class="option" v-if="parseInt(item.dateyear) !== getYear()">{{item.option}}</div>
|
||||||
|
<div class="dateyear" v-if="parseInt(item.dateyear) !== getYear()">Année {{item.dateyear}}-{{item.dateyear+1}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="newcursus">
|
||||||
|
<div class="listTitle">
|
||||||
|
Cursus Actuel
|
||||||
|
</div>
|
||||||
|
<div class="listElement">
|
||||||
|
<div class=" containerElement" v-for="item in UserCurriculum.curriculumList" >
|
||||||
|
<div class="year" v-if="parseInt(item.dateyear) === getYear()">Bac {{item.year}}</div>
|
||||||
|
<div class="option" v-if="parseInt(item.dateyear) === getYear()">{{item.option}}</div>
|
||||||
|
<div class="dateyear" v-if="parseInt(item.dateyear) === getYear()">Année {{item.dateyear}}-{{item.dateyear+1}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.container{
|
||||||
|
min-width:675px;
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns:10vw 50vw;
|
||||||
|
grid-template-rows:200px auto;
|
||||||
|
column-gap:2.7%;
|
||||||
|
row-gap:45px;
|
||||||
|
grid-template-areas:
|
||||||
|
"profilPic globalInfos"
|
||||||
|
"minfos minfos";
|
||||||
|
}
|
||||||
|
|
||||||
|
.profilPic{
|
||||||
|
grid-area:profilPic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.globalInfos {
|
||||||
|
grid-area:globalInfos;
|
||||||
|
align-self :center;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
min-width:960px;
|
||||||
|
width:100%;
|
||||||
|
display:flex;
|
||||||
|
align-items:center;
|
||||||
|
justify-content:center;
|
||||||
|
margin-top:5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subContainter{
|
||||||
|
width:100%;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
border-radius:20px;
|
||||||
|
border:4px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infosContainer {
|
||||||
|
padding-bottom:50px;
|
||||||
|
border:2px solid black;
|
||||||
|
font-size:25px;
|
||||||
|
color:white;
|
||||||
|
padding:20px;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
border-radius:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moreInfos {
|
||||||
|
display:grid;
|
||||||
|
grid-template-rows:200px auto;
|
||||||
|
column-gap:50px;
|
||||||
|
row-gap:45px;
|
||||||
|
grid-template-areas:
|
||||||
|
"minfos minfos";
|
||||||
|
grid-template-columns:600px 600px;
|
||||||
|
align-items:center;
|
||||||
|
justify-content:center;
|
||||||
|
margin-left: 320%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.listTitle{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width:250px;
|
||||||
|
margin-left:auto;
|
||||||
|
margin-right:auto;
|
||||||
|
border:2px solid black;
|
||||||
|
font-size:25px;
|
||||||
|
color:white;
|
||||||
|
padding:20px;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
border-radius:20px;margin-bottom:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.listElement{
|
||||||
|
border:2px solid black;
|
||||||
|
font-size:25px;
|
||||||
|
color:white;
|
||||||
|
padding:20px;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
border-radius:20px;
|
||||||
|
margin-bottom:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containerElement{
|
||||||
|
justify-content:center;
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns:100px 100px 300px;
|
||||||
|
grid-template-areas:
|
||||||
|
"year option dateyear";
|
||||||
|
column-gap:40px;
|
||||||
|
padding-left: 25px;
|
||||||
|
}
|
||||||
|
</style>
|
139
frontend/src/Apps/CourseList.vue
Normal file
139
frontend/src/Apps/CourseList.vue
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
<script setup>
|
||||||
|
|
||||||
|
import {reactive, ref} from "vue";
|
||||||
|
import i18n from "@/i18n.js";
|
||||||
|
import {getCourse} from "@/rest/courses.js";
|
||||||
|
import {getcurriculum} from "@/rest/curriculum.js";
|
||||||
|
import {uploadFile, uploadProfilePicture} from "@/rest/uploads.js";
|
||||||
|
import {createExemptionsRequest} from "@/rest/requests.js";
|
||||||
|
import {getSelf} from "@/rest/Users.js";
|
||||||
|
|
||||||
|
const props = defineProps(["cursuslist"])
|
||||||
|
const selectedCurriculum = ref(props.cursuslist[0])
|
||||||
|
const user = await getSelf()
|
||||||
|
|
||||||
|
const courseslist = ref(await getcurriculum(selectedCurriculum.value.curriculumId))
|
||||||
|
const list = ref(true)
|
||||||
|
|
||||||
|
const ppData = ref({})
|
||||||
|
async function updateCourseList(){
|
||||||
|
courseslist.value = await getcurriculum(selectedCurriculum.value.curriculumId)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function postExemptionRequest(file, type){
|
||||||
|
const a = await uploadFile(file, type);
|
||||||
|
exemptReq.justifDocument = a.url
|
||||||
|
await createExemptionsRequest(exemptReq)
|
||||||
|
}
|
||||||
|
const exemptReq = reactive({
|
||||||
|
userRegNo : user.regNo,
|
||||||
|
courseId : null,
|
||||||
|
justifDocument : "",
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template style="margin-top:5%;">
|
||||||
|
<div v-if="list == true">
|
||||||
|
<span>Selected Cursus : </span>
|
||||||
|
<select v-model="selectedCurriculum" @change="updateCourseList">
|
||||||
|
<option v-for="item in props.cursuslist" :value="item">Bac {{item.year}} {{item.option}}</option>
|
||||||
|
</select>
|
||||||
|
<div style="display:flex; justify-content:center;" v-for="item in courseslist.courses">
|
||||||
|
<div class="bodu">
|
||||||
|
<div class="container">
|
||||||
|
<div class="title">{{item.title}}</div>
|
||||||
|
<div class="firstname">{{item.owner.firstName}}</div>
|
||||||
|
<div class="lastname">{{item.owner.lastName}}</div>
|
||||||
|
<div class="credits">credits : {{item.credits}}</div>
|
||||||
|
<div class="askexemption"><button style="background-color:rgb(105,0,0);" @click="list= !list;exemptReq.courseId=item.courseId">Ask exemption</button></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<p>Please upload the justification document for the exemption </p>
|
||||||
|
<label class="browser">
|
||||||
|
<input type="file" @change="ppData.value = $event.target.files" accept="image/*" ref="filepath">
|
||||||
|
</label>
|
||||||
|
<button style="width:15%; margin-top: 5%;" @click="postExemptionRequest(ppData.value, 'JustificationDocument');">
|
||||||
|
Submit exemption request
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.container{
|
||||||
|
color:white;
|
||||||
|
height:100px;
|
||||||
|
font-size:30px;
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns:30% 20% 15% 15% 15%;
|
||||||
|
grid-template-areas:"title firstname lastname credits askexemption";
|
||||||
|
column-gap:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
grid-area:title;
|
||||||
|
align-self:center;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
font-size: 50%;
|
||||||
|
margin-left:30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.credits {
|
||||||
|
grid-area:credits;
|
||||||
|
align-self:center;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
font-size: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.askexemption {
|
||||||
|
grid-area:askexemption;
|
||||||
|
align-self:center;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
}
|
||||||
|
.lastname{
|
||||||
|
grid-area:lastname;
|
||||||
|
align-self:center;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
font-size: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.firstname{
|
||||||
|
grid-area:firstname;
|
||||||
|
align-self:center;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
font-size: 50%;
|
||||||
|
padding-left: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.bodu {
|
||||||
|
margin-top:2%;
|
||||||
|
width:100%;
|
||||||
|
border:2px solid black;
|
||||||
|
border-radius:9px;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
}
|
||||||
|
|
||||||
|
button{
|
||||||
|
border:none;
|
||||||
|
background-color:rgb(239, 60, 168);
|
||||||
|
border-radius:10px;
|
||||||
|
height:35px;
|
||||||
|
margin-top:10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
103
frontend/src/Apps/ExternalCurriculumList.vue
Normal file
103
frontend/src/Apps/ExternalCurriculumList.vue
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
<script setup>
|
||||||
|
import i18n from "@/i18n.js";
|
||||||
|
import {editExternalCurriculum} from "@/rest/externalCurriculum.js";
|
||||||
|
import {ref} from "vue";
|
||||||
|
import {editEquivalenceState} from "@/rest/requests.js";
|
||||||
|
|
||||||
|
const props = defineProps(["extCurrList","inscrReqId"])
|
||||||
|
|
||||||
|
const extCurrList = ref(props.extCurrList)
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template style="margin-top:5%;">
|
||||||
|
<div style="display:flex; justify-content:center; " v-for="item in extCurrList">
|
||||||
|
<div class="bodu">
|
||||||
|
<div class="container">
|
||||||
|
<div class="status"><a style="margin-left:30px">{{item.state}}</a></div>
|
||||||
|
<div class="school"><a>{{item.school}}</a></div>
|
||||||
|
<div class="formation"><a>{{item.formation}}</a></div>
|
||||||
|
<div class="completion"><a>{{item.completion}}</a></div>
|
||||||
|
<div class="download"><button>Download document</button></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.container{
|
||||||
|
color:white;
|
||||||
|
height:100px;
|
||||||
|
font-size:30px;
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns:15% 10% 20% 15% 13.1%;
|
||||||
|
grid-template-areas:
|
||||||
|
"status school formation completion download";
|
||||||
|
column-gap:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
grid-area:status;
|
||||||
|
align-self:center;
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.school{
|
||||||
|
grid-area:school;
|
||||||
|
align-self:center;
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formation{
|
||||||
|
grid-area:formation;
|
||||||
|
align-self:center;
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.completion{
|
||||||
|
grid-area:completion;
|
||||||
|
align-self:center;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accept{
|
||||||
|
grid-area:accept;
|
||||||
|
align-self:center;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.refuse{
|
||||||
|
grid-area: refuse;
|
||||||
|
align-self:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.download{
|
||||||
|
grid-area: download;
|
||||||
|
align-self:center;
|
||||||
|
}
|
||||||
|
button{
|
||||||
|
font-size:15px;
|
||||||
|
height:50px;
|
||||||
|
width:75%;
|
||||||
|
border:none;
|
||||||
|
border-radius:20px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.bodu {
|
||||||
|
margin-top:2%;
|
||||||
|
width:66%;
|
||||||
|
border:2px solid black;
|
||||||
|
border-radius:9px;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -2,33 +2,102 @@
|
|||||||
import i18n from "@/i18n.js"
|
import i18n from "@/i18n.js"
|
||||||
import {ref} from 'vue'
|
import {ref} from 'vue'
|
||||||
import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js'
|
import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js'
|
||||||
|
import AboutRequest from "@/Apps/AboutRequest.vue";
|
||||||
|
import {getAllExemptionsRequest, getAllScholarShipsRequest} from "@/rest/requests.js";
|
||||||
|
|
||||||
const requests = ref(await getAllRegisters());
|
const requests = ref(await getAllRegisters());
|
||||||
console.log(requests);
|
let targetId = "";
|
||||||
|
|
||||||
|
const requestType = ref("inscription");
|
||||||
|
const filterType = ref("None");
|
||||||
|
|
||||||
|
//0 = liste, 1 = détails, 2 = sure?
|
||||||
|
let windowsState = ref(0);
|
||||||
|
|
||||||
async function upPage(id,review){
|
async function upPage(id,review){
|
||||||
await validateRegister(id,review);
|
await validateRegister(id,review);
|
||||||
requests.value = await getAllRegisters();
|
|
||||||
|
|
||||||
|
requests.value = await getAllRegisters();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadRequests(){
|
||||||
|
if (requestType.value === "inscription"){
|
||||||
|
requests.value = await getAllRegisters();
|
||||||
|
}
|
||||||
|
if (requestType.value === "scholarship"){
|
||||||
|
requests.value = await getAllScholarShipsRequest();
|
||||||
|
}
|
||||||
|
if(requestType.value === "exemption"){
|
||||||
|
requests.value = await getAllExemptionsRequest();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-for="item of requests">
|
<div v-if="windowsState === 1">
|
||||||
<div class="bodu" v-if="item.state === 'Pending'">
|
<AboutRequest :target="targetId"></AboutRequest>
|
||||||
<div class="container">
|
<button style="background-color:rgb(105,05,105);margin-left: 30%; margin-top: 5%" @click="windowsState=0;loadRequests()">Retour</button>
|
||||||
|
</div>
|
||||||
<div class="id"><a>{{item.id}}</a></div>
|
<div v-if="windowsState === 0">
|
||||||
<div class="surname"><a>{{item.lastName}}</a></div>
|
<div style="margin-top: 2%;margin-left: 2%">
|
||||||
<div class="firstname"><a>{{item.firstName}}</a></div>
|
<span>Request type : </span>
|
||||||
<div class="infos"><button style="background-color:rgb(105,05,105);" >{{i18n("request.moreInfos")}}</button></div>
|
<select v-model="requestType" @change="loadRequests()">
|
||||||
<div class="accept"><button @click="upPage(item.id,'Accepted')" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div>
|
<option>inscription</option>
|
||||||
<div class="refuse"><button @click="upPage(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div>
|
<option>scholarship</option>
|
||||||
|
<option>exemption</option>
|
||||||
|
</select>
|
||||||
|
<span style="margin-left: 5%">
|
||||||
|
Filter :
|
||||||
|
<select v-model="filterType">
|
||||||
|
<option>None</option>
|
||||||
|
<option>Pending</option>
|
||||||
|
<option>Accepted</option>
|
||||||
|
<option>Refused</option>
|
||||||
|
</select>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div style='display:flex; justify-content:center; min-width:1140px;' v-for="item of requests">
|
||||||
|
<div class="bodu" style="width: 95%" v-if="filterType == 'None' || filterType == item.state">
|
||||||
|
<div class="container" style="grid-template-columns:11% 15% 20% 10% 10% 9% 9%;grid-template-areas:'date state equivalencestate surname firstname accept refuse infos';" v-if="requestType === 'inscription'">
|
||||||
|
<!--
|
||||||
|
The condition below avoids an error occuring because loadRequests() finishes after the vue refresh
|
||||||
|
then submissionDate is undefined an it triggers an error in the console despite the fact that it is working
|
||||||
|
properly at the end.
|
||||||
|
-->
|
||||||
|
<div class="date" v-if="item.submissionDate !== undefined">{{item.submissionDate.slice(0, 10)}}</div>
|
||||||
|
<div class="state" style="font-size: 80%">Approval : {{item.state}}</div>
|
||||||
|
<div class="equivalencestate" style="font-size: 80%">Teacher approval : {{item.equivalenceState}}</div>
|
||||||
|
<div class="surname">{{item.lastName}}</div>
|
||||||
|
<div class="firstname">{{item.firstName}}</div>
|
||||||
|
<div class="accept" v-if="item.state === 'Pending'"><button @click="windowsState=2;targetId=item.id;" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div>
|
||||||
|
<div class="refuse" v-if="item.state === 'Pending'"><button @click="upPage(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div>
|
||||||
|
<div class="infos"><button style="background-color:rgb(105,05,105);" @click="targetId=item.id;windowsState=1;">{{i18n("request.moreInfos")}}</button></div>
|
||||||
|
</div>
|
||||||
|
<div class="container" style="grid-template-columns:25% 15% 15% 25% 14.2%;grid-template-areas:'date reqState studentfirstname studentlastname infos';" v-if="requestType === 'scholarship'">
|
||||||
|
<div class="date" v-if="item.date !== undefined"> {{item.date.slice(0,10)}}</div>
|
||||||
|
<div class="studentfirstname">{{item.user.firstName}}</div>
|
||||||
|
<div class="studentlastname">{{item.user.lastName}}</div>
|
||||||
|
<div class="reqState">{{item.state}}</div>
|
||||||
|
<div class="infos"><button>More infos</button></div>
|
||||||
|
</div>
|
||||||
|
<div class="container" style="grid-template-columns:17% 15% 12% 15% 25%;grid-template-areas:'date reqState studentfirstname studentlastname course infos';"v-if="requestType === 'exemption'">
|
||||||
|
<div class="date" v-if="item.date != undefined">{{item.date.slice(0,10)}}</div>
|
||||||
|
<div class="studentfirstname">{{item.user.firstName}}</div>
|
||||||
|
<div class="studentlastname">{{item.user.lastName}}</div>
|
||||||
|
<div class="course">{{item.course.title}}</div>
|
||||||
|
<div class="reqState">{{item.state}}</div>
|
||||||
|
<div class="infos"><button>More infos</button></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style='display:flex; justify-content:center; min-width:1140px;margin-top: 10%' v-if="windowsState === 2">
|
||||||
|
<p>Etes vous sur de vouloir accepter cette demande ?</p>
|
||||||
|
<button style="background-color:rgb(105,05,105);" @click="upPage(targetId,'Accepted');windowsState=0;">Valider</button>
|
||||||
|
<button style="background-color:rgb(105,05,105);" @click="windowsState=0;">Retour</button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -37,13 +106,31 @@
|
|||||||
height:100px;
|
height:100px;
|
||||||
font-size:20px;
|
font-size:20px;
|
||||||
display:grid;
|
display:grid;
|
||||||
grid-template-columns:[firstCol-start]100px[firstCol-end secondCol-start]150px[secondCol-end thirdCol-start]200px[thirdCol-end fourthCol-start]150px[fourthCol-end]150px[fifthCol-end]150px[sixthCol-end]150px[endCol];
|
|
||||||
grid-template-areas:
|
|
||||||
"id type surname firstname infos accept refuse";
|
|
||||||
column-gap:10px;
|
column-gap:10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.equivalencestate{
|
||||||
|
grid-area: equivalencestate;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
.studentfirstname{
|
||||||
|
grid-area: studentfirstname;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.studentlastname{
|
||||||
|
grid-area: studentlastname;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course{
|
||||||
|
grid-area: course;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
.reqState{
|
||||||
|
grid-area: reqState;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
.infos {
|
.infos {
|
||||||
grid-area:infos;
|
grid-area:infos;
|
||||||
align-self:center;
|
align-self:center;
|
||||||
@ -61,10 +148,16 @@
|
|||||||
|
|
||||||
.titles {
|
.titles {
|
||||||
grid-area:titles;
|
grid-area:titles;
|
||||||
background-color:rgb(215,215,215);
|
align-self:center;
|
||||||
}
|
}
|
||||||
.id{
|
.date{
|
||||||
grid-area:id;
|
grid-area:date;
|
||||||
|
margin-left:40px;
|
||||||
|
align-self:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.state{
|
||||||
|
grid-area:state;
|
||||||
margin-left:40px;
|
margin-left:40px;
|
||||||
align-self:center;
|
align-self:center;
|
||||||
}
|
}
|
||||||
@ -100,8 +193,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bodu {
|
.bodu {
|
||||||
width:100%;
|
margin-top:2%;
|
||||||
margin-bottom:10px;
|
width:66%;
|
||||||
border:2px solid black;
|
border:2px solid black;
|
||||||
border-radius:9px;
|
border-radius:9px;
|
||||||
background-color:rgb(50,50,50);
|
background-color:rgb(50,50,50);
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
import {reactive, ref } from 'vue'
|
import {reactive, ref } from 'vue'
|
||||||
import i18n from '@/i18n.js'
|
import i18n from '@/i18n.js'
|
||||||
import {login, register, disconnect, isLogged} from '@/rest/Users.js'
|
import {login, register, disconnect, isLogged} from '@/rest/Users.js'
|
||||||
import { getAllCurriculums } from '@/rest/curriculum.js'
|
import {getAllCurriculums, getcurriculum} from '@/rest/curriculum.js'
|
||||||
import { uploadProfilePicture } from '@/rest/uploads.js'
|
import { uploadProfilePicture } from '@/rest/uploads.js'
|
||||||
import {toast} from 'vue3-toastify'
|
import {toast} from 'vue3-toastify'
|
||||||
import 'vue3-toastify/dist/index.css';
|
import 'vue3-toastify/dist/index.css';
|
||||||
|
import {createExternalCurriculum} from "@/rest/externalCurriculum.js";
|
||||||
|
|
||||||
const loginPage= ref(true)
|
const loginPage= ref(true)
|
||||||
const page = ref(0)
|
const page = ref(0)
|
||||||
@ -20,13 +20,32 @@
|
|||||||
address:null,
|
address:null,
|
||||||
country:null,
|
country:null,
|
||||||
curriculum:null,
|
curriculum:null,
|
||||||
|
equivalenceState: "Unrequired"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const notcompletedCheck = ref(false);
|
||||||
|
|
||||||
|
const externalCurr = reactive({
|
||||||
|
inscriptionRequestId : null,
|
||||||
|
school:null,
|
||||||
|
formation :null,
|
||||||
|
completion : null,
|
||||||
|
startYear : null,
|
||||||
|
endYear: null,
|
||||||
|
justifdocUrl : null
|
||||||
|
})
|
||||||
|
|
||||||
|
//Stores some externalCurriculums in order to upload them all at the confirmation of the registration request
|
||||||
|
const externalCurrTab = ref([]);
|
||||||
|
|
||||||
const submitValue= ref(i18n("login.guest.submit"))
|
const submitValue= ref(i18n("login.guest.submit"))
|
||||||
const passwordConfirm=ref("")
|
const passwordConfirm=ref("")
|
||||||
|
|
||||||
const imageSaved = ref(false)
|
const imageSaved = ref(false)
|
||||||
const ppData = ref(false)
|
let ppData = ""
|
||||||
|
|
||||||
|
//Contains the id of the newly created request (useful to link the student's formations informations to the request)
|
||||||
|
let requestId = ""
|
||||||
|
|
||||||
const curricula= await getAllCurriculums();
|
const curricula= await getAllCurriculums();
|
||||||
|
|
||||||
@ -50,15 +69,46 @@
|
|||||||
disconnect();
|
disconnect();
|
||||||
window.location.reload();}
|
window.location.reload();}
|
||||||
|
|
||||||
|
async function uploadPP(arg){
|
||||||
|
const data = await uploadProfilePicture(arg);
|
||||||
|
ppData = data.url;
|
||||||
|
}
|
||||||
|
|
||||||
|
//This functions makes the distinction between a master cursus (year 4 or more) and a bachelor cursus (year 3 or less)
|
||||||
|
function getCursusDisplay(cursus){
|
||||||
|
if (cursus.year <= 3){
|
||||||
|
return "BAB " + cursus.year + " " + cursus.option;
|
||||||
|
}else{
|
||||||
|
return "MA" + (parseInt(cursus.year)-3).toString() + " " + cursus.option;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getCurriculumYear(curriculumId){
|
||||||
|
const curriculum = await getcurriculum(curriculumId);
|
||||||
|
return parseInt(curriculum.year);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Post the register request and return the id of the newly created request and also post the external curriculum list in the database
|
||||||
|
async function postRegisterReq(){
|
||||||
|
const val = await register(outputs.firstname, outputs.surname, outputs.birthday, outputs.password, outputs.email, outputs.address, outputs.country, outputs.curriculum, ppData, null, new Date(), outputs.equivalenceState);
|
||||||
|
for (let item in externalCurrTab.value){
|
||||||
|
await createExternalCurriculum(val.id, externalCurrTab.value[item].school, externalCurrTab.value[item].formation, externalCurrTab.value[item].completion, externalCurrTab.value[item].startYear, externalCurrTab.value[item].endYear, externalCurrTab.value[item].justifdocUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function deleteExtCursus(extcursus){
|
||||||
|
externalCurrTab.value.splice(externalCurrTab.value.indexOf(extcursus),1)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<template style="background-color:rgba(255,255,255,0.05); border-radius:50px" >
|
<template>
|
||||||
<div class='loginBox'>
|
<div class="setup">
|
||||||
|
|
||||||
<div v-if="loginPage">
|
<div v-if="loginPage">
|
||||||
|
<div class='loginBox' style="margin-top:30%;">
|
||||||
<form @submit.prevent="login(outputs.email,outputs.password);goBackHome();"class="form">
|
<form @submit.prevent="login(outputs.email,outputs.password);goBackHome();"class="form">
|
||||||
<h1 style="color:rgb(239,60,168); font-family: sans-serif;">
|
<h1 style="color:rgb(239,60,168); font-family: sans-serif;">
|
||||||
{{i18n("login.guest.signin")}}
|
{{i18n("login.guest.signin")}}
|
||||||
@ -74,13 +124,14 @@
|
|||||||
<div class="register">
|
<div class="register">
|
||||||
<a @click="loginPage=!loginPage">{{i18n("login.guest.register")}}</a>
|
<a @click="loginPage=!loginPage">{{i18n("login.guest.register")}}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="inputBox">
|
<div class="inputBox" style="margin-bottom:35px;">
|
||||||
<input type="submit" v-model="submitValue">
|
<input type="submit" v-model="submitValue">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
<div class='loginBox' style="margin-top:30%; margin-bottom:50%;">
|
||||||
<form class="form">
|
<form class="form">
|
||||||
<h1 style="color:rgb(239,60,168); font-family: sans-serif; text-align:center;">
|
<h1 style="color:rgb(239,60,168); font-family: sans-serif; text-align:center;">
|
||||||
{{i18n("login.guest.welcome")}}
|
{{i18n("login.guest.welcome")}}
|
||||||
@ -115,7 +166,7 @@
|
|||||||
<a>{{i18n("login.guest.alregister")}}</a>
|
<a>{{i18n("login.guest.alregister")}}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-if="page === 1">
|
||||||
<div class="inputBox">
|
<div class="inputBox">
|
||||||
<p>{{i18n("login.guest.email")}}</p>
|
<p>{{i18n("login.guest.email")}}</p>
|
||||||
<input type="mail" v-model="outputs.email">
|
<input type="mail" v-model="outputs.email">
|
||||||
@ -128,20 +179,30 @@
|
|||||||
<p>{{i18n("login.guest.country")}}</p>
|
<p>{{i18n("login.guest.country")}}</p>
|
||||||
<input type="text" v-model="outputs.country">
|
<input type="text" v-model="outputs.country">
|
||||||
</div>
|
</div>
|
||||||
|
<form class="inputBox" novalidate enctype="multipart/form-data">
|
||||||
|
<p>{{i18n("profile.picture").toUpperCase()}}</p>
|
||||||
|
</form>
|
||||||
|
<label class="browser">
|
||||||
|
Parcourir . . .
|
||||||
|
<input type="file" :disabled="imageSaved" @change="ppData = uploadProfilePicture($event.target.files); imageSaved = true;" accept="image/*">
|
||||||
|
</label>
|
||||||
<form novalidate enctype="multipart/form-data" class="inputBox">
|
<form novalidate enctype="multipart/form-data" class="inputBox">
|
||||||
<p>{{i18n("profile.picture").toUpperCase()}}</p>
|
<p>{{i18n("profile.picture").toUpperCase()}}</p>
|
||||||
<input type="file" :disabled="imageSaved" @change="ppData = uploadProfilePicture($event.target.files); imageSaved = true;" accept="image/*">
|
<input type="file" @change="uploadPP($event.target.files); imageSaved = true;" accept="image/*">
|
||||||
</form>
|
</form>
|
||||||
<div class="inputBox">
|
<div class="inputBox">
|
||||||
<p>{{i18n("Curriculum").toUpperCase()}}</p>
|
<p>{{i18n("Curriculum").toUpperCase()}}</p>
|
||||||
<select v-model="outputs.curriculum">
|
<select v-model="outputs.curriculum">
|
||||||
<option v-for="item in curricula">{{item.curriculumId}}</option>
|
<option v-for="item in curricula" :value="item.curriculumId">{{getCursusDisplay(item)}}</option>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<p style="color:rgb(239,60,168);">
|
||||||
|
Si vous êtes déja inscrits dans cette université veuillez vous connecter a votre compte et utilisez les fonctions
|
||||||
|
changer de cursus/réinscription sinon continuez ici.
|
||||||
|
</p>
|
||||||
<div style="align-self:center;" class="inputBox">
|
<div style="align-self:center;" class="inputBox">
|
||||||
<button style="margin-top:25px;" @click="register(outputs.firstname, outputs.surname, outputs.birthday, outputs.password, outputs.email, outputs.address, outputs.country, outputs.curriculum, ppData);">
|
<button style="margin-top:25px;" @click="page++;">
|
||||||
{{i18n("login.guest.submit")}}
|
{{i18n("login.guest.nextpage")}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="switchpage">
|
<div class="switchpage">
|
||||||
@ -151,19 +212,87 @@
|
|||||||
<a>{{i18n("login.guest.alregister")}}</a>
|
<a>{{i18n("login.guest.alregister")}}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="page === 2">
|
||||||
|
<form novalidate enctype="multipart/form-data" class="inputBox">
|
||||||
|
Carte d'identité :
|
||||||
</form>
|
</form>
|
||||||
|
<button @click="page++">{{i18n("login.guest.nextpage")}}</button>
|
||||||
|
</div>
|
||||||
|
<div v-if="page === 3">
|
||||||
|
<p>
|
||||||
|
Vous avez séléctionné un cursus qui possède des prérequis veuillez ajouter vos formations antérieures
|
||||||
|
dans l'enseignement supérieur, votre dossier sera vérifié par un membre du service d'inscription.
|
||||||
|
</p>
|
||||||
|
<button @click="page++">Ajouter une formation</button>
|
||||||
|
<button @click="postRegisterReq();">Envoyer la demande d'inscription</button>
|
||||||
|
</div>
|
||||||
|
<div v-if="page===4">
|
||||||
|
<form @submit.prevent=""class="form">
|
||||||
|
<div class="inputBox">
|
||||||
|
<p>Ecole</p>
|
||||||
|
<input type="text" v-model="externalCurr.school">
|
||||||
|
</div>
|
||||||
|
<div class="inputBox">
|
||||||
|
<p>Formation</p>
|
||||||
|
<input type="text" v-model="externalCurr.formation">
|
||||||
|
</div>
|
||||||
|
<div class="inputBox">
|
||||||
|
<p>Cochez la case si vous n'avez terminé cette formation</p>
|
||||||
|
<input v-model="notcompletedCheck" type="checkbox" id="checkboxformation">
|
||||||
|
<div v-if="notcompletedCheck">
|
||||||
|
<p>En quelle année de la formation vous êtes vous arrété (exemple: 3ème) ?</p>
|
||||||
|
<input type="text" v-model="externalCurr.completion">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inputBox">
|
||||||
|
<p>Année de début</p>
|
||||||
|
<input type="text" v-model="externalCurr.startYear">
|
||||||
|
</div>
|
||||||
|
<div class="inputBox">
|
||||||
|
<p>Année de fin</p>
|
||||||
|
<input type="text" v-model="externalCurr.endYear">
|
||||||
|
</div>
|
||||||
|
<div class="inputBox" style="margin-bottom:35px;">
|
||||||
|
<input type="submit" v-model="submitValue" @click="externalCurrTab.push({inscriptionReqId:null, school:externalCurr.school, formation:externalCurr.formation, completion:externalCurr.completion, startYear:externalCurr.startYear, endYear:externalCurr.endYear, justifdocUrl:externalCurr.justifdocUrl});console.log(externalCurrTab);page--;">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; justify-content:center; " v-for="item in externalCurrTab" v-if="page===3">
|
||||||
|
<div class="bodu">
|
||||||
|
<div class="container">
|
||||||
|
<div class="school"><a style="margin-left:30px;">{{item.school}}</a></div>
|
||||||
|
<div class="formation"><a>{{item.formation}}</a></div>
|
||||||
|
<div class="edit">
|
||||||
|
<button style="background-color:rgb(105,05,105);font-size:15px;height:50px;width:75%;border:none;border-radius:20px;" @click="externalCurr.school=item.school; externalCurr.completion=item.completion; externalCurr.formation=item.formation;externalCurr.endYear=item.endYear; externalCurr.startYear=item.startYear; externalCurr.justifdocUrl;page++;">Edit </button>
|
||||||
|
</div>
|
||||||
|
<div class="remove">
|
||||||
|
<button style="background-color:rgb(105,05,105);font-size:15px;height:50px;width:75%;border:none;border-radius:20px;" @click="deleteExtCursus(item)">Remove </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
|
.setup {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right:auto;
|
||||||
|
min-width:400px;
|
||||||
|
width:25%;
|
||||||
|
height:50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.loginBox {
|
.loginBox {
|
||||||
background-color: rgb(24,24,24);
|
background-color: rgb(24,24,24);
|
||||||
width: 100%;
|
width: 400px;
|
||||||
height:100%;
|
display:flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 10%;
|
|
||||||
border-radius: 5%;
|
border-radius: 5%;
|
||||||
box-shadow:0 5px 25px #000000;
|
box-shadow:0 5px 25px #000000;
|
||||||
|
|
||||||
@ -202,14 +331,22 @@
|
|||||||
|
|
||||||
.register{
|
.register{
|
||||||
color:rgb(239,60,168);
|
color:rgb(239,60,168);
|
||||||
width: 100%;
|
width:70%;
|
||||||
display:flex;
|
margin-bottom:20px;
|
||||||
|
margin-top:20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bodu {
|
||||||
|
margin-top:2%;
|
||||||
|
width:50%;
|
||||||
|
border:2px solid black;
|
||||||
|
border-radius:9px;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
}
|
||||||
|
|
||||||
.switchpage{
|
.switchpage{
|
||||||
width:100px;
|
width:100px;
|
||||||
background:rgb(255, 0 255);
|
|
||||||
border: none;
|
border: none;
|
||||||
padding-right:0;
|
padding-right:0;
|
||||||
padding-top:10px;
|
padding-top:10px;
|
||||||
@ -232,11 +369,37 @@ input[type=submit],button,select{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type=file]{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.browser{
|
||||||
|
display:inline-block;
|
||||||
|
cursor:pointer;
|
||||||
|
border-radius:20px;
|
||||||
|
background-color:rgb(239,60,168);
|
||||||
|
padding:5%;
|
||||||
|
font-size:1.35em;
|
||||||
|
font-family:sans-serif;
|
||||||
|
background:#FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container{
|
||||||
|
margin-top: 2%;
|
||||||
|
color:white;
|
||||||
|
height:60px;
|
||||||
|
font-size:30px;
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns:30% 30% 20% 20%;
|
||||||
|
grid-template-areas:
|
||||||
|
"school formation completion edit remove";
|
||||||
|
column-gap:10px;
|
||||||
|
}
|
||||||
|
|
||||||
button:active ,.switchpage:active{
|
button:active ,.switchpage:active{
|
||||||
opacity:0.8;
|
opacity:0.8;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -105,7 +105,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="createMod">
|
<div v-if="createMod">
|
||||||
<form class="listElement">
|
<form class="listElement" style="width:40%;margin-right:auto;margin-left:auto;">
|
||||||
|
|
||||||
<div style="margin-bottom:20px;">
|
<div style="margin-bottom:20px;">
|
||||||
{{i18n("name")}} :
|
{{i18n("name")}} :
|
||||||
<input v-model="toAdd.title">
|
<input v-model="toAdd.title">
|
||||||
@ -125,7 +126,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="deleteMod">
|
<div v-if="deleteMod">
|
||||||
<form class="listElement">
|
<form class="listElement" style="width:40%;margin-right:auto;margin-left:auto;">
|
||||||
<div style="margin-bottom:20px;">
|
<div style="margin-bottom:20px;">
|
||||||
{{i18n("courses.toDelete")}} :
|
{{i18n("courses.toDelete")}} :
|
||||||
<select style="max-width:200px;" class="teacher" v-model="toRemove">
|
<select style="max-width:200px;" class="teacher" v-model="toRemove">
|
||||||
@ -138,7 +139,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!createMod && !deleteMod" v-for="item in curriculum" :key="item.title">
|
<div v-if="!createMod && !deleteMod" v-for="item in curriculum" :key="item.title" style="width:50%;margin-left:auto; margin-right:auto;">
|
||||||
<div v-if="editElementID !== item.title" style ="padding:15px 15px 15px 15px;">
|
<div v-if="editElementID !== item.title" style ="padding:15px 15px 15px 15px;">
|
||||||
<button @click="editElementID = item.title; setModify(item); ">
|
<button @click="editElementID = item.title; setModify(item); ">
|
||||||
{{i18n("courses.modify")}}
|
{{i18n("courses.modify")}}
|
||||||
@ -149,6 +150,7 @@
|
|||||||
<button @click="editElementID= '';"> {{i18n("courses.back")}} </button>
|
<button @click="editElementID= '';"> {{i18n("courses.back")}} </button>
|
||||||
</div>
|
</div>
|
||||||
<div class="listElement" >
|
<div class="listElement" >
|
||||||
|
|
||||||
<div class="containerElement" v-if="editElementID !== item.title" >
|
<div class="containerElement" v-if="editElementID !== item.title" >
|
||||||
|
|
||||||
<div class="name"> {{item.title}} </div>
|
<div class="name"> {{item.title}} </div>
|
||||||
@ -172,17 +174,27 @@
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.body {
|
.body {
|
||||||
width:100%;
|
width:100%;
|
||||||
margin-bottom:10px;
|
margin-top:3.5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.infosContainer {
|
||||||
|
min-width:350px;
|
||||||
|
padding-bottom:50px;
|
||||||
|
border:2px solid black;
|
||||||
|
font-size:25px;
|
||||||
|
color:white;
|
||||||
|
padding:20px;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
border-radius:20px;
|
||||||
|
}
|
||||||
|
|
||||||
.containerElement{
|
.containerElement{
|
||||||
justify-content:center;
|
justify-content:center;
|
||||||
display:grid;
|
display:grid;
|
||||||
grid-template-columns:350px 350px 200px;
|
grid-template-columns:38.8% 38.8% 22.4%;
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"name teacher credits";
|
"name teacher credits";
|
||||||
column-gap:10px;
|
column-gap:10px; }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
grid-area:name;
|
grid-area:name;
|
||||||
@ -200,6 +212,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.listElement{
|
.listElement{
|
||||||
|
min-width:625px;
|
||||||
border:2px solid black;
|
border:2px solid black;
|
||||||
font-size:25px;
|
font-size:25px;
|
||||||
color:white;
|
color:white;
|
||||||
@ -207,6 +220,7 @@
|
|||||||
background-color:rgb(50,50,50);
|
background-color:rgb(50,50,50);
|
||||||
border-radius:20px;
|
border-radius:20px;
|
||||||
margin-bottom:10px;
|
margin-bottom:10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.modify{
|
.modify{
|
||||||
@ -255,10 +269,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.listTitle{
|
.listTitle{
|
||||||
|
min-width:380px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width:400px;
|
width:25%;
|
||||||
margin-left:auto;
|
margin-left:auto;
|
||||||
margin-right:auto;
|
margin-right:auto;
|
||||||
border:2px solid black;
|
border:2px solid black;
|
||||||
@ -266,7 +281,8 @@
|
|||||||
color:white;
|
color:white;
|
||||||
padding:20px;
|
padding:20px;
|
||||||
background-color:rgb(50,50,50);
|
background-color:rgb(50,50,50);
|
||||||
border-radius:20px;margin-bottom:10px;
|
border-radius:20px;
|
||||||
|
margin-bottom:10px;
|
||||||
|
|
||||||
button:hover{
|
button:hover{
|
||||||
opacity:0.8;
|
opacity:0.8;
|
||||||
|
213
frontend/src/Apps/Msg.vue
Normal file
213
frontend/src/Apps/Msg.vue
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
<!----------------------------------------------------
|
||||||
|
File: Msg.vue
|
||||||
|
Author: Anthony Debucquoy
|
||||||
|
Scope: Extension messagerie
|
||||||
|
Description: Main msg page
|
||||||
|
----------------------------------------------------->
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { discussionsList, currentDiscussion, fetchDiscussion, createDiscussion, sendMessage, updateDiscussionName, invite, removeMember} from '@/rest/msg.js'
|
||||||
|
|
||||||
|
const msgContent = ref("");
|
||||||
|
const addMember = ref(false);
|
||||||
|
const currentTitle = ref("");
|
||||||
|
|
||||||
|
function formatTime(date){
|
||||||
|
return date.getHours() + ":" + date.getMinutes() + " " + date.getDate() + "/" + date.getMonth();
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div id="msg">
|
||||||
|
<div id="discList">
|
||||||
|
<div @click="fetchDiscussion(discussion.id).then(e => currentTitle = currentDiscussion.name)" class="discItem" v-for="discussion in discussionsList" :key="discussion.id">{{ discussion.name }}</div>
|
||||||
|
<button id="createDiscussion" @click="createDiscussion('New Discussion')">+</button>
|
||||||
|
</div>
|
||||||
|
<div id="discussion" v-if="currentDiscussion.length != 0">
|
||||||
|
<h1 id=msgName ><input class="InputTitle" type="text" @change="updateDiscussionName(currentDiscussion.id, currentTitle)" v-model="currentTitle"></h1>
|
||||||
|
<div id=msgs>
|
||||||
|
<div class="msg" v-for="msg in currentDiscussion.msgs" :sender="msg.sender" :key="msg.id">
|
||||||
|
{{ msg.content }}<br/>
|
||||||
|
<span class="sender"><span v-if="!msg.sender">{{ msg.author.firstName }} {{ msg.author.lastName.toUpperCase() }}</span> {{formatTime(new Date(msg.created))}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id=messageBox>
|
||||||
|
<input type="text" @keyup.enter="sendMessage(currentDiscussion.id, msgContent, null); msgContent = ''" v-model="msgContent">
|
||||||
|
<input type="submit" @click="sendMessage(currentDiscussion.id, msgContent, null); msgContent = ''" value="send">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="members" v-if="currentDiscussion.length != 0">
|
||||||
|
<div class="memberItem" v-for="member in currentDiscussion.members" @click="removeMember(currentDiscussion.id, member.regNo)" :key="member.id"><span>{{ member.firstName }} {{ member.lastName.toUpperCase() }}</span></div>
|
||||||
|
<input type=text id="addMembers" @focus="addMember = true" @blur="addMember = false;$event.target.value = ''" @change="invite(currentDiscussion.id, $event.target.value)" :placeholder="addMember ? 'Regno' : '+'"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
div#msg{
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 20% auto 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#discList{
|
||||||
|
margin: 30px 0 30px 30px;
|
||||||
|
background-color: rgba(255, 255, 255, 0.05);
|
||||||
|
border-radius: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#members{
|
||||||
|
margin: 30px 0;
|
||||||
|
border-radius: 10px 0 0 10px;
|
||||||
|
background-color: red;
|
||||||
|
background-color: rgba(255, 255, 255, 0.05);
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
padding: 10px 0 0 10px;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.InputTitle{
|
||||||
|
all: inherit;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.discItem{
|
||||||
|
color: darkorange;
|
||||||
|
display: flex;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
height: 4vh;
|
||||||
|
margin: 5px;
|
||||||
|
border-radius: 0 30px 30px 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: 1px solid darkorange;
|
||||||
|
}
|
||||||
|
|
||||||
|
.memberItem{
|
||||||
|
color: darkorange;
|
||||||
|
display: flex;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
height: 4vh;
|
||||||
|
margin: 5px;
|
||||||
|
border-radius: 30px 0 0 30px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: 1px solid darkorange;
|
||||||
|
}
|
||||||
|
|
||||||
|
.memberItem:hover span{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.memberItem:hover{
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.memberItem:hover:before{
|
||||||
|
color: white;
|
||||||
|
content: "X"
|
||||||
|
}
|
||||||
|
|
||||||
|
#createDiscussion{
|
||||||
|
height: 4vh;
|
||||||
|
margin: 5px;
|
||||||
|
color: white;
|
||||||
|
background-color: green;
|
||||||
|
border-radius: 0 30px 30px 0;
|
||||||
|
border: none;
|
||||||
|
font-weight: 900;
|
||||||
|
font-size: 2em;
|
||||||
|
}
|
||||||
|
#addMembers{
|
||||||
|
height: 4vh;
|
||||||
|
margin: 5px;
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
background-color: green;
|
||||||
|
border-radius: 30px 0 0 30px;
|
||||||
|
border: none;
|
||||||
|
font-weight: 900;
|
||||||
|
font-size: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#discussion{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin: 30px;
|
||||||
|
background-color: rgba(255, 255, 255, 0.05);
|
||||||
|
border-radius: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#msgName{
|
||||||
|
text-align: center;
|
||||||
|
display: block;
|
||||||
|
background-color: #2a1981;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: white;
|
||||||
|
width: 75%;
|
||||||
|
margin: 30px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.discItem:hover{
|
||||||
|
background-color: gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
#msgs{
|
||||||
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg {
|
||||||
|
background-color: aliceblue;
|
||||||
|
font-family: sans-serif;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
max-width: 50%;
|
||||||
|
align-self: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sender{
|
||||||
|
display: inline-block;
|
||||||
|
color: gray;
|
||||||
|
font-size: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg[sender=true]{
|
||||||
|
background-color: darkorange;
|
||||||
|
align-self: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
#messageBox{
|
||||||
|
width: 100%;
|
||||||
|
height: 30px;
|
||||||
|
background-color: white;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
#messageBox input[type="text"]{
|
||||||
|
all: inherit;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#messageBox input[type="submit"]{
|
||||||
|
border: inherit;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
@ -1,16 +1,22 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {reactive, ref } from 'vue'
|
import {reactive, ref } from 'vue'
|
||||||
import {getSelf,alterSelf,disconnect,deleteUser} from '../rest/Users.js'
|
import {getSelf,alterSelf,disconnect,deleteUser} from '../rest/Users.js'
|
||||||
import {getSelfCurriculum, getAllCurriculums} from '../rest/curriculum.js'
|
import {getSelfCurriculum, getAllCurriculums, getSomeonesCurriculumList} from '../rest/curriculum.js'
|
||||||
import {getCourses} from "../rest/courses.js"
|
import {getCourses} from "../rest/courses.js"
|
||||||
import i18n from "@/i18n.js"
|
import i18n from "@/i18n.js"
|
||||||
import { uploadProfilePicture } from '@/rest/uploads.js'
|
import {uploadFile, uploadProfilePicture} from '@/rest/uploads.js'
|
||||||
|
import CourseList from "@/Apps/CourseList.vue";
|
||||||
|
import {editMinerval, getCurrentMinerval} from "@/rest/minerval.js";
|
||||||
|
import {postPayment} from "@/rest/payment.js";
|
||||||
|
import {createScholarshipRequest} from "@/rest/requests.js";
|
||||||
|
|
||||||
const user = ref(await getSelf());
|
const user = ref(await getSelf());
|
||||||
const UserCurriculum = ref("");
|
const UserCurriculum = ref("");
|
||||||
const curricula = ref (await getAllCurriculums());
|
const curricula = ref (await getAllCurriculums());
|
||||||
|
const minerv = ref({});
|
||||||
if(user.value.role === "Student"){
|
if(user.value.role === "Student"){
|
||||||
UserCurriculum.value = await getSelfCurriculum();
|
minerv.value = ref(await getCurrentMinerval(user.value.regNo));
|
||||||
|
UserCurriculum.value = await getSomeonesCurriculumList(user.value.regNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(user.role === "Teacher"){
|
if(user.role === "Teacher"){
|
||||||
@ -19,7 +25,11 @@
|
|||||||
const modif = ref(false);
|
const modif = ref(false);
|
||||||
const curric = ref(false);
|
const curric = ref(false);
|
||||||
const reg = ref(false);
|
const reg = ref(false);
|
||||||
|
const courseslist = ref(false);
|
||||||
|
const minerval = ref(false);
|
||||||
|
const paymentPage = ref(false);
|
||||||
|
const scholarship = ref(false);
|
||||||
|
const scholarshipinfos = ref(false);
|
||||||
const pattern = {
|
const pattern = {
|
||||||
profilPictureUrl:null,
|
profilPictureUrl:null,
|
||||||
email:null,
|
email:null,
|
||||||
@ -34,7 +44,27 @@
|
|||||||
id:null,
|
id:null,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Used to modelize a payment
|
||||||
|
const paymentData={
|
||||||
|
studentRegNo: user.value.regNo,
|
||||||
|
date:null,
|
||||||
|
card:null,
|
||||||
|
client:null,
|
||||||
|
expDate:null,
|
||||||
|
amount: null
|
||||||
|
}
|
||||||
|
|
||||||
|
//Used to modelize a scholarship request
|
||||||
|
const scholarshipData=reactive({
|
||||||
|
userId: user.value.regNo,
|
||||||
|
state:null,
|
||||||
|
date:null,
|
||||||
|
amount:0,
|
||||||
|
taxDocUrl : "",
|
||||||
|
residencyDocUrl : ""
|
||||||
|
})
|
||||||
|
|
||||||
|
const paymentAmount = ref(0);
|
||||||
let toModify= Object.assign({}, pattern);
|
let toModify= Object.assign({}, pattern);
|
||||||
let personnalInfos = Object.assign({}, patternInfos);
|
let personnalInfos = Object.assign({}, patternInfos);
|
||||||
|
|
||||||
@ -86,17 +116,47 @@
|
|||||||
}
|
}
|
||||||
return user.profilePictureUrl
|
return user.profilePictureUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getYear(){
|
||||||
|
let date = new Date();
|
||||||
|
if (date.getMonth() <= 6){
|
||||||
|
return date.getFullYear()-1
|
||||||
|
}
|
||||||
|
return date.getFullYear()
|
||||||
|
}
|
||||||
|
|
||||||
|
//This function travels through the student cursus array and extract the current cursus of the student
|
||||||
|
function getActualCurriculumList(){
|
||||||
|
let actualCurriculumList = [];
|
||||||
|
for (let i = 0; i < UserCurriculum.value.curriculumList.length; i++){
|
||||||
|
if (UserCurriculum.value.curriculumList[i].dateyear === getYear()){
|
||||||
|
actualCurriculumList.push(UserCurriculum.value.curriculumList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return actualCurriculumList
|
||||||
|
}
|
||||||
|
|
||||||
|
async function postScholarshipRequest(file1, type1, file2, type2){
|
||||||
|
const a = await uploadFile(file1, type1)
|
||||||
|
scholarshipData.taxDocUrl = a.url;
|
||||||
|
|
||||||
|
const b = await uploadFile(file2, type2)
|
||||||
|
scholarshipData.residencyDocUrl = b.url;
|
||||||
|
|
||||||
|
scholarshipData.date = Date.now();
|
||||||
|
|
||||||
|
await createScholarshipRequest(scholarshipData)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<div class="container">
|
<div class="container" v-if="courseslist == false">
|
||||||
<div class="profilPic">
|
<div class="profilPic">
|
||||||
<img class="subContainter" :src=getPP()>
|
<img class="subContainter" :src=getPP()>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="globalInfos">
|
<div class="globalInfos">
|
||||||
<div v-if="modif==false && curric==false && reg==false " class="infosContainer" >
|
<div v-if="modif==false && curric==false && reg==false && minerval==false && paymentPage == false && scholarship==false" class="infosContainer">
|
||||||
<div>
|
<div>
|
||||||
{{user.firstName}} {{user.lastName}}
|
{{user.firstName}} {{user.lastName}}
|
||||||
</div>
|
</div>
|
||||||
@ -119,6 +179,69 @@
|
|||||||
<div v-if="(user.role==='Student')">
|
<div v-if="(user.role==='Student')">
|
||||||
<button @click="curric=!curric">{{i18n("profile.change.curriculum")}}</button>
|
<button @click="curric=!curric">{{i18n("profile.change.curriculum")}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="(user.role==='Student')">
|
||||||
|
<button @click="courseslist=!courseslist">Manage Courses</button>
|
||||||
|
<button @click="minerval = !minerval" style="margin-left: 2%">Manage minerval</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="minerval" class="infosContainer">
|
||||||
|
<div v-if="minerv.value.toPay != 0">
|
||||||
|
Payment : {{minerv.value.toPay}}€ left to pay
|
||||||
|
<div v-if="minerv.value.paidAmount <= 50">
|
||||||
|
<button @click="minerval = !minerval; paymentPage = !paymentPage; paymentAmount = 50">Pay deposit (50€)</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button @click="minerval = !minerval; paymentPage = !paymentPage; paymentAmount = minerv.value.toPay">Pay all the rest ({{minerv.value.toPay}}€)</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
Payment : School fees have already been paid this year
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button @click="scholarship=!scholarship; minerval=!minerval">Ask for a scholarship</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scholarship && !scholarshipinfos" class="infosContainer">
|
||||||
|
<p>Please upload the required documents</p>
|
||||||
|
<div>
|
||||||
|
Tax justification document :
|
||||||
|
<input type="file" @change="scholarshipData.taxDocUrl = $event.target.files">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Residency justification document :
|
||||||
|
<input type="file" style="margin-top:2%" @change="scholarshipData.residencyDocUrl = $event.target.files">
|
||||||
|
</div>
|
||||||
|
<button style="margin-top: 5%" @click="scholarshipinfos = !scholarshipinfos;postScholarshipRequest(scholarshipData.taxDocUrl, 'JustificationDocument',scholarshipData.residencyDocUrl, 'JustificationDocument');">Submit scholarship request</button>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scholarship && scholarshipinfos" class="infosContainer">
|
||||||
|
<div>
|
||||||
|
Your request has been sent to the inscription service you will get notified when
|
||||||
|
the request is reviewed.
|
||||||
|
</div>
|
||||||
|
<button @click="scholarshipinfos=!scholarshipinfos; scholarship=!scholarship">
|
||||||
|
Go back to profile
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="paymentPage" class="infosContainer">
|
||||||
|
Proceed to payment of {{paymentAmount}}€
|
||||||
|
<div style="margin-top: 1%">
|
||||||
|
Client:
|
||||||
|
<input type="text" v-model="paymentData.client">
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 1%">
|
||||||
|
Card:
|
||||||
|
<input type="text" v-model="paymentData.card">
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 1%">
|
||||||
|
ExpDate:
|
||||||
|
<input type="date" v-model="paymentData.expDate">
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 1%">
|
||||||
|
<button @click="paymentPage=!paymentPage;minerval=!minerval;paymentData.amount=paymentAmount;paymentData.date=new Date();postPayment(paymentData);minerv.value.toPay -= paymentAmount; minerv.value.paidAmount += paymentAmount; editMinerval(minerv.value)">Process Payment</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button @click="minerval = !minerval; paymentPage = !paymentPage;">Back</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="modif" class="infosContainer">
|
<div v-else-if="modif" class="infosContainer">
|
||||||
<div>
|
<div>
|
||||||
@ -182,39 +305,48 @@
|
|||||||
<button @click=" reg=!reg; resetInputs(personnalInfos,patternInfos);" style="float:right;">{{i18n("courses.back")}}</button>
|
<button @click=" reg=!reg; resetInputs(personnalInfos,patternInfos);" style="float:right;">{{i18n("courses.back")}}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="user.role == 'Student' && modif==false && curric==false && reg==false && minerval==false && scholarship == false" class="moreInfos">
|
||||||
<div v-if="modif==false && curric==false && reg==false "class="moreInfos">
|
<div class = "oldcursus">
|
||||||
|
|
||||||
<div v-if="(user.role ==='Student')">
|
|
||||||
<div class="listTitle">
|
<div class="listTitle">
|
||||||
{{i18n("profile.course.list")}}
|
Anciens Cursus
|
||||||
</div>
|
</div>
|
||||||
<div class="listElement" v-for="item in UserCurriculum.courses">
|
<div class="listElement">
|
||||||
<div class=" containerElement">
|
<div class=" containerElement" v-for="item in UserCurriculum.curriculumList">
|
||||||
<div class="name"> {{item.title}} </div>
|
<div class="year" v-if="parseInt(item.dateyear) !== getYear()">Bac {{item.year}}</div>
|
||||||
<div class="teacher">{{item.owner.lastName}}</div>
|
<div class="option" v-if="parseInt(item.dateyear) !== getYear()">{{item.option}}</div>
|
||||||
<div class="credits">Credits:{{item.credits}}</div>
|
<div class="dateyear" v-if="parseInt(item.dateyear) !== getYear()">Année {{item.dateyear}}-{{item.dateyear+1}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="actualcursus">
|
||||||
<div>
|
<div class="listTitle">
|
||||||
|
Cursus Actuel
|
||||||
</div>
|
</div>
|
||||||
|
<div class="listElement">
|
||||||
|
<div class=" containerElement" v-for="item in UserCurriculum.curriculumList" >
|
||||||
|
<div class="year" v-if="parseInt(item.dateyear) === getYear()">Bac {{item.year}}</div>
|
||||||
|
<div class="option" v-if="parseInt(item.dateyear) === getYear()">{{item.option}}</div>
|
||||||
|
<div class="dateyear" v-if="parseInt(item.dateyear) === getYear()">Année {{item.dateyear}}-{{item.dateyear+1}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="courseslist === true" style="width: 80%">
|
||||||
|
<CourseList :cursuslist="getActualCurriculumList()"/>
|
||||||
|
<button style="width: 10%; margin-top: 5%" @click="courseslist = false">Return to profile</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
.container{
|
.container{
|
||||||
|
min-width:675px;
|
||||||
display:grid;
|
display:grid;
|
||||||
grid-template-columns:200px 900px;
|
grid-template-columns:10vw 50vw;
|
||||||
grid-template-rows:200px auto;
|
grid-template-rows:200px auto;
|
||||||
column-gap:30px;
|
column-gap:2.7%;
|
||||||
row-gap:45px;
|
row-gap:45px;
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"profilPic globalInfos"
|
"profilPic globalInfos"
|
||||||
@ -222,6 +354,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.profilPic{
|
.profilPic{
|
||||||
|
width:100%;
|
||||||
grid-area:profilPic;
|
grid-area:profilPic;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,19 +372,49 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.moreInfos {
|
.moreInfos {
|
||||||
grid-area:minfos;
|
margin-top: 50%;
|
||||||
|
display:grid;
|
||||||
|
grid-template-rows:200px auto;
|
||||||
|
column-gap:50px;
|
||||||
|
row-gap:45px;
|
||||||
|
grid-template-areas:
|
||||||
|
"minfos minfos";
|
||||||
|
grid-template-columns:600px 600px;
|
||||||
|
align-items:center;
|
||||||
|
justify-content:center;
|
||||||
|
margin-left: 320%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.listTitle{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width:250px;
|
||||||
|
margin-left:auto;
|
||||||
|
margin-right:auto;
|
||||||
|
border:2px solid black;
|
||||||
|
font-size:25px;
|
||||||
|
color:white;
|
||||||
|
padding:20px;
|
||||||
|
background-color:rgb(50,50,50);
|
||||||
|
border-radius:20px;margin-bottom:10px;
|
||||||
}
|
}
|
||||||
.body {
|
.body {
|
||||||
|
min-width:960px;
|
||||||
width:100%;
|
width:100%;
|
||||||
margin-bottom:10px;
|
display:flex;
|
||||||
|
align-items:center;
|
||||||
|
justify-content:center;
|
||||||
|
margin-top:5%;
|
||||||
}
|
}
|
||||||
.containerElement{
|
.containerElement{
|
||||||
justify-content:center;
|
justify-content:center;
|
||||||
display:grid;
|
display:grid;
|
||||||
grid-template-columns:350px 350px 200px;
|
grid-template-columns:100px 100px 300px;
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"name teacher credits";
|
"year option dateyear";
|
||||||
column-gap:10px;
|
column-gap:40px;
|
||||||
|
padding-left: 25px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,20 +433,6 @@
|
|||||||
align-self:center;
|
align-self:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listTitle{
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width:200px;
|
|
||||||
margin-left:auto;
|
|
||||||
margin-right:auto;
|
|
||||||
border:2px solid black;
|
|
||||||
font-size:25px;
|
|
||||||
color:white;
|
|
||||||
padding:20px;
|
|
||||||
background-color:rgb(50,50,50);
|
|
||||||
border-radius:20px;margin-bottom:10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.listElement{
|
.listElement{
|
||||||
border:2px solid black;
|
border:2px solid black;
|
||||||
@ -296,6 +445,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.infosContainer {
|
.infosContainer {
|
||||||
|
min-width:350px;
|
||||||
padding-bottom:50px;
|
padding-bottom:50px;
|
||||||
border:2px solid black;
|
border:2px solid black;
|
||||||
font-size:25px;
|
font-size:25px;
|
||||||
|
@ -1,19 +1,29 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import i18n from "@/i18n.js"
|
import i18n from "@/i18n.js"
|
||||||
import { reactive } from 'vue'
|
import {provide, reactive, ref} from 'vue'
|
||||||
import { getStudents } from '../rest/Users.js'
|
import { getStudents } from '../rest/Users.js'
|
||||||
|
import AboutStudent from "@/Apps/AboutStudent.vue";
|
||||||
const users = await getStudents();
|
const users = await getStudents();
|
||||||
|
|
||||||
|
let targetRegNo = "";
|
||||||
|
let list = ref(true);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
|
||||||
<div v-for="item in users">
|
<template style="margin-top:5%;">
|
||||||
|
<div v-if="list === false">
|
||||||
|
<AboutStudent :target=targetRegNo />
|
||||||
|
<button style="background-color:rgb(105,05,105);width:5%; margin-left: 10%;" @click="list = true;">Back</button>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; justify-content:center; " v-for="item in users" v-if="list === true">
|
||||||
<div class="bodu">
|
<div class="bodu">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="status"><a style="margin-left:30px">{{item.status}}</a></div>
|
<div class="status"><a style="margin-left:30px">{{item.status}}</a></div>
|
||||||
<div class="option"><a>{{item.role}}</a></div>
|
<div class="option"><a>{{item.role}}</a></div>
|
||||||
<div class="surname"><a>{{item.lastName}}</a></div>
|
<div class="surname"><a>{{item.lastName}}</a></div>
|
||||||
<div class="firstname"><a>{{item.firstName}}</a></div>
|
<div class="firstname"><a>{{item.firstName}}</a></div>
|
||||||
<div class="infos"><button style="background-color:rgb(105,05,105);" >{{i18n("request.moreInfos")}} </button></div>
|
<div class="infos">
|
||||||
|
<button style="background-color:rgb(105,05,105);" @click="list = false; targetRegNo = item.regNo;">{{i18n("request.moreInfos")}} </button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -25,11 +35,10 @@
|
|||||||
height:100px;
|
height:100px;
|
||||||
font-size:30px;
|
font-size:30px;
|
||||||
display:grid;
|
display:grid;
|
||||||
grid-template-columns:250px 250px 250px 250px 150px;
|
grid-template-columns:21.7% 21.7% 21.7% 20% 13.1%;
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"status option surname firstname infos";
|
"status option surname firstname infos";
|
||||||
column-gap:10px;
|
column-gap:10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.infos {
|
.infos {
|
||||||
@ -42,21 +51,6 @@
|
|||||||
align-self:center;
|
align-self:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.refuse{
|
|
||||||
grid-area:refuse;
|
|
||||||
align-self:center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titles {
|
|
||||||
grid-area:titles;
|
|
||||||
background-color:rgb(215,215,215);
|
|
||||||
}
|
|
||||||
.id{
|
|
||||||
grid-area:id;
|
|
||||||
margin-left:40px;
|
|
||||||
align-self:center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status{
|
.status{
|
||||||
grid-area:status;
|
grid-area:status;
|
||||||
align-self:center;
|
align-self:center;
|
||||||
@ -81,15 +75,15 @@
|
|||||||
button{
|
button{
|
||||||
font-size:15px;
|
font-size:15px;
|
||||||
height:50px;
|
height:50px;
|
||||||
width:100px;
|
width:75%;
|
||||||
border:none;
|
border:none;
|
||||||
border-radius:20px;
|
border-radius:20px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bodu {
|
.bodu {
|
||||||
width:100%;
|
margin-top:2%;
|
||||||
margin-bottom:10px;
|
width:66%;
|
||||||
border:2px solid black;
|
border:2px solid black;
|
||||||
border-radius:9px;
|
border-radius:9px;
|
||||||
background-color:rgb(50,50,50);
|
background-color:rgb(50,50,50);
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
const users = await getAllUsers();
|
const users = await getAllUsers();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template style="margin-top:5%;">
|
||||||
<div v-for="item in users">
|
<div style="display:flex; justify-content:center; min-width:1140px;" v-for="item in users">
|
||||||
<div class="bodu">
|
<div class="bodu">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="role"><a style="margin-left:30px">{{i18n(item.role)}}</a></div>
|
<div class="role"><a style="margin-left:30px">{{i18n(item.role)}}</a></div>
|
||||||
@ -22,23 +22,20 @@
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.container{
|
.container{
|
||||||
justify-content:center;
|
|
||||||
align-items:center;
|
|
||||||
color:white;
|
color:white;
|
||||||
height:100px;
|
height:100px;
|
||||||
font-size:30px;
|
font-size:30px;
|
||||||
display:grid;
|
display:grid;
|
||||||
grid-template-columns:250px 250px 250px 150px;
|
grid-template-columns:27.7% 27.7% 27.7% 16.9%;
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"role surname firstname infos";
|
"role surname firstname infos";
|
||||||
column-gap:10px;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.infos {
|
.infos {
|
||||||
|
|
||||||
grid-area:infos;
|
grid-area:infos;
|
||||||
align-items:center;
|
align-self:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.role {
|
.role {
|
||||||
@ -67,20 +64,18 @@
|
|||||||
button{
|
button{
|
||||||
font-size:15px;
|
font-size:15px;
|
||||||
height:50px;
|
height:50px;
|
||||||
width:100px;
|
width:75%;
|
||||||
border:none;
|
border:none;
|
||||||
border-radius:20px;
|
border-radius:20px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bodu {
|
.bodu {
|
||||||
width:100%;
|
margin-top:2%;
|
||||||
margin-bottom:10px;
|
width:66%;
|
||||||
border:2px solid black;
|
border:2px solid black;
|
||||||
border-radius:9px;
|
border-radius:9px;
|
||||||
background-color:rgb(50,50,50);
|
background-color:rgb(50,50,50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
body {
|
body {
|
||||||
background-color: rgb(53, 25, 60);
|
background-color: rgb(53, 25, 60);
|
||||||
margin:0;
|
margin:0;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* TODO: On time of writing, the backend doesn't support these endpoints so it could be modified in the future.
|
* TODO: On time of writing, the backend doesn't support these endpoints so it could be modified in the future.
|
||||||
*/
|
*/
|
||||||
import {restGet, restPatch} from './restConsumer.js'
|
import {restGet, restPatch, restPost} from './restConsumer.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new register requests that can be recovered by the registering service
|
* create a new register requests that can be recovered by the registering service
|
||||||
@ -43,3 +43,4 @@ export async function getAllRegisters(){
|
|||||||
export async function validateRegister(id, state){
|
export async function validateRegister(id, state){
|
||||||
return restPatch("/request/register/" + id, state);
|
return restPatch("/request/register/" + id, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ export function disconnect(){
|
|||||||
* @param curriculum
|
* @param curriculum
|
||||||
* @param imageId id of the image in database returned when uploaded
|
* @param imageId id of the image in database returned when uploaded
|
||||||
*/
|
*/
|
||||||
export async function register(firstname, lastname, birthDate, password, email, address, country, curriculumId, imageId){
|
export async function register(firstname, lastname, birthDate, password, email, address, country, curriculumId, imageId, identityCardId, submissionDate, equivalence){
|
||||||
return restPost("/register", {
|
return restPost("/register", {
|
||||||
firstName: firstname,
|
firstName: firstname,
|
||||||
lastName: lastname,
|
lastName: lastname,
|
||||||
@ -36,7 +36,10 @@ export async function register(firstname, lastname, birthDate, password, email,
|
|||||||
address: address,
|
address: address,
|
||||||
country: country,
|
country: country,
|
||||||
curriculumId: curriculumId,
|
curriculumId: curriculumId,
|
||||||
profilePictureUrl: imageId,
|
profilePicture: imageId,
|
||||||
|
identityCard : identityCardId,
|
||||||
|
submissionDate : submissionDate,
|
||||||
|
equivalenceState : equivalence
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +55,7 @@ export async function register(firstname, lastname, birthDate, password, email,
|
|||||||
* @param country
|
* @param country
|
||||||
* @param imageId id of the image in database returned when uploaded
|
* @param imageId id of the image in database returned when uploaded
|
||||||
*
|
*
|
||||||
* PS: the password is not is not required as it is generated by the backend and sent to the user
|
* PS: the password is not required as it is generated by the backend and sent to the user
|
||||||
* by mail. it's up to the user to change it if he cares about security
|
* by mail. it's up to the user to change it if he cares about security
|
||||||
*/
|
*/
|
||||||
export async function createUser(firstname, lastname, birthDate, email, address, country, role, imageId){
|
export async function createUser(firstname, lastname, birthDate, email, address, country, role, imageId){
|
||||||
|
@ -9,6 +9,8 @@ import Profil from "@/Apps/Profil.vue"
|
|||||||
import Courses from "@/Apps/ManageCourses.vue"
|
import Courses from "@/Apps/ManageCourses.vue"
|
||||||
import Users from "@/Apps/UsersList.vue"
|
import Users from "@/Apps/UsersList.vue"
|
||||||
import Students from "@/Apps/StudentsList.vue"
|
import Students from "@/Apps/StudentsList.vue"
|
||||||
|
import AboutStudent from "@/Apps/AboutStudent.vue";
|
||||||
|
import Msg from "@/Apps/Msg.vue"
|
||||||
|
|
||||||
const apps = {
|
const apps = {
|
||||||
'/login': LoginPage,
|
'/login': LoginPage,
|
||||||
@ -17,6 +19,7 @@ const apps = {
|
|||||||
'/manage-courses' : Courses,
|
'/manage-courses' : Courses,
|
||||||
'/users-list' : Users,
|
'/users-list' : Users,
|
||||||
'/students-list' : Students,
|
'/students-list' : Students,
|
||||||
|
'/msg' : Msg,
|
||||||
}
|
}
|
||||||
|
|
||||||
const appsList = {
|
const appsList = {
|
||||||
|
@ -48,3 +48,9 @@ export async function altercurriculum(id, courses){
|
|||||||
export async function getSelfCurriculum(){
|
export async function getSelfCurriculum(){
|
||||||
return restGet("/curriculum");
|
return restGet("/curriculum");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getSomeonesCurriculumList(user){
|
||||||
|
return restGet("/onescurriculum/"+user)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
22
frontend/src/rest/externalCurriculum.js
Normal file
22
frontend/src/rest/externalCurriculum.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import {restGet, restPatch, restPost} from "@/rest/restConsumer.js";
|
||||||
|
import {parseInteger} from "jsdom/lib/jsdom/living/helpers/strings.js";
|
||||||
|
|
||||||
|
export async function createExternalCurriculum(inscriptionRequestId,school, formation, completion, startYear, endYear, justifdocUrl){
|
||||||
|
return restPost("/externalcurriculum", {
|
||||||
|
inscriptionRequestId: inscriptionRequestId,
|
||||||
|
school:school,
|
||||||
|
formation :formation,
|
||||||
|
completion : completion,
|
||||||
|
startYear : parseInteger(startYear),
|
||||||
|
endYear: parseInteger(endYear),
|
||||||
|
justifdocUrl : justifdocUrl
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getExternalCurriculumByInscrReq(inscrReqId){
|
||||||
|
return restGet("/externalcurriculum/"+inscrReqId)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function editExternalCurriculum(extReqId, newState){
|
||||||
|
return restPatch("/externalcurriculum/"+extReqId+"/"+newState)
|
||||||
|
}
|
9
frontend/src/rest/minerval.js
Normal file
9
frontend/src/rest/minerval.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import {restGet, restPatch, restPost} from "@/rest/restConsumer.js";
|
||||||
|
|
||||||
|
export async function getCurrentMinerval(userRegNo){
|
||||||
|
return restGet("/minerval/"+userRegNo)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function editMinerval(updatedMinerval){
|
||||||
|
return restPatch("/minerval", updatedMinerval)
|
||||||
|
}
|
60
frontend/src/rest/msg.js
Normal file
60
frontend/src/rest/msg.js
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/*******************************************************
|
||||||
|
* File: msg.js
|
||||||
|
* Author: Anthony Debucquoy
|
||||||
|
* Scope: Extension messagerie
|
||||||
|
* Description: Messages frontend api consumer
|
||||||
|
*******************************************************/
|
||||||
|
|
||||||
|
import { restGet, restPost, restPatch } from './restConsumer.js'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* - id
|
||||||
|
* - name
|
||||||
|
* - members
|
||||||
|
*/
|
||||||
|
export const discussionsList = ref();
|
||||||
|
export const currentDiscussion = ref([]);
|
||||||
|
let timerSet = false
|
||||||
|
|
||||||
|
|
||||||
|
export async function createDiscussion(name){
|
||||||
|
let disc = await restPost("/discussion", {name: name});
|
||||||
|
discussionsList.value.push(disc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export async function invite(id, regNo){
|
||||||
|
restPatch("/discussion/"+ id+ "/add", {regNo: parseInt(regNo)}).then(() => fetchDiscussion(id))
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function removeMember(id, regNo){
|
||||||
|
restPatch("/discussion/"+ id+ "/remove", {regNo: parseInt(regNo)}).then(() => fetchDiscussion(id))
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function sendMessage(id, content, responseId){
|
||||||
|
let data = {
|
||||||
|
content: content,
|
||||||
|
response: responseId,
|
||||||
|
}
|
||||||
|
restPost("/discussion/" + id, data).then(() => fetchDiscussion(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function updateDiscussionName(id, name){
|
||||||
|
restPatch("/discussion/" + id, {name: name}).then(() => fetchDiscussions());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async function fetchDiscussions(){
|
||||||
|
discussionsList.value = await restGet("/discussions");
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function fetchDiscussion(id){
|
||||||
|
currentDiscussion.value = await restGet("/discussion/" + id);
|
||||||
|
if(!timerSet){
|
||||||
|
timerSet = true;
|
||||||
|
setTimeout(() => {timerSet = false;fetchDiscussion(currentDiscussion.value.id)} , 5000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await fetchDiscussions();
|
6
frontend/src/rest/payment.js
Normal file
6
frontend/src/rest/payment.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import {restPost} from "@/rest/restConsumer.js";
|
||||||
|
|
||||||
|
export async function postPayment(payment){
|
||||||
|
return restPost("/payment", payment)
|
||||||
|
}
|
||||||
|
|
21
frontend/src/rest/requests.js
Normal file
21
frontend/src/rest/requests.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import {restGet, restPatch, restPost} from "@/rest/restConsumer.js";
|
||||||
|
|
||||||
|
export async function createExemptionsRequest(exempReq){
|
||||||
|
return restPost("/exemptionreq", exempReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function createScholarshipRequest(reqInfo){
|
||||||
|
return restPost("/scholarshipreq", reqInfo)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getAllScholarShipsRequest(){
|
||||||
|
return restGet("/scholarshipreq")
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getAllExemptionsRequest(){
|
||||||
|
return restGet("/exemptionsreq")
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function editEquivalenceState(id, newstate){
|
||||||
|
return restPatch("/request/registerequiv/"+id+"/"+newstate)
|
||||||
|
}
|
@ -7,5 +7,17 @@ import { restPostFile } from '@/rest/restConsumer.js'
|
|||||||
export async function uploadProfilePicture(file){
|
export async function uploadProfilePicture(file){
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("file", file[0]);
|
formData.append("file", file[0]);
|
||||||
return restPostFile("/upload/ProfilePicture", formData)
|
|
||||||
|
return restPostFile("/upload/ProfilePicture", formData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* More generic version of the upload method
|
||||||
|
*/
|
||||||
|
|
||||||
|
export async function uploadFile(file, type){
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("file", file[0]);
|
||||||
|
return restPostFile("/upload/"+type, formData)
|
||||||
}
|
}
|
Reference in New Issue
Block a user