Giao diện
Sale
Trang sinh tự động
Phần nghiệp vụ viết tay; API, dữ liệu, quyền, đường dẫn và file nguồn do bộ sinh điền từ source tại ad83b0aea.
Làm gì
Hồ sơ Sale, phiếu ứng tuyển và phiếu đổi thông tin (đều cần duyệt), team và chuyển team, hiệu suất và hoa hồng. Trạng thái tài khoản Sale và trạng thái phiếu là hai thứ khác nhau.
Quy mô
| Domain API | sale-admin, sale-application, sale-profile, sale-transition, sale-view |
| Query / Mutation | 22 / 16 |
| Nguồn dữ liệu | public.sale_role_transfers |
| Bảng | 1 |
| Luật phân quyền | 3 |
| Đường dẫn Web Admin | 10 |
Thao tác (mutation)
| Mutation | Domain | Mô tả |
|---|---|---|
acknowledgeSaleTransition | sale-transition | The person saw the completed result: set once on the server (the app keeps nothing locally). Conflict |
activateSaleMembership | sale-admin | Activate an APPROVED applicant's Sale membership and file its role grant. |
approveSaleTicket | sale-admin | Approves the open ticket of a Sale (SL-US-04 AC01/AC02/AC06). New account: |
createSale | sale-admin | Creates a Sale (SL-US-03 AC03): Trang thai tai khoan Khoi tao, Trang thai |
rejectSaleTicket | sale-admin | Tu choi the open ticket of a Sale (SL-US-04 AC04/AC05; owner Q-1 |
retrySaleTransition | sale-transition | Runs the transfer of the caller's own User request again. Idempotent: a completed transfer answers COMPLETED and |
reviewSaleApplication | sale-application | Approve or reject a PENDING application; never the reviewer's own. Requires sale_application.review (admin, super_admin) with MFA step-up. |
reviewSaleProfileChange | sale-profile | Requires sale_profile_change.review (SPC-02). Approve applies the new |
saveSaleContact | sale-profile | Requires profile.manage. DIRECT edit of contact email and address (SPEC-06). |
setSaleAccountStatus | sale-admin | Sets one account status on the Sales ticked on the current page |
setSaleAvatar | sale-profile | Requires profile.manage. DIRECT edit of the avatar (own READY AVATAR media). |
setSaleMembershipStatus | sale-admin | Suspend, lock or reactivate a Sale in the caller's team. |
submitSaleApplication | sale-application | |
submitSaleProfileChange | sale-profile | Requires profile.manage. Files a PROFILE_CHANGE request (full name, ID |
transferSaleTeam | sale-admin | Move a Sale between two teams the caller manages (effective now). |
updateSale | sale-admin | Saves the edited basic information of one Sale directly, no ticket |
Phép đọc (query)
| Query | Domain | Mô tả |
|---|---|---|
mySaleAvatarView | sale-profile | Requires profile.manage (APP_SALE sale, OWN). A short-lived SIGNED view of |
mySaleProfile | sale-profile | Requires profile.manage (APP_SALE sale, OWN). Any other caller is forbidden. |
mySaleProfileChanges | sale-profile | Requires profile.manage (APP_SALE sale, OWN). Newest submission first. |
saleAffiliateOrders | sale-admin | Danh sach lien ket of one Sale (SL-US-02 AC06, AC07): keyword = part of |
saleApplication | sale-application | The caller's own Sale application, or null. Applicant only. |
saleApplications | sale-application | Reviewer queue, oldest first. Requires sale_application.queue_read (admin, super_admin). |
saleCustomers | sale-view | The Sale's own attributed customers (masked). attribution.read (own). |
saleMemberDetail | sale-admin | One Sale (SL-US-02): profile, Hang, both statuses, open ticket, files. |
saleMembers | sale-admin | The Sale list (SL-US-01), ordered by sort (default UPDATED_DESC, most |
saleMembership | sale-admin | One Sale's membership, current team and the two versions the commands |
saleOrders | sale-view | The Sale's own attributed orders (buyer masked). attribution.read (own). |
salePerformance | sale-view | The Sale's own period performance. attribution.read (own). |
saleProfileChange | sale-profile | Requires sale_profile_change.read (SPC-01). |
saleProfileChanges | sale-profile | Requires sale_profile_change.read (SPC-01). Oldest submission first; never the reviewer's own. |
saleQualification | sale-application | The caller's own live User-to-Sale qualification (UA-26 AC01: what is |
saleReferrals | sale-admin | Danh sach gioi thieu of one Sale (SL-US-02 AC05): keyword = Ho va ten |
saleRejectionReasons | sale-admin | The configured, active rejection reasons by display order (SL-US-04 |
saleTierOptions | sale-admin | Hang of the Them nhan vien sale form (SL-US-03 AC01). Needs sale.manage (SAL-02). |
saleTransition | sale-transition | The caller's own transition (Sale App), or null when there is no application. tier.read (own). |
teamCustomers | sale-view | Customers of the manager's teams. customer.read (TEAM; HISTORICAL_SNAPSHOT also report.read). |
teamOrders | sale-view | Orders of the manager's teams. order.read (TEAM; HISTORICAL_SNAPSHOT also report.read). |
teamPerformance | sale-view | Period performance per team on the attribution-time team. report.read (TEAM, historical). |
Dữ liệu
- Một bảng:
sale_role_transfers— thuộc domainloyalty, nhómkhác
Bảng được tham chiếu nhiều nhất trong module:
| Bảng | Cột | Được trỏ tới | RLS |
|---|---|---|---|
sale_role_transfers | 18 | 0 | ✓ |
Quyền
| Mã | Quyền | Ứng dụng | Vai trò | Phạm vi | Trạng thái |
|---|---|---|---|---|---|
SAL-01 | sale.read | WEB_ADMIN | admin super_admin operations sale_manager | ALL | PROPOSED |
SAL-02 | sale.manage | WEB_ADMIN | admin super_admin sale_manager | ALL | PROPOSED |
SAL-03 | sale.review | WEB_ADMIN | admin super_admin | ALL | PROPOSED |
Danh sách đầy đủ và cách đọc các cờ: Ma trận quyền.
Giao diện Web Admin
| Đường dẫn | Hằng số |
|---|---|
/sales | SALES |
/sales/:id | SALE_DETAIL |
/sales/applications | SALE_APPLICATIONS |
/sales/applications/:id | SALE_APPLICATION_DETAIL |
/sales/new | SALE_NEW |
/sales/performance | SALE_PERFORMANCE |
/sales/profile-changes | SALE_PROFILE_CHANGES |
/sales/profile-changes/:id | SALE_PROFILE_CHANGE_DETAIL |
/sales/teams | SALE_TEAMS |
/sales/teams/:id | SALE_TEAM_DETAIL |
File nguồn
Backend:
code/apps/api/supabase/functions/graphql/domains/sale-admin/code/apps/api/supabase/functions/graphql/domains/sale-application/code/apps/api/supabase/functions/graphql/domains/sale-profile/code/apps/api/supabase/functions/graphql/domains/sale-transition/code/apps/api/supabase/functions/graphql/domains/sale-view/
Dữ liệu: bảng thuộc domain public.sale_role_transfers — xem Cơ sở dữ liệu.