Skip to content

Incentive Policy — Technical Map

Route topology

SurfaceMain wrapper / page
Commission / prepaid / expiredCommissionSetting.tsx
AffiliateAffiliateContainer.tsx + AffiliateTab.tsx
Promotion walletPromotionWallet.tsx
KPI settingKpiSetting.tsx
AchievementAchievement.tsx
Bonus / app highlightCustomerAppSetting.tsx + feature pages

Data model map

SurfaceModel chính
Service commissionrole_commission, sub_commission
Prepaid cardprepaid_card, prepaid_card_view
Expired / check-in / transition bonusdefault.app_setting keys
Promotion walletpayment_method row wallet_promotion
Affiliate generalapp_setting.app_settings.affiliate + affiliate_config
Affiliate labelaffiliate_user_tag
Affiliate policy grouppolicy, policy_branch, policy_product, policy_tag
KPI configmaster_data, master_data_type, kpi_metric
Achievementachievement
App highlight featurecms.app_highlight_feature

Boundary với module khác

ModuleBoundary kỹ thuật
ecommercepayment method, prepaid, affiliate policy, KPI metric
walletcommission source/runtime request logic
affiliateruntime referral and payout logic
reportKPI/report consumer, wallet_promotion revenue/report impact
cmsapp highlight storage/public read permission

Rủi ro / Findings kỹ thuật

MứcFinding
CaoPromotionWallet assume luôn có row đầu tiên wallet_promotion; data rỗng hoặc shape đổi sẽ dễ văng.
CaoAffiliate general dual-write vào hai nguồn dữ liệu mà không có transaction boundary.
CaoUpdatePolicyGroup xóa sạch branch/product/tag rồi insert lại, dễ để policy group ở trạng thái nửa chừng nếu fail.
CaoAppHighlightFeatureEdit có route create nhưng handler submit chưa có nhánh create rõ ràng.
Trung bìnhAppHighlightFeature permission drift so với phần còn lại của incentive policy vì mở thêm cho BranchPOS.