Appearance
Dịch vụ & Lịch hẹn — Technical Map
Boundary map
| Lớp | Owner chính |
|---|---|
| Service config / commission config | settings module + role_commission |
| Runtime order item / appointment | ecommerce |
| Project task / assignee / tour money | project source + ecommerce-api events |
| Reminder / CRM follow-up | ecommerce-api schedulers + CRM schedulers |
| Downstream doctor / working schedule | hrm touchpoint |
Route / moduleId map
| Route / group | ModuleId / owner |
|---|---|
/e/service-order/* | service_order |
/e/appointment* | appointment_management |
| Settings service pages | service_list trong settings |
Bảng cốt lõi
| Bảng | DB | Vai trò |
|---|---|---|
product | ecommerce | Service master |
product_relation | ecommerce | Subtask, default_subtask, tour limit |
role_commission | ecommerce/settings | Commission config |
order_item | ecommerce | Purchased service item |
appointment, appointment_user | ecommerce | Runtime appointment |
order_service_tour_override | ecommerce | Override limit theo order item |
project_task, project_task_assignee | project | Tour execution + tour money |
request_working_schedule | hrm | Downstream approval touchpoint |
GraphQL / event / scheduler chính
| Thành phần | File | Vai trò |
|---|---|---|
| GraphQL | appointment.graphql | Appointment query/update |
| GraphQL | order.graphql | GetListTourLimit, UpdateTourLimitSubtask |
| GraphQL | projects/project.graphql | Project task fragments/touchpoints |
| GraphQL | settings/commission_setting.graphql | Service commission config |
| Event | appointment_insert.go | Sinh project_task + default subtasks |
| Event | appointment_update.go | Confirm/complete/cancel flow |
| Event | order_insert.go | Seed order_service_tour_override |
| Event | project_task_assignee_insert.go | Auto-fill tour_money |
| Event | project_task_assignee_update.go | Limit guard / reset tour_money |
| Scheduler | appointment_reminder.go | In-app reminder |
| Scheduler | appointment_service_reminder_sms.go | SMS/ZNS reminder |
| Scheduler | appointment_consultant_reminder_sms.go | Consultation reminder |
Sequence thực tế
text
Service config (settings)
-> service order insert
-> order_insert event seed override
-> appointment insert
-> appointment_insert event create project_task
-> project_task_assignee insert/update
-> reminder / CRM / HRM downstreamTour limit resolution
| Mức ưu tiên | Nguồn |
|---|---|
| 1 | order_service_tour_override.tour_limit_subtask |
| 2 | product_relation.tour_limit_subtask |
| 3 | product.tour_limit / runtime total context |
GetListTourLimit là action quan trọng để merge override và tính counted-vs-actual times.
Reminder & CRM touchpoints
| Luồng | Vai trò |
|---|---|
appointment_reminder | In-app reminder theo app settings |
appointment_service_reminder_sms | Reminder service 24h trước |
appointment_consultant_reminder_sms | Reminder consultant |
consolidate_ticket_4, remind_ticket_tomorrow | CRM follow-up liên quan |
Rủi ro / Findings kỹ thuật
| Mức | Mô tả |
|---|---|
| P1 | Nếu coi projects là microservice Go riêng cho tour thì sai; phần lớn behavior đang là Hasura source + ecommerce events. |
| P1 | cancel_reason trong appointment FE có nguy cơ không persist. |
| P1 | Tour limit enforcement không đối xứng hoàn toàn giữa insert và update assignee path. |
| P2 | Reminder service dedupe theo customer hơn là theo từng appointment. |