Skip to content

TEST: Application workflow and matching cascade #7

@nora-weisser

Description

@nora-weisser
  • Application created on submit → PENDING.
  • PATCH /mentees/applications/{id}/approve (permission MENTEE_APPROVE) → PENDING → ADMIN_APPROVED; mentor can now see the application.
  • PATCH /mentees/applications/{id}/reject (permission MENTEE_APPROVE, with reason) → PENDING → REJECTED or ADMIN_APPROVED → REJECTED.
  • PATCH /mentors/applications/{id}/accept (permission MENTOR_APPL_WRITE) → ADMIN_APPROVED → MENTOR_ACCEPTED.
  • PATCH /mentors/applications/{id}/decline (permission MENTOR_APPL_WRITE, with reason) → ADMIN_APPROVED → MENTOR_DECLINED. The service auto-forwards: it finds the next-priority application for the same mentee in the same cycle and moves it to the mentor's queue.
  • When all priority applications are declined or rejected, the service inserts a PENDING_MANUAL_MATCH placeholder application for the mentee in that cycle.
  • confirmMatch(applicationId) is the only path from MENTOR_ACCEPTED → MATCHED. It:
    • Verifies the application is MENTOR_ACCEPTED, else IllegalStateException.
    • Verifies the mentor has capacity, else MentorCapacityExceededException.
    • Verifies the mentee is not already matched in this cycle, else IllegalStateException.
    • Creates a MentorshipMatch row with MatchStatus.ACTIVE.
    • Updates the application to MATCHED.
    • Auto-rejects every other open application for that mentee in the same cycle with the reason "Mentee matched with another mentor".
    • Triggers a match-update notification.
  • PATCH /mentees/applications/{id}/withdrawDROPPED.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions