Appearance
Config And Template Surface — Technical Map
Route / page map
| Surface | Main page / shell | Ghi chú |
|---|---|---|
| Notification list | Notifications.tsx + NotificationTable.tsx | Có logic thật |
| Notification create/update | NotificationCreate.tsx + components/NotificationCreate.tsx + NotificationForm.tsx | Có logic thật |
| Notification detail | NotificationDetail.tsx | Có logic thật |
| Notification templates | NotificationTemplates.tsx, NotificationTemplateCreate.tsx, NotificationTemplateDetail.tsx | FE đang là stub |
| Email requests | Emails.tsx, EmailCreate.tsx, EmailDetail.tsx | FE đang là stub |
| Email templates | EmailTemplates.tsx, EmailTemplateCreate.tsx, EmailTemplateDetail.tsx | FE đang là stub |
GraphQL / action map
| Surface | Query / mutation / action chính |
|---|---|
| Notification admin | GetNotifications, GetNotificationPaginations, GetNotificationByPk, UpdateNotification, DeleteNotificationByPk |
| Admin create | SendNotifications action |
| Target filter | GetListIdByFilter, GetNotificationMasterData |
| Email runtime | sendEmails action -> email_request, email_template |
| SMS runtime | sendSMS action -> sms_request, sms_template |
| Generic future task | scheduleTask action -> scheduled_tasks |
| ZNS runtime | sendZns action + zns_request_insert event |
Data model map
| Object | Vai trò |
|---|---|
notification | Notification request gốc cho push/in-app |
notification_filter | Read model cho admin table |
notification_template | Template push/in-app |
notification_trigger_conditions | Metadata / trigger binding cho template |
email_request / email_template | Request + template email |
sms_request / sms_template | Request + template SMS |
zns_request / zns_template / zns_config / zns_oa_list | Request + template + config ZNS |
scheduled_tasks | Runtime deferred task store của v2 scheduler |
Boundary với module khác
| Module | Boundary kỹ thuật |
|---|---|
settings | Nhiều template/config screen thực chất được quản trị bên settings, không nằm hết ở notification FE |
user | Filter target dùng account, role, branch, department, customer label/source |
controller metadata | Permissions/action exposure chủ yếu khai báo ở Hasura metadata, không nằm trong FE |
notification-api | Push/email/SMS v1 |
notification-v2-api | ZNS, FB/messenger, scheduled task v2 |
Rủi ro / Findings kỹ thuật
| Mức | Finding |
|---|---|
| Cao | SendNotifications(save: true) insert vào notification, nhưng bảng notification lại có event trigger notification_send trên insert; handler sendNotification() gửi ngay và không check send_after. Điều này cho thấy semantics "schedule sau" của admin surface đang drift với implementation thực. |
| Cao | NotificationStatus.tsx, filter status trong NotificationTable.tsx, và isSent trong NotificationDetail.tsx đều suy luận trạng thái từ send_after <= now, không dựa trên sent_at hay response. UI status vì thế có thể lệch với delivery thật. |
| Cao | sendEmails, sendSMS, sendNotifications, sendZns, scheduleTask đều được metadata cấp cho role user, trong khi FE admin routes chỉ mở cho IT. Suy luận từ source: enforcement admin-only đang nằm ở UI nhiều hơn ở metadata layer. |
| Trung bình | notification template / email / email template FE pages vẫn là stub dù metadata tables/actions đã mở đầy đủ. |
| Trung bình | navigation block của module.ts bị comment, nên discoverability của admin surface phụ thuộc route direct-link. |