Appearance
Sales And Finance — Technical Map
Route / page map
| Surface | Main page / shell |
|---|---|
| Revenue | RevenueReport.tsx |
| Debt | DebtReport.tsx |
| Actual revenue | ActualRevenueReport.tsx |
| Commission | CommissionReport.tsx |
| Employee revenue | EmployeeRevenueReport.tsx |
| Fund | FundReport.tsx |
| Expense | ExpenseReport.tsx |
GraphQL / data model map
| Surface | Query / model chính |
|---|---|
| Revenue | ReportOrderRevenue, ReportServiceRevenue, TransactionListOfOrderService, ReportCosmeticRevenue, ReportPrepaidCardRevenue trong report_revenue.graphql |
| Debt | ReportDebtCustomer trên order trong report_debt.graphql |
| Actual revenue | Hasura actions reportSalesRevenue, reportSalesRevenueByBranch trong report_actual_revenue.graphql |
| Commission | search_report_order_commission -> result type report_order_commission |
| Employee revenue | search_report_employee, search_dashboard_report_employee, search_dashboard_report_total_employee |
| Fund | Query fund + branch/master-data trong report_fund.graphql |
| Expense | Query view report_expense trong report_expense.graphql |
Boundary với module khác
| Module | Boundary kỹ thuật |
|---|---|
ecommerce | Finance reports chủ yếu sống trên metadata/functions của source ecommerce |
wallet | wallet, wallet_promotion, transaction_request_log tham gia vào actual revenue/expense |
auth | configureUseAuth.ts load report_role và cache vào LOCAL_STORAGE_REPORT_ROLES |
Rủi ro / Findings kỹ thuật
| Mức | Finding |
|---|---|
| Cao | ActualRevenueReport đang reuse CustomerCycleRateReport, tạo coupling chéo domain trong cùng page. |
| Cao | Contract risk: action input của actual revenue cần branch_ids: [String], nhưng một số path FE truyền scalar branch. |
| Trung bình | DetailReportLayout.tsx lọc tab bằng globalStore.account?.roles[0]?.role_id, không theo effective role set. |
| Trung bình | Route configs của report để permissions: [], nên enforcement nằm ở report_role + query scope thay vì router. |
| Trung bình | audit_report_group chưa có implementation; hiện chỉ là placeholder text. |