From c999354645a55b9de9513e342fdd373e94a206e5 Mon Sep 17 00:00:00 2001 From: enlineawork Date: Mon, 7 Sep 2026 22:56:33 -0300 Subject: [PATCH] F4: add dashboard contract without finding response states --- web-v2/src/lib/dashboardF4Api.ts | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 web-v2/src/lib/dashboardF4Api.ts 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'); +}