feat(mentorship): PR7 — mentor opt-in, discovery, and recommendation surfaces - #42
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Introduce shared recommendation+evidence contracts across planner/curator/reporter responses, add organizer-gated member-growth and weekly briefing draft/approve endpoints backed by decision-audit persistence, and reuse shared audit metadata normalization in planning cycle and recommendation flows. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…rfaces PR7 - stacked on indcoder-pr6-recommendation-audit-foundation. Changes: - MentorshipStatus and MentorExpertiseArea enums - MentorProfileId Vogen value object - MentorProfile domain model (opt-in state, expertise areas as JSON, availability) - IMentorProfileRepository interface with discoverable-mentor filtering - MentorProfileRepository EF Core implementation (upsert pattern) - MentorProfileConfiguration EF configuration (unique index on MemberId, composite index on Status+IsDiscoverable) - BethuyaDbContext: add MentorProfiles DbSet - EF migration: 20260731160539_MentorshipOptIn - MentorshipContracts DTOs (MentorOptInRequest, MentorStatusUpdateRequest, MentorProfileResponse, MentorDiscoveryEntryResponse, DraftMentorPairingSuggestionRequest) - MentorshipService: opt-in/upsert, status transitions, discovery with privacy-aware filtering, mentor-pairing recommendation draft backed by auditable Decision record - MentorshipEndpoints: /api/community/mentorship group - opt-in (RequireAttendee), status update (RequireAttendee), my-profile (RequireAttendee), discover (RequireAttendee), mentor-pairing recommendation draft (RequireOrganizer) - Program.cs: register IMentorProfileRepository + MentorshipService, map MentorshipEndpoints - MentorshipServiceTests (TUnit): 11 tests covering opt-in, idempotent upsert, status transitions, discovery filtering, privacy exclusions, recommendation draft persistence, and availability clamping - All 275 tests pass Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds the mentorship “mentor opt-in → discovery → organizer recommendation draft” slice to the backend/core/infrastructure layers, including persistence (EF Core) and TUnit coverage, aligning mentorship features with existing Community Passport + Decision/audit patterns.
Changes:
- Introduces
MentorProfiledomain model + enums/value-object IDs and a repository contract/EF implementation for opt-in and discovery. - Adds mentorship service + minimal API endpoints (
/api/community/mentorship/*) with attendee/organizer policy enforcement. - Updates EF Core context/configuration and adds a migration + snapshot updates, plus a dedicated TUnit test suite.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Hackmum.Bethuya.Tests/Services/MentorshipServiceTests.cs | Adds TUnit coverage for opt-in, status transitions, discovery filtering, and recommendation draft persistence. |
| src/Hackmum.Bethuya.Infrastructure/Repositories/MentorProfileRepository.cs | EF Core repository implementation for mentor profile reads/discovery + upsert. |
| src/Hackmum.Bethuya.Infrastructure/Data/Migrations/BethuyaDbContextModelSnapshot.cs | Updates EF model snapshot to include MentorProfiles. |
| src/Hackmum.Bethuya.Infrastructure/Data/Migrations/20260731160539_MentorshipOptIn.Designer.cs | Adds migration designer model for MentorProfiles. |
| src/Hackmum.Bethuya.Infrastructure/Data/Migrations/20260731160539_MentorshipOptIn.cs | Creates MentorProfiles table + indexes/FK. |
| src/Hackmum.Bethuya.Infrastructure/Data/Configurations/MentorProfileConfiguration.cs | EF mapping for MentorProfile including JSON column + indexes + FK. |
| src/Hackmum.Bethuya.Infrastructure/Data/BethuyaDbContext.cs | Adds DbSet<MentorProfile> MentorProfiles. |
| src/Hackmum.Bethuya.Core/ValueObjects/CommunityIds.cs | Adds Vogen MentorProfileId. |
| src/Hackmum.Bethuya.Core/Repositories/IMentorProfileRepository.cs | Defines mentor profile persistence contract. |
| src/Hackmum.Bethuya.Core/Models/MentorProfile.cs | Introduces mentor opt-in model including JSON-backed expertise areas and discoverability fields. |
| src/Hackmum.Bethuya.Core/Enums/MentorshipStatus.cs | Adds mentorship opt-in lifecycle enum. |
| src/Hackmum.Bethuya.Core/Enums/MentorExpertiseArea.cs | Adds mentor expertise taxonomy enum. |
| src/Hackmum.Bethuya.Backend/Services/MentorshipService.cs | Implements opt-in/upsert, status updates, privacy-aware discovery, and auditable recommendation draft creation. |
| src/Hackmum.Bethuya.Backend/Program.cs | Registers mentorship DI + maps mentorship endpoints. |
| src/Hackmum.Bethuya.Backend/Endpoints/MentorshipEndpoints.cs | Adds minimal API endpoints for opt-in, status, my-profile, discovery, and mentor-pairing draft. |
| src/Hackmum.Bethuya.Backend/Contracts/MentorshipContracts.cs | Adds request/response contracts for mentorship APIs. |
Files not reviewed (1)
- src/Hackmum.Bethuya.Infrastructure/Data/Migrations/20260731160539_MentorshipOptIn.Designer.cs: Generated file
- Add Community Passport and mentor growth capabilities to platform overview - Document stacked foundation slices delivered in PR2 through PR7 - Refresh repository/domain summary and hackathon scope checklist to match current shipped foundations Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- remove unused using in MentorProfileRepository - reject undefined numeric expertise enum values in ParseExpertiseAreas - align MentorshipStatus.Paused XML docs with implemented behavior Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- resolved content conflicts across passport/recommendation services and tests - aligned participation write endpoint with connector-ingestion policy - updated endpoint test policy setup for connector-ingestion coverage Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
PR7 — Mentor Opt-In, Discovery & Recommendation Surfaces
Stacked on
indcoder-pr6-recommendation-audit-foundation. Closes the foundation slice for community mentorship.What changed
MentorshipStatus.cs,MentorExpertiseArea.csCommunityIds.csMentorProfileIdVogen structMentorProfile.csIMentorProfileRepository.csGetByMemberId,GetDiscoverableMentors,UpsertMentorProfileConfiguration.csMemberId, composite onStatus+IsDiscoverable, FK →CommunityMembersMentorProfileRepository.csBethuyaDbContext.csMentorProfilesDbSet20260731160539_MentorshipOptInMentorProfilestable + indexesMentorshipContracts.csMentorOptInRequest,MentorStatusUpdateRequest,MentorProfileResponse,MentorDiscoveryEntryResponse,DraftMentorPairingSuggestionRequestMentorshipService.csRecommendationEnvelope+Decisionaudit trailMentorshipEndpoints.cs/api/community/mentorshipProgram.csMentorshipServiceTests.csEndpoint surface
POST/api/community/mentorship/opt-inRequireAttendeePATCH/api/community/mentorship/statusRequireAttendeeGET/api/community/mentorship/my-profileRequireAttendeeGET/api/community/mentorship/discoverRequireAttendeePOST/api/community/mentorship/recommendations/mentor-pairingRequireOrganizerTest coverage (TUnit)
IsDiscoverable = trueby defaultGetMyProfilereturnsnullbefore opt-inIsDiscoverable = false)UpdateStatuswithout prior opt-in throwsInvalidOperationExceptionOptedIn + IsDiscoverablemembers[1, 40]Reuse from earlier slices
CommunityMember/CommunityPassportService— member provisioning and privacy fieldsParticipationLedgerEntry/CommunityJourneyReadModelService— leadership-funnel signals in recommendation evidenceRecommendationEnvelope+Decision/IDecisionRepository— human-review-gated audit trail (PR6 schema)BethuyaPolicyNames—RequireAttendee+RequireOrganizerValidation commands