Appearance
Campaign And Voucher Operations — Technical Map
Route / page map
| Surface | Main page / shell | Ghi chú |
|---|---|---|
| Campaign list | Campaigns.tsx | Mounted |
| Campaign detail | CampaignDetail.tsx | Mounted |
| Campaign create | CampaignCreate.tsx | File có thật, route create trong module.ts đang comment |
| Voucher shell | components/voucher/VoucherContainer.tsx | Mounted dưới /cms/voucher-management |
| Voucher overview/create/detail | components/voucher/vouchers/* | Mounted |
| Voucher campaign overview/create/update/detail | components/voucher/voucher-campaign/* | Mounted |
GraphQL / action map
| Surface | Query / mutation / action chính |
|---|---|
| Campaign | campaign, campaign_product, CreateCampaigns, UpdateCampaignByPk |
| Voucher campaign draft | createDraftVoucherCampaign action |
| Voucher campaign approve | approveVoucherCampaign action |
| Voucher campaign status | changeVoucherCampaignStatus action |
| Voucher activation | activateVoucher, activateOfflineVoucher |
printVoucher | |
| Analytics | search_voucher_campaign_summary, get_voucher_analytics_summary, get_voucher_distribution_by_date, user_vouchers_with_usage |
| Logs | voucher_campaigns_logs |
Permission / module boundary map
| Surface | Config signal |
|---|---|
| Campaign thường | moduleId = campaign, permissions gần moderatorConfig |
| Voucher management | moduleId = voucher_management, permissions rộng hơn nhiều team (BOD, accounting, CS, HR, telesales...) |
| Voucher create/update | voucherFullConfig hẹp hơn detail/list |
Rủi ro / Findings kỹ thuật
| Mức | Finding |
|---|---|
| Cao | ROUTE_CAMPAIGN_CREATE và route create/update subtree của campaign trong module.ts đang comment, nhưng Campaigns.tsx vẫn chứa logic popup, import CampaignCreate, và còn check route names gồm cả ROUTE_CAMPAIGN_CREATE. Đây là drift thật giữa route config và implementation. |
| Cao | Campaign CRUD cổ điển làm trực tiếp trên bảng campaign, còn voucher campaign lifecycle đi qua Hasura actions ở ecommerce-api; cùng một nhóm menu nhưng hai execution model khác nhau. |
| Trung bình | changeVoucherCampaignStatus có state machine backend rõ, nhưng FE level rất dễ nhìn nó như toggle publish đơn giản nếu chỉ đọc UI. |
| Trung bình | CampaignCreate.tsx set published_at: new Date() ngay lúc create mới; semantics draft/publish của campaign cổ điển khác hẳn voucher campaign draft engine. |