Skip to main content

Tính năng nghiệp vụ


1. Quản lý phân cấp

Super Agent quản lý cây Agents → Shops → Players:

flowchart TB
SA[Super Agent] --> A1[Agent 1]
SA --> A2[Agent 2]
A1 --> S1[Shop A]
A1 --> S2[Shop B]
S1 --> P1[Player]
ActionAPI
Di chuyển shop sang agent khácPATCH /super-agent/shops/:id/move
Di chuyển player sang shop khácPATCH /super-agent/players/:id/move
Suspend/unsuspend agentPATCH .../agents/:id/suspend|unsuspend

2. Tạo & cấu hình Agent

Tạo agent mới tại /agents/new:

  • Username, email, password, cost rate
  • Popup permissions
  • Game mappings

Chi tiết agent (/agents/:agentId):

  • Cập nhật rate, password, tên
  • Phân phối/rút credit
  • Bật/tắt game providers

3. Ví & Credit

Mua credit

  • Crypto (Zerox static wallets) hoặc USD → credits
  • Payment return: /payment/return

Phân phối credit

LuồngAPI
Super Agent → Managed AgentPOST /super-agent/agents/:id/credits/distribute
Super Agent → ShopPOST /agent/credits/distribute
Rút từ agentPOST /super-agent/agents/:id/credits/withdraw

4. Shop governance

  • Tạo shop (POST /agent/shops)
  • Suspend/unsuspend, đổi password, popup permission
  • Xem CDN wallet + USD wallet ledger riêng
  • Cập nhật cost rate (PATCH /super-agent/shops/:id/rates)

5. Rút USD crypto

Luồng tương tự Agent Portal:

  1. Kiểm tra OTP eligibility
  2. Gửi/verify OTP
  3. Preview phí
  4. Tạo withdrawal

Giới hạn: GET /super-agent/portal-withdrawal-limits


6. Fraud & Communication

  • Fraud: filter theo shop, profit analysis, resolve
  • Broadcast: nhận qua bell, gửi nếu can_delegate_popups
  • Popup: modes once / sticky_daily

7. So sánh với Agent Portal

Tính năngSuper AgentAgent
Quản lý agents✅ Tạo, suspend, rates
Di chuyển shop/player
Quản lý shops✅ Toàn hệ thống✅ Shops của mình
Tạo shop
Game mappings (agent level)✅ (shop level)
Provider feesRead-onlyRead-only

Ghi chú triển khai

  1. Port dev 3003 — tránh clash admin (3000); lưu ý agent cũng dùng 3003 trong .env.example.
  2. API prefix /super-agent-auth/super-agent/* — không dùng /agent-auth.
  3. README repo có thể mô tả cũ — ưu tiên code thực tế.
  4. Backend CORS: thêm domain vào bảng domains hoặc DISABLE_CORS=true khi dev.