Skip to content

feat: Add PATCH endpoint to accept mentor registration#516

Merged
lauracabtay merged 28 commits intoWomen-Coding-Community:mainfrom
lauracabtay:feat-patch-mentor-registration
Feb 15, 2026
Merged

feat: Add PATCH endpoint to accept mentor registration#516
lauracabtay merged 28 commits intoWomen-Coding-Community:mainfrom
lauracabtay:feat-patch-mentor-registration

Conversation

@lauracabtay
Copy link
Contributor

@lauracabtay lauracabtay commented Feb 11, 2026

Description

This PR introduces a new workflow for mentor registration and approval, ensuring that mentor profiles are initially set to a PENDING status and can only be activated through a dedicated endpoint (PATCH /api/platform/v1/mentors/{mentor_id}/accept. It also adds exception handling for mentor status conflicts and updates API documentation and request validation. The changes are grouped below by theme:

Mentor Registration & Approval Workflow:

  • Added CreateMentorRequest DTO for mentor registration, enforcing validation.
  • Updated MentorDto and its toMentor() method to enforce profile status as PENDING on creation, preventing clients from setting it directly.
  • Modified the mentor creation endpoint in MentorshipController to use CreateMentorRequest.
  • Added a new PATCH endpoint /mentors/{mentorId}/accept in MentorshipController to activate a mentor's profile, changing their status to ACTIVE.
  • Introduced MentorStatusException and added handling in GlobalExceptionHandler to return HTTP 409 (Conflict) for mentor status-related errors (i.e. if status is already active).
  • Added updateProfileStatus method to MentorRepository for updating mentor profile status.
  • Updated Postman collection and scripts to reflect new mentor registration and approval workflow, including removal of profileStatus from request bodies and addition of the new approval endpoint.
  • Added new template type MENTOR_APPROVAL to TemplateType enum for mentor registration approval notifications.
  • Introduced a NotificationService to handle the sending of notifications (at the moment emails) related to mentor and mentee events. It centralises notification logic, making it easier to manage different types of notifications (e.g., mentor approval, mentee onboarding) in one place (note: Ability to send email is pending Infrastructure: Setup Gmail SMTP Authentication #448 and Setup: Generate SMTP Authentication for dev and prod #449)

Related Issue

Parent: #488
Closes #509

Change Type

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

Screenshots

CreateMentorRequest schema:
Screenshot 2026-02-11 at 20 39 25


ProfileStatus is not posted in the request body:
Screenshot 2026-02-11 at 19 40 21


Newly created mentor shows as pending:
Screenshot 2026-02-11 at 17 21 42


Mentor set to active:
Screenshot 2026-02-11 at 17 28 10


Mentor is already active:
Screenshot 2026-02-11 at 17 47 34

Pull request checklist

Please check if your PR fulfills the following requirements:

@lauracabtay lauracabtay changed the title feat: Add PATCH endpoints to accept mentor registration feat: Add PATCH endpoint to accept mentor registration Feb 13, 2026
# Conflicts:
#	src/test/java/com/wcc/platform/service/MentorshipServiceTest.java
@lauracabtay lauracabtay linked an issue Feb 15, 2026 that may be closed by this pull request
@lauracabtay lauracabtay merged commit cd664b7 into Women-Coding-Community:main Feb 15, 2026
1 check passed
@lauracabtay lauracabtay deleted the feat-patch-mentor-registration branch February 20, 2026 17:16
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 PATCH endpoint to accept mentor registration

3 participants