Appearance
Customer Workspace — Technical Map
Route / page map
| Surface | Main page / shell |
|---|---|
| Customer root | Customer.tsx |
| Customer list | Customers.tsx |
| Customer create | CustomerCreate.tsx |
| Customer detail shell | CustomerDetail.tsx |
| Detail tabs | CustomerContactBook, Comments, Appointments, CustomerActivityLog, CustomerReward, CustomerTicketManager, CustomerCalled, CustomerTask, CustomerOrderHistory, RecordTable, TreatmentImages, PaymentHistories, FeedbackTable, SMSHistories, collaborator subtree, CustomerComplaintList |
GraphQL / data model map
| Surface | Query / model chính |
|---|---|
| Customer base | GetCustomerOfDetailByPk, GetGeneralCustomerInfo, GetCustomerList, SearchCustomer trong account.graphql |
| Wallet / stats | GetWalletStats, CustomerStatistic, GetMembershipValueByCustomerId |
| Notes / comments / activity | GetNotes, GetCustomerNotes, AddNote, UpdateCustomerComments, GetUserLogs |
| Payment / refunds | GetPaymentRefundHistoryFull, GetTransaction trong payment_history.graphql |
| Reward / gifts | GetUserVouchers, ReceiveWheelReward trong customer_gift.graphql |
| Messages / SMS | GetSmsUser, GetMessageUserView, GetMessageUserViewAggregate |
| Collaborator subtree | Reuse queries/pages từ module affiliate |
Boundary với module khác
| Module | Boundary kỹ thuật |
|---|---|
crm | CustomerVisit, CustomerTicketManager, CRM route constants, SIP/ticket helpers |
ecommerce | Appointments, RecordTable, orders, treatment artifacts |
wallet | GetWalletStats, payment history, wallet summary cards |
affiliate | Collaborator order/payment/withdraw pages và dialogs |
report | Complaint tab đang dùng report_complaint.graphql thay vì query list từ module complaint |
Rủi ro / Findings kỹ thuật
| Mức | Finding |
|---|---|
| Cao | CustomerCreate.tsx import ROUTE_CUSTOMER và ROUTE_CUSTOMER_CREATE từ crm/types dù đang nằm trong module user. |
| Cao | ROUTE_CUSTOMER_CREATE có constant + config quyền nhưng không được mount thành route thực; create hiện chủ yếu mở từ dialog/table. |
| Trung bình | Customer workspace có nhiều mutation ngay trong shell: create/update customer, contact book default, note/comment, ticket status. |
| Trung bình | module.ts đổi pathName customer sang /crm/customer khi process.env.NAME === "crm", làm boundary route phụ thuộc platform build. |
| Trung bình | CustomerDetail.tsx có state isAllowedAffiliate điều phối left-side wallet info theo tab/capability, cho thấy shell đang gánh thêm policy logic chéo affiliate. |
| Trung bình | Complaint tab split ownership: UI nằm trong user, hooks query từ report, còn schema/master-data lại gắn với complaint domain. |