Skip to content

feat: Admin API to reject mentor-mentee pairing and forward to next priority #545

@womencodingcommunity

Description

@womencodingcommunity

Context

When an admin reviews a mentor-accepted application and determines the mentee does not fit this specific mentor, they should be able to reject the pairing. The mentee should then automatically be forwarded to their next priority mentor application. This is different from excluding a mentee from the cycle entirely.

Currently REJECTED is terminal — this must change (see ticket: feat: Add new ApplicationStatus values and DB migration).

Changes Required

MenteeWorkflowService

  • Add rejectPairing(applicationId, reason):
    • Sets application status to REJECTED (now non-terminal)
    • Calls notifyNextPriorityMentor() to forward to next priority
    • Calls checkAndTriggerManualMatch() if no more priorities remain

notifyNextPriorityMentor()

  • Extend to handle REJECTED as a forwarding trigger (alongside existing MENTOR_DECLINED)

New API endpoint

PATCH /api/platform/v1/mentees/applications/{applicationId}/reject-pairing
Body: { "reason": "string" }
Response: Updated MenteeApplication

Acceptance Criteria

  • rejectPairing() service method implemented
  • REJECTED no longer terminal (depends on Ticket 1)
  • Next priority mentor notified automatically after rejection
  • If no more priorities: transitions to PENDING_MANUAL_MATCH
  • Endpoint documented in OpenAPI/Swagger
  • Unit and integration tests

Dependencies

  • Ticket: feat: Add new ApplicationStatus values and DB migration
  • Ticket: feat: PENDING_MANUAL_MATCH detection and manual matching queue

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestepic-mentorshipAll tasks related to mentorship pages & tasksjava/springbootTasks where is needed Java experience or Spring Boot Experience

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions