diff --git a/web-v2/src/lib/dashboardF4Api.ts b/web-v2/src/lib/dashboardF4Api.ts new file mode 100644 index 0000000..276815e --- /dev/null +++ b/web-v2/src/lib/dashboardF4Api.ts @@ -0,0 +1,46 @@ +import { apiRequest } from './api'; + +export interface DashboardSummaryF4 { + counts: { + totalAssets: number; + assetsNeedValidation: number; + assetsWithoutGeometry: number; + plannedInspections: number; + activeUsers: number; + inactiveUsers: number; + activeSessions: number; + openFindings: number; + findingsWithoutControlDate: number; + overdueControls: number; + controlsNext30Days: number; + reportsWorking: number; + reportsOfficialized: number; + sealedActsWithoutReport: number; + }; + recentAudit: Array<{ + id: string; + occurredAt: string; + actorUsername: string | null; + action: string; + entityType: string | null; + entityId: string | null; + }>; + upcomingControls: Array<{ + id: string; + code: string; + title: string; + nextControlOn: string; + actId: string; + actCode: string; + visitId: string; + visitCode: string; + assetId: string; + assetCode: string; + assetName: string; + }>; + generatedAt: string; +} + +export function getDashboardSummaryF4() { + return apiRequest('/dashboard/summary'); +}