Appearance
Affiliate Module
Mục đích
Quản lý cộng tác viên/referral: phê duyệt hồ sơ, danh sách CTV, đơn hàng giới thiệu, thanh toán và đối soát. Đây là module vận hành affiliate commerce của Diva.
Quy mô
- 10 FE pages
- 31 FE components
- 1 GraphQL file
- 4 nhóm nghiệp vụ chính
Actors & Permissions
| Nhóm chức năng | Quyền |
|---|---|
| Affiliate management | ITLeader, ITStaff |
| POS special flow | BranchPOS + module permission trong POS platform |
Feature Groups
| Group | Mô tả | Pages |
|---|---|---|
| Approval | Phê duyệt CTV / chỉnh sửa hồ sơ duyệt | approval/ApprovalList, ListCreate |
| Affiliate List | Danh sách CTV, tạo/sửa, referral detail | list/List, ListCreate, ListReferral |
| Affiliate Orders | Đơn hàng do CTV giới thiệu | order/OrderList, order/OrderDetail, order/OrderCustomerList |
| Affiliate Payments | Danh sách thanh toán, chi tiết payment | payment/PaymentList, PaymentDetail, PaymentCustomerList |
Liên kết Modules
- user — customer detail nhúng collaborator order/payment/withdraw history
- wallet — thanh toán/withdraw và ví affiliate
- ecommerce — order affiliate, referral order linkage
- report — affiliate report và customer affiliate report
- settings — affiliate policy group, tag, wallet type config
Backend Services
| Service | Vai trò |
|---|---|
| controller (Hasura) | CRUD affiliate entities và query detail |
| ecommerce-api | affiliate_user_registration, affiliate_user_change_status, get_report_affiliate |
| wallet-api | Withdraw/payment-related wallet flows |
Databases
| DB | Key tables |
|---|---|
| ecommerce | affiliate_user, order_affiliate, affiliate config/tag related tables |
| wallet | payment/withdraw transaction tables |
Đặc điểm kiến trúc
- Route root redirect khác nhau theo platform: POS có thể vào trực tiếp danh sách, còn admin flow mặc định vào approval.
- Module gắn chặt với customer detail của
uservà report drill-down củareport. - Tuy chỉ có 1 file GraphQL, module bao phủ trọn vẹn vòng đời affiliate từ duyệt đến thanh toán.
Deep Dives
- approval-and-payout — đào sâu approval CTV, order/invoice commission, payout boundary sang wallet