Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Mentorship: request lifecycle + capacity enforcement (Phase 6.3)

オープン
#10 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp, postgresql

調査の方向性

まず dependency #9 を解決し、既存のモジュールエンドポイントとテストハーネスのパターン、特に IEndpointModule.MapEndpoints と Members/MembersTestHarness.cs を読みます。Result、ProblemDetails、モジュール所有の EF Core コンテキスト、IEmailSender がどのように使われているかを追跡します。xUnit tests で、ライフサイクル全体、認可ルール、キャパシティに関する競合状態、ページネーション、安定したエラー、そして失敗時にも安全なメール動作が網羅されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

mentorship

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, else 409 mentorship.at_capacity. Hitting capacity auto-sets IsAcceptingMentees = 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 DbContext mapped 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 (see Members/MembersTestHarness.cs).
主要言語
C#
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CommunityPro/community-pro-api のほかの issue

CommunityPro/community-pro-api の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。