Appearance
Projects Task Lifecycle And Tour Income Deep Dive
Bộ tài liệu này đào sâu flow projects-task-lifecycle-and-tour-income theo code thực tế hiện tại. Đây là package reverse-engineer trong docs/modules, không phải PRD/spec delivery. Batch này được làm theo hướng audit sâu vì module projects có dấu hiệu drift và lỗi runtime nhiều hơn mức bình thường:
- route tree và navigation đang lẫn giữa
task_managementvới một entryHoàn Tiềnkhông cùng domain (diva-admin/src/modules/projects/module.ts:223), - FE helper/constant có lỗi logic thật ở assignee mapping và naming (
diva-admin/src/modules/projects/compositions/useTaskHelper.ts:108,diva-admin/src/modules/projects/components/TaskForm/index.tsx:577,diva-admin/src/modules/projects/types.ts:64), - backend event
project_task_insertvàproject_task_update_1chứa ít nhất 2 bug có khả năng làm sai dữ liệu commission và customer visit (diva-backend/services/ecommerce-api/event/project_task_insert.go:223,diva-backend/services/ecommerce-api/event/project_task_update_1.go:236), - scheduler
reset_taskcó side effect mạnh hơn nhiều so với tên gọi vì vừa reset status vừa xóa assignee (diva-backend/services/ecommerce-api/scheduler/reset_task.go:82).
Đọc file nào?
| Bạn là ai? | Nên đọc trước | Mục tiêu |
|---|---|---|
| PO / BA | shared-rules.md | Chốt status dialect, assignee roles, scheduler side effects, ranh giới tour income |
| FE Dev | type-project-task-lifecycle-and-assignment.md | Hiểu route tree, form create/update, quick view, scope builders, bug helper |
| BE Dev | type-tour-income-kpi-and-report-boundary.md, type-task-log-comment-file-and-status-events.md | Hiểu event chain, scheduler, doctor commission, KPI/salary/customer-note coupling |
| QA | shared-rules.md, type-tour-income-kpi-and-report-boundary.md | Thiết kế test theo lifecycle, side effects, known bugs |
| Người mới vào hệ thống | module-overview.md | Có bản đồ tổng trước khi đi sâu từng runtime |
Files
| File | Vai trò |
|---|---|
| module-overview.md | Bản đồ tổng: project shell vs task runtime, event/scheduler map, findings ưu tiên cao |
| shared-rules.md | Thuật ngữ chuẩn, status matrix, role matrix, scheduler matrix, invariants |
| type-project-task-lifecycle-and-assignment.md | Deep dive cho route tree, create/update/detail/quick-view, scope và permission logic |
| type-task-log-comment-file-and-status-events.md | Deep dive cho task log, comment notifications, file mirroring và cron side effects |
| type-tour-income-kpi-and-report-boundary.md | Deep dive cho tour money, doctor commission, KPI/salary/report coupling và bug runtime |
Kết luận ngắn
projectstrên UI nhìn như project management, nhưng engine thật nằm gần như hoàn toàn ởproject_task,project_task_assigneevà các event/scheduler phíaecommerce-api.- Module đang chạy đồng thời 2 dialect status: automate board dùng
new_branch/waiting_branch/inprogress_branch/done_branch, còn personal/task views lại map quanew/reopen/inprogress/reviewing/completed/missed. tour_moneykhông chỉ là field hiển thị. Mỗi lần đổi giá trị có thể chạmecommerce_task_log, salary runtime, customer note metadata, KPI log và report tour limit.- Có lỗi thật cần ưu tiên kiểm tra sản phẩm:
- cancel doctor commission request đang update sai
request_working_schedule.id = projectTask.IDthay vì request id/reference (project_task_insert.go:223), - insert
all_customer_visitskhi task chuyểndone_branchlại dùngtime.Now()thay vìtaskNew.DoneAt, dễ ghi lệch ngày visit (project_task_update_1.go:242), - helper lấy assigner ids đang trả nhầm supporter ids (
useTaskHelper.ts:115).
- cancel doctor commission request đang update sai
Liên kết tài liệu liên quan
- docs/modules/projects/overview.md
- docs/modules/projects/projects.md
- docs/modules/projects/projects.technical.md
- docs/modules/ecommerce/overview.md
- docs/modules/report/operations-and-performance.md
- docs/modules/report/inventory-product-and-prepaid.md
- docs/modules/kpi/deep-dives/lifecycle-and-notification/README.md
- docs/modules/phase-2-backlog.md
Phạm vi của bộ docs này
- Bám theo code hiện tại của
diva-admin,ecommerce-api, Hasura metadata và các bảng domainproject/ecommerce/hrm. - Ưu tiên mô tả hệ thống đang chạy như thế nào thay vì flow lý tưởng.
- Chủ động ghi drift, technical debt và bug candidates nếu chúng có bằng chứng cụ thể trong source.