Bỏ qua, tới nội dung chính

Kiến trúc · ADR 0034

Community & points-economy scope (extended plan v2.1, draft M6d)

Trạng thái
proposed — Able-to; pending team/mentor sign-off (esp. the LI-6 boundary)
Ngày
2026-10-08
Người quyết định
Tín; Dương (review 06/10); mentor pending

Context

The extended feature plan (docs/spec/feature-plan-v2.1) adds organizations, a community layer and a points economy. Dương's review (06/10) re-aimed it: community contribution is sharing courses + experience blogs, not everyone authoring hosted courses; post visibility is public/private only (Facebook-style — read public without joining, join to interact); and points may be bought with money (not just earned). These features need new tables, and ADR-0020 freezes the schema after M6 (2026-11-06): "the target changes first", then one owner folds it into a migration.

Decision

  • Record the scope as an Able-to group M6d and put its tables in schema.target.prisma now (target first): Post (blog + course-share), Comment, Reaction, ContentReport, PointPurchase, plus Course.pointPrice, new PointSource/EnrollmentSource values, and 6 community enums.
  • A course-share is a post (link + rating + review): not hosted, not a RAG source, no HITL — so LI-3/4/5 are untouched. Hosted courses stay Instructor-only.
  • Points-gating is an access condition, not visibility. Points are earnable or buyable; Official UNIVERSITY-org (FPT) courses are never points-gated — official coursework stays free.
  • Money→points is kept minimal (reuses the Core payment enums; pricing/refunds deferred).
  • If accepted, the single migration owner folds M6d into the M6 migration before 06/11. The target ERD (docs/design/data-model/erd.md) is regenerated, never hand-drawn.

Alternatives considered

  • Anyone authors hosted courses. Rejected — cost (embedding/RAG), quality and HITL burden; sharing + blogs cover the intent far more cheaply.
  • Full ORG/CODE_ONLY/PRIVATE visibility for community content. Rejected — public/private is simpler and matches the "read without joining, join to interact" model.
  • Points earned-only (no purchase). Rejected — the team wants money→points for retention and to offset AI cost.

Consequences

  • Softens LI-1/6/7/9/12/13 of Report 1 (see feature-plan-v2.1 §XII); the no-cash-course-sale and official-free principles hold.
  • +5 tables / +6 enums in the target; soft-delete tables 9 → 11 (Post, Comment).
  • Still gated on the Able-to decision and the LI-6 sign-off before any live migration.

Update — 2026-10-10 · folded Thien's design (M6e)

Thien's full system design (commit 501e5f1, merged then reconciled in PR #21) is folded into the target, normalized to the target conventions. Team decision (09-10/10):

  • Blog stays on the M6d Post/Comment/Reaction set (not Thien's BlogPost suite); his richer fields were merged into Post (excerpt, coverImageUrl, viewCount, moderation hiddenBy/hiddenAt/hiddenReason).
  • Added (M6e): FlashcardDeck, Flashcard, FlashcardState, FlashcardReview (FLC-01/02), Notification, UserBadge, CommunityProfile (COM-05) + enums FlashcardRating, DeckVisibility, NotificationKind, OrgVerificationStatus; and Organization.verificationStatus (ORG-01).
  • Secondary cross-refs (course/topic/document/aiGeneration/redemption) are plain UUID columns for now; their FKs land when these tables migrate. All part of M6 (pre-freeze) if the scope is taken.