Skip to content

feat(mentorship): PR7 — mentor opt-in, discovery, and recommendation surfaces - #42

Merged
indcoder merged 7 commits into
indcoder-pr5-journey-projectionsfrom
indcoder-indcoder-pr7-mentorship-growth
Jul 31, 2026
Merged

feat(mentorship): PR7 — mentor opt-in, discovery, and recommendation surfaces#42
indcoder merged 7 commits into
indcoder-pr5-journey-projectionsfrom
indcoder-indcoder-pr7-mentorship-growth

Conversation

@indcoder

Copy link
Copy Markdown
Contributor

PR7 — Mentor Opt-In, Discovery & Recommendation Surfaces

Stacked on indcoder-pr6-recommendation-audit-foundation. Closes the foundation slice for community mentorship.


What changed

Layer File(s) Summary
Core enums MentorshipStatus.cs, MentorExpertiseArea.cs Opt-in lifecycle states + 11-area expertise taxonomy
Core value object CommunityIds.cs MentorProfileId Vogen struct
Core model MentorProfile.cs Opt-in record — status, expertise areas (JSON), availability, discoverability
Core repository IMentorProfileRepository.cs GetByMemberId, GetDiscoverableMentors, Upsert
Infrastructure config MentorProfileConfiguration.cs EF config: unique index on MemberId, composite on Status+IsDiscoverable, FK → CommunityMembers
Infrastructure repo MentorProfileRepository.cs EF upsert pattern; in-memory expertise-area filter post-query
DB context BethuyaDbContext.cs +MentorProfiles DbSet
Migration 20260731160539_MentorshipOptIn MentorProfiles table + indexes
Contracts MentorshipContracts.cs MentorOptInRequest, MentorStatusUpdateRequest, MentorProfileResponse, MentorDiscoveryEntryResponse, DraftMentorPairingSuggestionRequest
Service MentorshipService.cs Opt-in/upsert, status transitions, discovery (privacy-aware), mentor-pairing recommendation draft using shared RecommendationEnvelope + Decision audit trail
Endpoints MentorshipEndpoints.cs Route group /api/community/mentorship
DI + routing Program.cs Register service + map endpoints
Tests MentorshipServiceTests.cs 11 TUnit tests

Endpoint surface

Method Route Policy
POST /api/community/mentorship/opt-in RequireAttendee
PATCH /api/community/mentorship/status RequireAttendee
GET /api/community/mentorship/my-profile RequireAttendee
GET /api/community/mentorship/discover RequireAttendee
POST /api/community/mentorship/recommendations/mentor-pairing RequireOrganizer

Test coverage (TUnit)

  • Opt-in creates profile with IsDiscoverable = true by default
  • Idempotent upsert updates existing profile
  • GetMyProfile returns null before opt-in
  • Pausing hides from discovery (IsDiscoverable = false)
  • Opting out removes from discovery
  • UpdateStatus without prior opt-in throws InvalidOperationException
  • Discovery returns only OptedIn + IsDiscoverable members
  • Expertise-area filter works correctly
  • Paused and opted-out members excluded from discovery
  • Mentor-pairing recommendation draft persists as auditable pending Decision
  • Recommendation summary reflects active mentor count
  • Availability hours clamped to [1, 40]

Reuse from earlier slices

  • CommunityMember / CommunityPassportService — member provisioning and privacy fields
  • ParticipationLedgerEntry / CommunityJourneyReadModelService — leadership-funnel signals in recommendation evidence
  • RecommendationEnvelope + Decision / IDecisionRepository — human-review-gated audit trail (PR6 schema)
  • BethuyaPolicyNamesRequireAttendee + RequireOrganizer

Validation commands

dotnet build src/Hackmum.Bethuya.Backend/Hackmum.Bethuya.Backend.csproj
dotnet test tests/Hackmum.Bethuya.Tests/Hackmum.Bethuya.Tests.csproj
# Results: 275 passed, 0 failed

indcoder and others added 4 commits July 31, 2026 20:46
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>
Copilot AI review requested due to automatic review settings July 31, 2026 16:07
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 84e0b727-1eca-42c4-bc59-0c83cf5aedc8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MentorProfile domain 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

Comment thread src/Hackmum.Bethuya.Infrastructure/Repositories/MentorProfileRepository.cs Outdated
Comment thread src/Hackmum.Bethuya.Backend/Endpoints/MentorshipEndpoints.cs
Comment thread src/Hackmum.Bethuya.Core/Enums/MentorshipStatus.cs Outdated
- 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>
Base automatically changed from indcoder-pr6-recommendation-audit-foundation to indcoder-pr5-journey-projections July 31, 2026 22:09
indcoder and others added 2 commits August 1, 2026 03:49
- 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>
@indcoder
indcoder merged commit 23ba40b into indcoder-pr5-journey-projections Jul 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants