Skip to content

feat: Block mentorship registration for ineligible mentees based on ProfileStatus #544

@womencodingcommunity

Description

@womencodingcommunity

Context

A mentee should not be allowed to register for a mentorship cycle if their community membership has not been approved. Currently there is no guard against this. The ProfileStatus enum already has PENDING, REJECTED, BANNED, and DISABLED values that should be used to block registration.

Changes Required

MenteeService.saveRegistration()

  • Before any processing, check the mentee's ProfileStatus
  • Throw a descriptive exception for each blocking status:
    • PENDING → membership not yet approved
    • REJECTED → membership application rejected
    • BANNED → permanently banned from the community
    • DISABLED → account temporarily disabled
  • Only ACTIVE members can register

New exception

  • Create MenteeNotEligibleException (or reuse existing pattern) with a clear message indicating why registration is blocked

Acceptance Criteria

  • Registration blocked for PENDING, REJECTED, BANNED, DISABLED profile statuses
  • Clear exception message returned per blocking status
  • ACTIVE members can register normally (existing tests pass)
  • Unit tests added for each blocked status scenario
  • Integration test added

Dependencies

  • Ticket: feat: Add new ApplicationStatus values and DB migration

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