mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 23:28:11 +00:00
feat(warehouses): make dashboard date range + warehouse filter real
Backs the previously-dead header date-picker and Filters button with an actual scoped query. getDashboard() takes optional dateFrom/dateTo/ warehouseId: received (renamed from receivedToday) is the only activity counter and respects the date range, defaulting to today when omitted; the 10 status-backlog counters respect warehouseId only; totalWarehouses/emptyContainers/importTrains/exportTrains stay global since nothing ties them to a specific warehouse in the schema. Adds a warehouse Select + date-range picker to the dashboard header, with a caption spelling out what is and isn't scoped.
This commit is contained in:
@@ -64,6 +64,7 @@ import type {
|
||||
Warehouse,
|
||||
WarehouseActivityLog,
|
||||
WarehouseDashboard,
|
||||
WarehouseDashboardFilter,
|
||||
WarehouseFacility,
|
||||
WarehouseFilter,
|
||||
WarehouseInventoryItem,
|
||||
@@ -245,7 +246,10 @@ export const warehouseService = {
|
||||
apiClient.get<Warehouse[]>(URL_CONSTANTS.WAREHOUSES.BASE, {
|
||||
params: cleanParams(filter ?? {}),
|
||||
}),
|
||||
dashboard: () => apiClient.get<WarehouseDashboard>(URL_CONSTANTS.WAREHOUSES.DASHBOARD),
|
||||
dashboard: (filter?: WarehouseDashboardFilter) =>
|
||||
apiClient.get<WarehouseDashboard>(URL_CONSTANTS.WAREHOUSES.DASHBOARD, {
|
||||
params: cleanParams(filter ?? {}),
|
||||
}),
|
||||
getDashboardSummary: (_filter?: InventoryFilter) =>
|
||||
apiClient.get<WarehouseDashboard>(URL_CONSTANTS.WAREHOUSES.DASHBOARD),
|
||||
getById: (id: string) => apiClient.get<Warehouse>(URL_CONSTANTS.WAREHOUSES.BY_ID(id)),
|
||||
|
||||
Reference in New Issue
Block a user