feat: Add PATCH endpoint to accept mentor registration#516
Merged
lauracabtay merged 28 commits intoWomen-Coding-Community:mainfrom Feb 15, 2026
Merged
Conversation
…istration # Conflicts: # src/main/java/com/wcc/platform/domain/platform/mentorship/MentorDto.java # src/test/java/com/wcc/platform/domain/platform/mentorship/MentorDtoTest.java
dricazenck
reviewed
Feb 13, 2026
dricazenck
reviewed
Feb 13, 2026
dricazenck
reviewed
Feb 13, 2026
dricazenck
reviewed
Feb 13, 2026
src/main/resources/email-templates/mentor_registration_approval.yml
Outdated
Show resolved
Hide resolved
dricazenck
reviewed
Feb 13, 2026
src/main/java/com/wcc/platform/service/NotificationService.java
Outdated
Show resolved
Hide resolved
dricazenck
reviewed
Feb 13, 2026
src/main/java/com/wcc/platform/service/NotificationService.java
Outdated
Show resolved
Hide resolved
dricazenck
reviewed
Feb 13, 2026
src/main/java/com/wcc/platform/service/NotificationService.java
Outdated
Show resolved
Hide resolved
dricazenck
reviewed
Feb 13, 2026
src/main/java/com/wcc/platform/service/NotificationService.java
Outdated
Show resolved
Hide resolved
dricazenck
reviewed
Feb 13, 2026
src/main/resources/email-templates/mentor_registration_approval.yml
Outdated
Show resolved
Hide resolved
dricazenck
approved these changes
Feb 13, 2026
# Conflicts: # src/test/java/com/wcc/platform/service/MentorshipServiceTest.java
dricazenck
reviewed
Feb 15, 2026
src/main/java/com/wcc/platform/domain/platform/mentorship/MentorDto.java
Show resolved
Hide resolved
dricazenck
approved these changes
Feb 15, 2026
dricazenck
reviewed
Feb 15, 2026
src/main/java/com/wcc/platform/service/MentorshipNotificationService.java
Show resolved
Hide resolved
dricazenck
reviewed
Feb 15, 2026
src/main/java/com/wcc/platform/configuration/NotificationTemplateConfig.java
Outdated
Show resolved
Hide resolved
8 tasks
dricazenck
reviewed
Feb 15, 2026
src/main/java/com/wcc/platform/domain/template/TemplateType.java
Outdated
Show resolved
Hide resolved
dricazenck
reviewed
Feb 15, 2026
src/main/resources/email-templates/mentorship_profile_approved_mentor.yml
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a new workflow for mentor registration and approval, ensuring that mentor profiles are initially set to a
PENDINGstatus 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:
CreateMentorRequestDTO for mentor registration, enforcing validation.MentorDtoand itstoMentor()method to enforce profile status asPENDINGon creation, preventing clients from setting it directly.MentorshipControllerto useCreateMentorRequest./mentors/{mentorId}/acceptinMentorshipControllerto activate a mentor's profile, changing their status toACTIVE.MentorStatusExceptionand added handling inGlobalExceptionHandlerto return HTTP 409 (Conflict) for mentor status-related errors (i.e. if status is already active).updateProfileStatusmethod toMentorRepositoryfor updating mentor profile status.profileStatusfrom request bodies and addition of the new approval endpoint.MENTOR_APPROVALtoTemplateTypeenum for mentor registration approval notifications.NotificationServiceto 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
Screenshots
CreateMentorRequest schema:

ProfileStatus is not posted in the request body:

Newly created mentor shows as pending:

Mentor set to active:

Mentor is already active:

Pull request checklist
Please check if your PR fulfills the following requirements: