Skip to content

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ăngQuyền
Affiliate managementITLeader, ITStaff
POS special flowBranchPOS + module permission trong POS platform

Feature Groups

GroupMô tảPages
ApprovalPhê duyệt CTV / chỉnh sửa hồ sơ duyệtapproval/ApprovalList, ListCreate
Affiliate ListDanh sách CTV, tạo/sửa, referral detaillist/List, ListCreate, ListReferral
Affiliate OrdersĐơn hàng do CTV giới thiệuorder/OrderList, order/OrderDetail, order/OrderCustomerList
Affiliate PaymentsDanh sách thanh toán, chi tiết paymentpayment/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

ServiceVai trò
controller (Hasura)CRUD affiliate entities và query detail
ecommerce-apiaffiliate_user_registration, affiliate_user_change_status, get_report_affiliate
wallet-apiWithdraw/payment-related wallet flows

Databases

DBKey tables
ecommerceaffiliate_user, order_affiliate, affiliate config/tag related tables
walletpayment/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 user và report drill-down của report.
  • 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