Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Mentorship: mentor profiles + availability model (Phase 6.1, 6.2)

Aperta
#9 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
csharp, postgres
Ambito
api, backend, databases

Direzione di ricerca

Inizia leggendo Members/MembersTestHarness.cs e MemberProfileService per comprendere le convenzioni di validazione e test, quindi segui IEndpointModule.MapEndpoints e il modello del contesto EF Core di proprietà del modulo. Il lavoro è completo quando sia gli endpoint del profilo sia quelli per la sostituzione completa delle disponibilità applicano le regole elencate, usano codici di errore Result stabili, convalidano i fusi orari IANA con NodaTime e la matrice di validazione xUnit ha esito positivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

mentorship

Scope

New CommunityPro.Mentorship module (schema mentorship): mentor opt-in and weekly availability. This is the foundation ticket — model + timezone groundwork; requests/booking build on it.

Data model

public sealed class MentorProfile
{
    public Guid MemberId { get; set; }            // == AppUser.Id
    public string Headline { get; set; }
    public string TimezoneId { get; set; }        // IANA id, e.g. "Africa/Lagos" — validate against NodaTime TZDB
    public List<string> ExpertiseTags { get; set; }
    public int Capacity { get; set; }             // max concurrent mentees
    public bool IsAcceptingMentees { get; set; }  // auto-false at capacity, manual toggle too
}

public sealed class AvailabilitySlot
{
    public Guid Id { get; set; }
    public Guid MentorId { get; set; }
    public DayOfWeek Day { get; set; }
    public TimeOnly Start { get; set; }           // local to MentorProfile.TimezoneId
    public TimeOnly End { get; set; }
}

Endpoints (prefix /mentorship, active-member policy)

Method Path Notes
PUT /mentorship/mentors/me upsert opt-in: headline, timezone, tags, capacity, accepting toggle
PUT /mentorship/mentors/me/availability replace-all slot list

Rules

  • Use NodaTime for all timezone work — validate TimezoneId against the TZDB; do not hand-roll DST math (this module's #1 gotcha; Lagos is UTC+1 year-round but mentors/mentees won't all be).
  • Slot validation: End > Start, no overlapping slots on the same day, sane bounds (e.g. 15-min granularity).
  • Capacity ≥ 1, tags length-capped and deduped (mirror the skills validation in MemberProfileService).
  • Mentor is a flag in this module, not an Identity role.

Error codes

mentorship.invalid_profile, mentorship.invalid_timezone, mentorship.invalid_slots

Acceptance criteria

  • Invalid IANA id rejected; valid exotic ones (e.g. Pacific/Chatham) accepted
  • Overlapping/inverted slots rejected
  • Availability replace-all is transactional
  • xUnit coverage for validation matrix
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).
Lingua principale
C#
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CommunityPro/community-pro-api

Tutte le issue di CommunityPro/community-pro-api

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.