Skip to content

Conversation

@lauracabtay
Copy link
Contributor

@lauracabtay lauracabtay commented Jan 20, 2026

Description

  • Create a validateMentorCommitment method that checks no month is < 2 hours for long term mentors.
  • Call the method and mentorship service create and update method.
  • Create relevant unit tests.
  • Wondering if the check on months should be a bit more sophisticated (i.e. do we expect long term mentors to submit availabilities for a minimum of months in a row?)

Related Issue

Please link to the issue here

Closes #320

Change Type

  • Bug Fix
  • New Feature
  • Code Refactor
  • Documentation
  • Test
  • Other

Screenshots

Return 2xx for long term mentor with availability >= 2 hours:
Screenshot 2026-01-20 at 20 26 56

Return 2xx for ad-hoc mentor with availability < 2 hours:
Screenshot 2026-01-20 at 21 12 06

Return 4xx for long-term mentor with availability < 2 hours:
Screenshot 2026-01-20 at 20 29 00

Pull request checklist

Please check if your PR fulfills the following requirements:

@lauracabtay lauracabtay changed the title Feat: Add validation for minimum 2 hours availability per month for long-term mentor Draft (WIP): Feat: Add validation for minimum 2 hours availability per month for long-term mentor Jan 20, 2026
@lauracabtay lauracabtay changed the title Draft (WIP): Feat: Add validation for minimum 2 hours availability per month for long-term mentor Feat: Add validation for minimum 2 hours availability per month for long-term mentor Jan 20, 2026
@lauracabtay lauracabtay marked this pull request as ready for review January 20, 2026 20:58
@lauracabtay lauracabtay requested a review from a team as a code owner January 20, 2026 20:58
Copy link
Collaborator

@dricazenck dricazenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@dricazenck
Copy link
Collaborator

Wondering if the check on months should be a bit more sophisticated (i.e. do we expect long term mentors to submit availabilities for a minimum of months in a row?)

For long-term they don't submit months. So no need for check for the the months. The months are for ad-hoc sessions, usually long-term mentors should be available from the months of the cycle: April/November. But also flexible to discuss the availability with the mentee ;)

@dricazenck dricazenck changed the title Feat: Add validation for minimum 2 hours availability per month for long-term mentor Feat: Validate minimum of 2 hours/month for long-term mentor Jan 20, 2026
@dricazenck
Copy link
Collaborator

dricazenck commented Jan 20, 2026

I notice a gap, in the mentor registration design, which is the number of mentees the mentor can accept in the cycle long-term.

For example:

"menteeSection": {
   "numMentee": 3,
    "mentorshipType": ["Long-Term", "Ad-Hoc" ],
    "availability": [ { "month": "APRIL", "hours": 2 },  {"month": "MAY",  "hours": 4 } ,  {"month": "JULY",  "hours": 5 }],
    "idealMentee": "string",
    "additional": "string"
  }

The attribute numMentee can help us to identify how many they can accept and also validate depending on the hours and months the are available. Which is the question you asked.

and This case for example would be invalid, because the mentor says can take 3 mentees, but he will be available for only 1 hour.

"menteeSection": {
   "numMentee": 3,
    "mentorshipType": ["Long-Term", "Ad-Hoc" ],
    "availability": [ { "month": "APRIL", "hours": 1 },  {"month": "MAY",  "hours": 3 } ,  {"month": "JULY",  "hours": 1 }],
  }

Or actually the best way would be to separated availability by Mentorship type:

"menteeSection": {
    "idealMentee": "string",
    "additional": "string",
   "LongTerm": { "numMentee": 2, "hours": 8 }, // Min 4 
    "AdHoc": [ { "month": "APRIL", "hours": 1 },  {"month": "MAY",  "hours": 3 } ,  {"month": "JULY",  "hours": 1 }],
  }

That will require migration and make the adjustments into the DTO and the queries, but I think would be a great improvement and give more context to mentorship team to know about the availability of the mentor, and also for the mentor, which will knows about the expectations in time and mentee.

Could you create this issue and if you are up to the challenge to pickup next? 🙈

@lauracabantoustaylor
Copy link

That sounds like a very good plan! Will create the issue tomorrow and yes, happy to pick it up next! 😄

@dricazenck dricazenck merged commit 664cb9b into Women-Coding-Community:main Jan 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Validation for minimum 2 hours

3 participants