Giao diện
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 API | customer |
| Query / Mutation | 8 / 6 |
| Nguồn dữ liệu | customer |
| Bảng | 6 |
| Luật phân quyền | 6 |
| Đường dẫn Web Admin | 6 |
Thao tác (mutation)
| Mutation | Domain | Mô tả |
|---|---|---|
deleteCustomerGroup | customer | Soft-delete a non-default group after moving its customers to the default (NKH-US-03). |
exportCustomers | customer | Export every customer matching the filter (all pages, 21 columns, personal |
saveCustomer | customer | Edit group/status/description/tags of one customer (KH-US-03). |
saveCustomerColumnPreference | customer | Save the calling Admin's customer-list columns ("Áp dụng", AC18; "Đặt lại |
saveCustomerGroup | customer | Create or edit a customer group, optionally making it the default (NKH-US-02). |
transferCustomerGroup | customer | Move customers to one group, all or nothing (KH-US-01). |
Phép đọc (query)
| Query | Domain | Mô tả |
|---|---|---|
customer | customer | One customer (not found and out of scope look the same). Requires customer.read. |
customerColumnPreference | customer | The calling Admin's customer-list columns, or the default when none are saved (AC16, AC20). Requires customer.read. |
customerGroupAvailability | customer | Code/name already used by another live group (deleted groups do not count). Requires customer_group.write. |
customerGroups | customer | Live customer groups with their counts (NK-US-01); search is partial and |
customerOrders | customer | Purchase history of one customer (KH-US-03 AC07): every status, newest |
customers | customer | User App customers only (Rule #1), all filter conditions AND. Order by |
customerTierOptions | customer | U6-P3-28 Tier filter options: USER Tiers in force (Loyalty), Standard included, by rank. Requires customer.read. |
provinces | customer | U6-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ảng | Cột | Được trỏ tới | RLS |
|---|---|---|---|
customer_groups | 14 | 1 | ✓ |
customer_codes | 4 | 0 | ✓ |
customer_column_preferences | 6 | 0 | ✓ |
customer_group_memberships | 10 | 0 | ✓ |
customer_profiles | 8 | 0 | ✓ |
provinces | 4 | 0 | ✓ |
Quyền
| Mã | Quyền | Ứng dụng | Vai trò | Phạm vi | Trạng thái |
|---|---|---|---|---|---|
M-01 | customer.read | WEB_ADMIN | sale_manager | TEAM | DEFINED |
O-01 | customer.read | WEB_ADMIN | operations admin | ALL | PROPOSED |
O-04 | customer.export | WEB_ADMIN | operations admin | ALL | PROPOSED |
OPS-03 | customer.write | WEB_ADMIN | operations admin | ALL | PROPOSED |
S-01 | customer.read | APP_SALE | sale | ASSIGNED | DEFINED |
X-01 | customer.export.approve | WEB_ADMIN | 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ố |
|---|---|
/customers | CUSTOMERS |
/customers/:id | CUSTOMER_DETAIL |
/customers/:id/edit | CUSTOMER_EDIT |
/customers/ekyc-requests | CUSTOMER_EKYC_REQUESTS |
/customers/groups | CUSTOMER_GROUPS |
/customers/privacy-requests | CUSTOMER_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.