Appearance
KPI Module
Mục đích
Quản lý KPI nghiệp vụ: tạo KPI, theo dõi tiến độ, cập nhật trạng thái và xem chi tiết thực hiện. Đây là module tác nghiệp, khác với report KPI ở chỗ nó quản lý đối tượng KPI gốc.
Quy mô
- 4 FE pages
- 107 FE components
- 1 GraphQL file
- 4 nhóm nghiệp vụ chính
Actors & Permissions
| Nhóm chức năng | Quyền |
|---|---|
| KPI management | KPI_PERMISSIONS |
| Navigation | "Quản lý KPI" với icon riêng |
Feature Groups
| Group | Mô tả | Pages |
|---|---|---|
| KPI List | Danh sách KPI, filter, trạng thái | KPIs.tsx |
| KPI Create | Tạo KPI mới | KPICreate.tsx |
| KPI Detail | Xem KPI, các tab/detail phụ | KPIDetail.tsx |
| KPI Update | Cập nhật tiến độ, trạng thái, thời gian | KPIUpdate.tsx |
Liên kết Modules
- settings — KPI config và metric setup nằm ở settings
- report — report KPI đọc dữ liệu KPI để tổng hợp
- dashboard — một số dashboard/rank có liên quan KPI
- user — participant, assignee, branch, role dimensions
Backend Services
| Service | Vai trò |
|---|---|
| controller (Hasura) | CRUD KPI entities |
| ecommerce-api | Event handlers kpi_branch_*, kpi_staff_*, scheduler kpi_notification |
Databases
| DB | Key tables |
|---|---|
| ecommerce | kpi, kpi_metric, kpi_metric_relation, kpi_metric_relation_log, participant-related tables |
| default | module/permission metadata cho KPI |
Đặc điểm kiến trúc
- Module chỉ có 4 page nhưng số component rất cao, cho thấy phần lớn độ phức tạp nằm ở forms, progress, status và nested detail UI.
KPIDetailcó nhiều redirect/tab children trong route tree dù bên ngoài chỉ nhìn thấy một page detail.- KPI lifecycle được hỗ trợ bởi backend events/schedulers, không chỉ là CRUD thuần.
Deep Dives
- lifecycle-and-notification — computed lifecycle, progress runtime qua KPI logs, event/scheduler notification và
kpi_permissionboundary