Skip to content

Config And Template Surface — Technical Map

Route / page map

SurfaceMain page / shellGhi chú
Notification listNotifications.tsx + NotificationTable.tsxCó logic thật
Notification create/updateNotificationCreate.tsx + components/NotificationCreate.tsx + NotificationForm.tsxCó logic thật
Notification detailNotificationDetail.tsxCó logic thật
Notification templatesNotificationTemplates.tsx, NotificationTemplateCreate.tsx, NotificationTemplateDetail.tsxFE đang là stub
Email requestsEmails.tsx, EmailCreate.tsx, EmailDetail.tsxFE đang là stub
Email templatesEmailTemplates.tsx, EmailTemplateCreate.tsx, EmailTemplateDetail.tsxFE đang là stub

GraphQL / action map

SurfaceQuery / mutation / action chính
Notification adminGetNotifications, GetNotificationPaginations, GetNotificationByPk, UpdateNotification, DeleteNotificationByPk
Admin createSendNotifications action
Target filterGetListIdByFilter, GetNotificationMasterData
Email runtimesendEmails action -> email_request, email_template
SMS runtimesendSMS action -> sms_request, sms_template
Generic future taskscheduleTask action -> scheduled_tasks
ZNS runtimesendZns action + zns_request_insert event

Data model map

ObjectVai trò
notificationNotification request gốc cho push/in-app
notification_filterRead model cho admin table
notification_templateTemplate push/in-app
notification_trigger_conditionsMetadata / trigger binding cho template
email_request / email_templateRequest + template email
sms_request / sms_templateRequest + template SMS
zns_request / zns_template / zns_config / zns_oa_listRequest + template + config ZNS
scheduled_tasksRuntime deferred task store của v2 scheduler

Boundary với module khác

ModuleBoundary kỹ thuật
settingsNhiều template/config screen thực chất được quản trị bên settings, không nằm hết ở notification FE
userFilter target dùng account, role, branch, department, customer label/source
controller metadataPermissions/action exposure chủ yếu khai báo ở Hasura metadata, không nằm trong FE
notification-apiPush/email/SMS v1
notification-v2-apiZNS, FB/messenger, scheduled task v2

Rủi ro / Findings kỹ thuật

MứcFinding
CaoSendNotifications(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.
CaoNotificationStatus.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.
CaosendEmails, 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ìnhnotification template / email / email template FE pages vẫn là stub dù metadata tables/actions đã mở đầy đủ.
Trung bìnhnavigation block của module.ts bị comment, nên discoverability của admin surface phụ thuộc route direct-link.