Skip to content

feat: Admin API to mark mentor unavailable and forward mentee to next priority #546

@womencodingcommunity

Description

@womencodingcommunity

Context

Two scenarios require forwarding a mentee to their next priority mentor without the mentor actively declining:

  1. Mentor unavailable: mentor cannot participate this cycle (capacity full, on leave, etc.) — unrelated to the specific mentee
  2. Admin forwarded: mentor has not responded within the expected timeframe and admin manually escalates

Both statuses trigger the same forwarding logic but are semantically distinct for reporting purposes.

Changes Required

MenteeWorkflowService

  • Add markMentorUnavailable(applicationId, reason):
    • Sets status to MENTOR_UNAVAILABLE
    • Triggers next priority forwarding
  • Add forwardApplication(applicationId, reason):
    • Sets status to ADMIN_FORWARDED
    • Triggers next priority forwarding
  • Both methods call checkAndTriggerManualMatch() if no more priorities remain

New API endpoints

PATCH /api/platform/v1/mentors/applications/{applicationId}/mark-unavailable
Body: { "reason": "string" }

PATCH /api/platform/v1/mentees/applications/{applicationId}/forward
Body: { "reason": "string" }

Acceptance Criteria

  • markMentorUnavailable() implemented and tested
  • forwardApplication() implemented and tested
  • Both trigger next priority forwarding
  • Both trigger PENDING_MANUAL_MATCH when priorities exhausted
  • Both endpoints 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