Skip to content

Khách hàng ​

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ì ​

Danh bạ khách hàng và nhóm khách hàng. Số điện thoại chỉ hiện đầy đủ với người có quyền đọc dữ liệu cá nhân; khách được dán nhãn "Sale" chỉ khi tài khoản Sale của họ đang hoạt động hoặc bị khoá.

Quy mô ​

Domain APIcustomer
Query / Mutation8 / 6
Nguồn dữ liệucustomer
Bảng6
Luật phân quyền6
Đường dẫn Web Admin6

Thao tác (mutation) ​

MutationDomainMô tả
deleteCustomerGroupcustomerSoft-delete a non-default group after moving its customers to the default (NKH-US-03).
exportCustomerscustomerExport every customer matching the filter (all pages, 21 columns, personal
saveCustomercustomerEdit group/status/description/tags of one customer (KH-US-03).
saveCustomerColumnPreferencecustomerSave the calling Admin's customer-list columns ("Áp dụng", AC18; "Đặt lại
saveCustomerGroupcustomerCreate or edit a customer group, optionally making it the default (NKH-US-02).
transferCustomerGroupcustomerMove customers to one group, all or nothing (KH-US-01).

Phép đọc (query) ​

QueryDomainMô tả
customercustomerOne customer (not found and out of scope look the same). Requires customer.read.
customerColumnPreferencecustomerThe calling Admin's customer-list columns, or the default when none are saved (AC16, AC20). Requires customer.read.
customerGroupAvailabilitycustomerCode/name already used by another live group (deleted groups do not count). Requires customer_group.write.
customerGroupscustomerLive customer groups with their counts (NK-US-01); search is partial and
customerOrderscustomerPurchase history of one customer (KH-US-03 AC07): every status, newest
customerscustomerUser App customers only (Rule #1), all filter conditions AND. Order by
customerTierOptionscustomerU6-P3-28 Tier filter options: USER Tiers in force (Loyalty), Standard included, by rank. Requires customer.read.
provincescustomerU6-P3-28 Province / City catalogue of the address filter: the 34 provincial-level units, by name (NEW-KH-13, Q-11). Requires customer.read.

Dữ liệu ​

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

BảngCộtĐược trỏ tớiRLS
customer_groups141✓
customer_codes40✓
customer_column_preferences60✓
customer_group_memberships100✓
customer_profiles80✓
provinces40✓

Quyền ​

MãQuyềnỨng dụngVai tròPhạm viTrạng thái
M-01customer.readWEB_ADMINsale_managerTEAMDEFINED
O-01customer.readWEB_ADMINoperations adminALLPROPOSED
O-04customer.exportWEB_ADMINoperations adminALLPROPOSED
OPS-03customer.writeWEB_ADMINoperations adminALLPROPOSED
S-01customer.readAPP_SALEsaleASSIGNEDDEFINED
X-01customer.export.approveWEB_ADMINadminALLPROPOSED

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ố
/customersCUSTOMERS
/customers/:idCUSTOMER_DETAIL
/customers/:id/editCUSTOMER_EDIT
/customers/ekyc-requestsCUSTOMER_EKYC_REQUESTS
/customers/groupsCUSTOMER_GROUPS
/customers/privacy-requestsCUSTOMER_PRIVACY_REQUESTS

File nguồn ​

Backend:

  • code/apps/api/supabase/functions/graphql/domains/customer/

Dữ liệu: bảng thuộc domain customer — xem Cơ sở dữ liệu.

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17