Skip to content

Customer Workspace — Technical Map

Route / page map

SurfaceMain page / shell
Customer rootCustomer.tsx
Customer listCustomers.tsx
Customer createCustomerCreate.tsx
Customer detail shellCustomerDetail.tsx
Detail tabsCustomerContactBook, Comments, Appointments, CustomerActivityLog, CustomerReward, CustomerTicketManager, CustomerCalled, CustomerTask, CustomerOrderHistory, RecordTable, TreatmentImages, PaymentHistories, FeedbackTable, SMSHistories, collaborator subtree, CustomerComplaintList

GraphQL / data model map

SurfaceQuery / model chính
Customer baseGetCustomerOfDetailByPk, GetGeneralCustomerInfo, GetCustomerList, SearchCustomer trong account.graphql
Wallet / statsGetWalletStats, CustomerStatistic, GetMembershipValueByCustomerId
Notes / comments / activityGetNotes, GetCustomerNotes, AddNote, UpdateCustomerComments, GetUserLogs
Payment / refundsGetPaymentRefundHistoryFull, GetTransaction trong payment_history.graphql
Reward / giftsGetUserVouchers, ReceiveWheelReward trong customer_gift.graphql
Messages / SMSGetSmsUser, GetMessageUserView, GetMessageUserViewAggregate
Collaborator subtreeReuse queries/pages từ module affiliate

Boundary với module khác

ModuleBoundary kỹ thuật
crmCustomerVisit, CustomerTicketManager, CRM route constants, SIP/ticket helpers
ecommerceAppointments, RecordTable, orders, treatment artifacts
walletGetWalletStats, payment history, wallet summary cards
affiliateCollaborator order/payment/withdraw pages và dialogs
reportComplaint tab đang dùng report_complaint.graphql thay vì query list từ module complaint

Rủi ro / Findings kỹ thuật

MứcFinding
CaoCustomerCreate.tsx import ROUTE_CUSTOMERROUTE_CUSTOMER_CREATE từ crm/types dù đang nằm trong module user.
CaoROUTE_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ìnhCustomer workspace có nhiều mutation ngay trong shell: create/update customer, contact book default, note/comment, ticket status.
Trung bìnhmodule.ts đổi pathName customer sang /crm/customer khi process.env.NAME === "crm", làm boundary route phụ thuộc platform build.
Trung bìnhCustomerDetail.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ìnhComplaint 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.