Skip to content

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 APIsale-admin, sale-application, sale-profile, sale-transition, sale-view
Query / Mutation22 / 16
Nguồn dữ liệupublic.sale_role_transfers
Bảng1
Luật phân quyền3
Đường dẫn Web Admin10

Thao tác (mutation) ​

MutationDomainMô tả
acknowledgeSaleTransitionsale-transitionThe person saw the completed result: set once on the server (the app keeps nothing locally). Conflict
activateSaleMembershipsale-adminActivate an APPROVED applicant's Sale membership and file its role grant.
approveSaleTicketsale-adminApproves the open ticket of a Sale (SL-US-04 AC01/AC02/AC06). New account:
createSalesale-adminCreates a Sale (SL-US-03 AC03): Trang thai tai khoan Khoi tao, Trang thai
rejectSaleTicketsale-adminTu choi the open ticket of a Sale (SL-US-04 AC04/AC05; owner Q-1
retrySaleTransitionsale-transitionRuns the transfer of the caller's own User request again. Idempotent: a completed transfer answers COMPLETED and
reviewSaleApplicationsale-applicationApprove or reject a PENDING application; never the reviewer's own. Requires sale_application.review (admin, super_admin) with MFA step-up.
reviewSaleProfileChangesale-profileRequires sale_profile_change.review (SPC-02). Approve applies the new
saveSaleContactsale-profileRequires profile.manage. DIRECT edit of contact email and address (SPEC-06).
setSaleAccountStatussale-adminSets one account status on the Sales ticked on the current page
setSaleAvatarsale-profileRequires profile.manage. DIRECT edit of the avatar (own READY AVATAR media).
setSaleMembershipStatussale-adminSuspend, lock or reactivate a Sale in the caller's team.
submitSaleApplicationsale-application
submitSaleProfileChangesale-profileRequires profile.manage. Files a PROFILE_CHANGE request (full name, ID
transferSaleTeamsale-adminMove a Sale between two teams the caller manages (effective now).
updateSalesale-adminSaves the edited basic information of one Sale directly, no ticket

Phép đọc (query) ​

QueryDomainMô tả
mySaleAvatarViewsale-profileRequires profile.manage (APP_SALE sale, OWN). A short-lived SIGNED view of
mySaleProfilesale-profileRequires profile.manage (APP_SALE sale, OWN). Any other caller is forbidden.
mySaleProfileChangessale-profileRequires profile.manage (APP_SALE sale, OWN). Newest submission first.
saleAffiliateOrderssale-adminDanh sach lien ket of one Sale (SL-US-02 AC06, AC07): keyword = part of
saleApplicationsale-applicationThe caller's own Sale application, or null. Applicant only.
saleApplicationssale-applicationReviewer queue, oldest first. Requires sale_application.queue_read (admin, super_admin).
saleCustomerssale-viewThe Sale's own attributed customers (masked). attribution.read (own).
saleMemberDetailsale-adminOne Sale (SL-US-02): profile, Hang, both statuses, open ticket, files.
saleMemberssale-adminThe Sale list (SL-US-01), ordered by sort (default UPDATED_DESC, most
saleMembershipsale-adminOne Sale's membership, current team and the two versions the commands
saleOrderssale-viewThe Sale's own attributed orders (buyer masked). attribution.read (own).
salePerformancesale-viewThe Sale's own period performance. attribution.read (own).
saleProfileChangesale-profileRequires sale_profile_change.read (SPC-01).
saleProfileChangessale-profileRequires sale_profile_change.read (SPC-01). Oldest submission first; never the reviewer's own.
saleQualificationsale-applicationThe caller's own live User-to-Sale qualification (UA-26 AC01: what is
saleReferralssale-adminDanh sach gioi thieu of one Sale (SL-US-02 AC05): keyword = Ho va ten
saleRejectionReasonssale-adminThe configured, active rejection reasons by display order (SL-US-04
saleTierOptionssale-adminHang of the Them nhan vien sale form (SL-US-03 AC01). Needs sale.manage (SAL-02).
saleTransitionsale-transitionThe caller's own transition (Sale App), or null when there is no application. tier.read (own).
teamCustomerssale-viewCustomers of the manager's teams. customer.read (TEAM; HISTORICAL_SNAPSHOT also report.read).
teamOrderssale-viewOrders of the manager's teams. order.read (TEAM; HISTORICAL_SNAPSHOT also report.read).
teamPerformancesale-viewPeriod performance per team on the attribution-time team. report.read (TEAM, historical).

Dữ liệu ​

Bảng được tham chiếu nhiều nhất trong module:

BảngCộtĐược trỏ tớiRLS
sale_role_transfers180✓

Quyền ​

MãQuyềnỨng dụngVai tròPhạm viTrạng thái
SAL-01sale.readWEB_ADMINadmin super_admin operations sale_managerALLPROPOSED
SAL-02sale.manageWEB_ADMINadmin super_admin sale_managerALLPROPOSED
SAL-03sale.reviewWEB_ADMINadmin super_adminALLPROPOSED

Danh sách đầy đủ và cách đọc các cờ: Ma trận quyền.

Giao diện Web Admin ​

Đường dẫnHằng số
/salesSALES
/sales/:idSALE_DETAIL
/sales/applicationsSALE_APPLICATIONS
/sales/applications/:idSALE_APPLICATION_DETAIL
/sales/newSALE_NEW
/sales/performanceSALE_PERFORMANCE
/sales/profile-changesSALE_PROFILE_CHANGES
/sales/profile-changes/:idSALE_PROFILE_CHANGE_DETAIL
/sales/teamsSALE_TEAMS
/sales/teams/:idSALE_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.

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17