FE: module customer_type — loại khách #
Phần chung (khởi tạo client, lỗi, danh sách, ngôn ngữ) ở tài liệu FE của Core:
docs/fe/common.md (bản đọc: xforge-documentation, ADR-0102 của xforge-core).
Sửa file này CÙNG PR khi đổi hành vi FE thấy được của module.
Chỉ có ở CMS (XforgeClient). Menu: key customer_type.customer_types (quyền
customer_type.read).
Loại khách #
Bộ route CRUD chuẩn (listCustomerTypes, getCustomerType,
createCustomerType, updateCustomerType, replaceCustomerType,
deleteCustomerType, restoreCustomerType, listCustomerTypeTrash,
listCustomerTypeOptions): code duy nhất trong store (409
customer_type_code_exists), name, active, notes.
Gán loại cho khách #
Khách có TỐI ĐA một loại trong mỗi store.
setCustomerType({ params: { customerId }, body: { customerTypeId } })(quyềncustomer_type.assign) — đặt loại, gán loại khác là chuyển loại,customerTypeId: nulllà bỏ loại (data: null). Khách không phải khách của store → 404customer_type_customer_not_found; loại đang tắt → 409customer_type_inactive.listCustomerTypeMembers— lọccustomer_type_id(khách của một loại) hoặccustomer_id(loại của một khách: 0 hoặc 1 dòng), kèmcustomerInfo,customerTypeInfo,assignedAt.
Tắt hoặc xoá loại không bỏ loại của khách; giá theo loại khách
(customer_type_price_rule) bỏ qua loại đang tắt / trong thùng rác. Gỡ khách
khỏi store (unlinkCustomer của Core) hoặc xoá khách thì loại của khách ở store
đó bị bỏ.
Màn hình dựng sẵn #
listMenu() → mục customer_type.customer_types có screen (type: "crud"):
CMS chung vẽ được từ
getMenuScreen({ params: { key: "customer_type.customer_types" } }) mà không
cần code riêng (tài liệu FE của Core: cms.md §3.1). Có: danh sách, form tạo /
sửa, xoá, thùng rác + khôi phục.
KHÔNG có: gán loại cho khách (listCustomerTypeMembers / setCustomerType) —
màn tay.