Mentorship: session booking + ICS emails (Phase 6.4)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- csharp, postgresql
- Lĩnh vực
- api, backend, backend-api-design
Hướng nghiên cứu
Trước tiên, hãy xem lại phần triển khai trong #9 và #10, sau đó tuân theo các mẫu IEndpointModule.MapEndpoints hiện có và test harness trong tests/CommunityPro.Tests/Members/MembersTestHarness.cs. Triển khai ba session endpoint và hành vi đặt lịch/email được mô tả ở đây, kèm theo các test bao quát cả hai lần chuyển đổi DST, các khoảng chồng lấn giữa các quan hệ mentoring, việc đặt lịch đồng thời và nội dung ICS được kiểm tra.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Scope
Book sessions against mentor availability, with calendar-attachment emails.
Data model
public sealed class Session
{
public Guid Id { get; set; }
public Guid MentorshipId { get; set; }
public DateTimeOffset StartUtc { get; set; } // stored UTC, always
public int DurationMinutes { get; set; } // 30 | 60
public SessionStatus Status { get; set; } // Scheduled | Completed | Cancelled
public string? MeetingUrl { get; set; } // mentor-provided free text (Meet/Zoom)
}
Endpoints (participants of the mentorship only)
| Method | Path | Notes |
|---|---|---|
| GET | /mentorship/{id}/slots?weekOf= |
open slots: availability minus existing sessions, computed in the mentor's IANA tz via NodaTime, returned as UTC instants |
| POST | /mentorship/{id}/sessions |
book; validations below |
| POST | /mentorship/sessions/{id}/cancel |
either participant, only while Scheduled |
Booking validations
- Slot falls entirely inside the mentor's availability (evaluated in mentor-local time — DST-correct via NodaTime).
- No overlap with any of the mentor's existing
Scheduledsessions (across all their mentorships). - Start ≥ 12h in the future.
- Duration ∈ {30, 60}; mentorship is
Active.
Emails
Booked/cancelled → both parties via Brevo, with an .ics attachment generated via Ical.Net (UTC times, summary, meeting URL when present). Best-effort as always.
Error codes
mentorship.not_found, mentorship.slot_unavailable, mentorship.slot_conflict, mentorship.too_soon, mentorship.invalid_state, mentorship.forbidden
Dependencies
Blocked by #9 and #10.
Acceptance criteria
- DST boundary tests are mandatory: a slot spanning a DST transition in e.g.
Europe/LondonorAmerica/New_Yorkbooks correctly; test both spring-forward and fall-back weeks - Overlap check covers sessions from the mentor's other mentorships
- Concurrent booking of the same slot → exactly one succeeds
- ICS content asserted in tests (times, attendees)
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).
- Ngôn ngữ chính
- C#
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CommunityPro/community-pro-api
-
cross-cutting decision
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
cross-cutting
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
-
admin
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
admin
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
sponsorship
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Tất cả issue của CommunityPro/community-pro-api
Issue tương tự
-
Sample solution restore fails with NU1109 (Microsoft.Extensions.Logging.Abstractions downgrade)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ardalis/CleanArchitecture#1150 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add Vigil (BofStudios/vigil)Đang mởarea:data coverage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
reacher-z/Awesome-CUA#5039 ·
Maintainer thường phản hồi trong vòng 19 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ShareX/ShareX#9002 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Facepunch/sbox-public#12305 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
分享 JVC DVD+RW 4.7G (铼德代工) 实测标定预设Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
JiaFeiMiao-K-Cat/DiscImageStudio#205 ·
Maintainer thường phản hồi trong vòng 1 ngày