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:
2026-10-21 14:57:54 +05:30
parent e6efc33ac0
commit 0a212ed1aa
16 changed files with 1129 additions and 350 deletions
+8 -2
View File
@@ -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)}`)
},
}