- Added a new report engine UI, including configuration-driven report screens for sales and logistics. - Created `ReportProvider`, `ReportTable`, and related components for rendering reports with server-side data fetching. - Introduced `logisticsReportsModuleConfig` and `salesReportsModuleConfig` for managing report configurations and API interactions. - Updated navigation to include sales and logistics reports with proper labels and paths. - Enhanced language support for report titles in English and Indonesian. - Implemented bookmark and filter functionalities for reports, improving user interaction and data management. These changes establish a robust reporting framework, enhancing the application's data visualization capabilities and user experience.
43 lines
1.6 KiB
Markdown
43 lines
1.6 KiB
Markdown
# Reports UI
|
|
|
|
Generic, config-driven report screens live in `apps/web/src/core/report/`. Report definitions are backend `ReportConfigEntity` objects.
|
|
|
|
Architecture and APIs: [trackgo-be/docs/report-engine.md](../../../../../trackgo-be/docs/report-engine.md)
|
|
|
|
## Layout
|
|
|
|
| Path | Role |
|
|
| --- | --- |
|
|
| `constants/` | `FILTER_TYPE`, `DATA_FORMAT`, `REPORT_GROUP` — keep in sync with backend |
|
|
| `entities/` | Frontend mirror of config / query contracts |
|
|
| `data/report.remote.service.ts` | HTTP client (`apiClient`) |
|
|
| `utils/filter.helper.ts` | Form values → `filterModel` |
|
|
| `utils/column.helper.ts` | `columnConfigs` → AG Grid `columnDefs` |
|
|
| `components/report-provider.tsx` | Load configs → Mantine tabs |
|
|
| `components/report-table.tsx` | AG Grid SSRM + filter/bookmark actions |
|
|
| `components/report-filter-drawer.tsx` | Config-driven filter form |
|
|
| `components/report-bookmark-list.tsx` | Bookmark apply / delete |
|
|
|
|
## Product modules
|
|
|
|
| Module | Path | `moduleKey` |
|
|
| --- | --- | --- |
|
|
| Sales reports | `apps/main/modules/sales/reports/` | `SALES.REPORT` |
|
|
| Logistics reports | `apps/main/modules/field/logistics-reports/` | `LOGISTICS.REPORT` |
|
|
|
|
Each module wraps `ReportProvider` with `groupName` `sales_report` or `logistics_report` inside `EnterpriseModuleProvider` for RBAC.
|
|
|
|
## Grid contract
|
|
|
|
Every server-side block sends:
|
|
|
|
```ts
|
|
{
|
|
groupName,
|
|
uniqueName,
|
|
queryModel: { /* AG Grid IServerSideGetRowsRequest + merged filterModel */ }
|
|
}
|
|
```
|
|
|
|
Column defs, filters, and formats come from the config payload. Adding a report is a backend config change only.
|