Mentorship: request lifecycle + capacity enforcement (Phase 6.3)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- csharp, postgresql
調査の方向性
まず dependency #9 を解決し、既存のモジュールエンドポイントとテストハーネスのパターン、特に IEndpointModule.MapEndpoints と Members/MembersTestHarness.cs を読みます。Result、ProblemDetails、モジュール所有の EF Core コンテキスト、IEmailSender がどのように使われているかを追跡します。xUnit tests で、ライフサイクル全体、認可ルール、キャパシティに関する競合状態、ページネーション、安定したエラー、そして失敗時にも安全なメール動作が網羅されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Scope
Mentee-initiated requests through to active mentorships.
Lifecycle
Pending → Accepted ⇒ ActiveMentorship | Declined(reason) | Withdrawn — then Active → Concluded (either side).
Data model
public sealed class MentorshipRequest
{
public Guid Id { get; set; }
public Guid MentorId { get; set; }
public Guid MenteeId { get; set; }
public string Message { get; set; }
public RequestStatus Status { get; set; } // Pending | Accepted | Declined | Withdrawn
public string? DeclineReason { get; set; }
}
public sealed class Mentorship
{
public Guid Id { get; set; }
public Guid MentorId { get; set; }
public Guid MenteeId { get; set; }
public MentorshipStatus Status { get; set; } // Active | Concluded
}
Endpoints (active-member policy)
| Method | Path | Notes |
|---|---|---|
| POST | /mentorship/requests |
mentee → mentor; message + goals |
| GET | /mentorship/requests/incoming / outgoing |
paginated |
| POST | /mentorship/requests/{id}/accept |
mentor only; creates Mentorship |
| POST | /mentorship/requests/{id}/decline |
mentor only; reason optional but stored |
| POST | /mentorship/requests/{id}/withdraw |
mentee only |
| GET | /mentorship/mine |
active + concluded mentorships for caller |
| POST | /mentorship/{id}/conclude |
either participant |
Rules
- Capacity on accept: active mentorships <
Capacity, else409 mentorship.at_capacity. Hitting capacity auto-setsIsAcceptingMentees = false(manual re-enable when a mentorship concludes — do not auto-flip back). - No duplicate open request to the same mentor; no self-mentorship; mentor must be accepting.
- Brevo (existing
IEmailSender, best-effort): request received → mentor; accepted/declined → mentee.
Error codes
mentorship.not_found, mentorship.at_capacity, mentorship.not_accepting, mentorship.duplicate_request, mentorship.invalid_state, mentorship.forbidden
Dependencies
Blocked by #9.
Acceptance criteria
- Full transition matrix tested incl. wrong-party actions (mentee accepting, etc.)
- Capacity race: two concurrent accepts at capacity-1 → exactly one succeeds (constraint or transaction, tested)
- Emails logged-not-thrown on failure
Conventions (project-wide, non-negotiable)
- .NET 9, records for immutable shapes, file-scoped namespaces, primary constructors where they read well. Minimal-API endpoints grouped per module via
IEndpointModule.MapEndpoints. Result<T>(SharedKernel) instead of exception-driven control flow. Endpoint results map failures to ProblemDetails with the stable error codes listed above — the frontend keys off them.- Module owns its EF Core
DbContextmapped to its own Postgres schema. Modules never reference each other's internals — cross-module needs go through a public contract interface or an in-process domain event (IEventPublisher). - All external calls (GitHub, Stripe, Brevo, Cloudinary, Meilisearch) behind interfaces owned by the consuming module.
- Every list endpoint paginated (offset is fine). xUnit tests in
tests/CommunityPro.Tests/<Module>/following the existing harness patterns (seeMembers/MembersTestHarness.cs).
- 主要言語
- C#
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CommunityPro/community-pro-api のほかの issue
-
cross-cutting decision
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
cross-cutting
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
-
admin
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
admin
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
sponsorship
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
CommunityPro/community-pro-api の issue をすべて見る
似ている issue
-
area-multitenancy area-security p1-recommended priority-high technical-debt
難易度 2/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
kind/enhancement Provider Upgrade pulumi/pulumi-azure R1 Task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
pulumi/pulumi-azure#3669 ·
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
webclient does not start対応中かも @PawelTroka が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PawelTroka/Computator.NET#257 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
eriknihlen/OpenAC#255 ·
メンテナーはふだん 1 日以内に返信