Skip to content

Mô hình dữ liệu (D1) ​

Một brand = một dòng trong brands; mọi thứ còn lại trỏ về nó bằng brand_id. Vì vậy thêm brand không cần thêm bảng hay code.

text
erDiagram
  brands ||--o{ sessions : "lịch cố định"
  brands ||--o{ agenda_items : "agenda (nhiều variant)"
  brands ||--o{ tasks : "checklist theo thứ"
  tasks  ||--o{ task_checks : "tick theo tuần"
  brands ||--o{ risks : ""
  brands ||--o{ rubrics : "5 tiêu chí"
  brands ||--o{ reflections : ""
  brands ||--o{ actions : "action items"
BảngTrường chínhGhi chú
brandsslug, name, grp, tagline, color, status, cadence, venue, audience, owner, notes, goals[], success[], links[], extra{}, fields[]status: active · draft · paused. extra = giá trị trường bổ sung của brand; fields = định nghĩa trường, chỉ dùng ở dòng _template. Brand _template là template gốc
sessionsbrand_id, weekday (1=Thứ 2 … 7=CN), start, end, formatNguồn của khối màu trên lịch tuần
agenda_itemsbrand_id, variant, start, end, goal, activity, content, host, sortvariant nhóm các mục (vd "Học thử", "Chính thức")
tasksbrand_id, phase (before/during/after), weekday, time, title, detail, ownerMẫu lặp lại hằng tuần
task_checkstask_id, week (ngày Thứ 2 của tuần), done_byCó dòng = đã xong trong tuần đó
risksbrand_id, grp, level 1–3, risk, mitigation, pic
rubricsbrand_id, criterion, levels[5], score 0–5score là điểm tự chấm hiện tại
reflectionsbrand_id, date, author, title, keep, improve, next
actionsbrand_id, text, owner, due, statusstatus: open · done

API (Pages Functions) ​

GET /api/bootstrap?week=YYYY-MM-DDToàn bộ dữ liệu + tick của tuần
POST/PUT/DELETE /api/<bảng>[/<id>]CRUD cho 8 bảng ở trên (chỉ cho phép các cột được khai báo)
POST /api/brandsTạo brand và sao chép checklist, rủi ro, agenda khung, rubrics từ _template
POST /api/checks{task_id, week, done}

Tài liệu nội bộ dành cho mentor Nemo12.