feat(dashboard): add date filter and stat groups components
- Implemented DashboardDateFilter component for selecting date ranges. - Created DashboardStatGroups component to display various dashboard statistics. - Added dashboard chart data processing logic to support new chart specifications. - Introduced reusable Chart components for rendering different types of charts.
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
// Dashboard overview endpoint (Backend/ERPCore/Controllers/DashboardController.cs).
|
||||
import { apiRequest, buildQuery } from "@/lib/api-client"
|
||||
import { DashboardStats } from "@/types/dashboard"
|
||||
import { DashboardChartsData, DashboardStats } from "@/types/dashboard"
|
||||
|
||||
export const dashboardApi = {
|
||||
stats(params: { branchId?: number } = {}): Promise<DashboardStats> {
|
||||
/** `from` / `to` (YYYY-MM-DD) set the period for the activity counts; omitted means today. */
|
||||
stats(params: { branchId?: number; from?: string; to?: string } = {}): Promise<DashboardStats> {
|
||||
return apiRequest<DashboardStats>(`/dashboard/stats${buildQuery(params)}`)
|
||||
},
|
||||
|
||||
/** Datasets for the dashboard graphs; the time-based ones follow `from` / `to` (YYYY-MM-DD, default today). */
|
||||
charts(params: { branchId?: number; from?: string; to?: string } = {}): Promise<DashboardChartsData> {
|
||||
return apiRequest<DashboardChartsData>(`/dashboard/charts${buildQuery(params)}`)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user