Adding a new program state for mentees to confirm the mentor

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
  • Adding the new endpoints needed for the new state

Related Threads:

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

Great explanation, @piumal1999! Looks good to me!

btw,
PUT /programs/{id}/mentors/{id}/mentee we don’t need the program id if we have the mentor id, right?

Ah right. We can use “PUT /mentors/id/mentee”

This will be the process for that:

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

Oh, we are already using that path to update mentee data. Is it okay to use the same path but as a POST request?

@piumal1999 Once the endpoints are confirmed can you update the API doc?

1 Like

Sure.
I sent the pull request. https://github.com/sef-global/scholarx/pull/92
@YohanAvishke could you please have a look?

2 Likes

The requested changes are also done.