In the current version of ScholarX platform, the mentee selection process works in a “First-come first-served” model. So if a mentee is approved by a mentor, all other mentee applications of that mentor get rejected automatically. We had some discussions about this matter earlier and decided to introduce a new program state for the mentees to confirm a mentor from the approved mentor.
Goals:
Creating a new program state
Updating the existing endpoints to work with the new state
These are the related endpoints which already exists:
Get applied mentors ( GET /programs/{id}/mentee/mentors ) This returns a list of mentors applied by a user for a specific program
Get selected mentor ( GET /programs/{id}/mentee/mentor ) This returns selected mentor of the mentee for a specific program
Following are the new endpoints which we need for the new state:
Get approved mentors ( GET /programs/{id}/mentee/mentor?states=APPROVED) This returns a list of mentors who have approved the user for a specific program
Confirm a mentor ( PUT /programs/{id}/mentors/{id}/mentee) This will be used to confirm an approved mentor by rejecting all other applications of the user for a specific program.
(I’m not much sure about the paths of these endpoints. Please let me know if there are any recommendations)
Btw, is this mentor confirmation process an irreversible process? (Because if a mentee confirms a mentor, all other applications will be rejected and he/she will not be able to get the approved mentors again). WDYT? @jaye@YohanAvishke@EngTeam
Get the mentor by Id --> get the program id from mentor object --> get all mentees (List) by program Id and user Id(taken from cookie) --> filter the Approved mentees from that list --> get the mentors list from that list --> check whether the mentor by Id exists in that list --> if exists, reject all other mentee objects in the previous list