/
afanasevn
/
MaxSystems
Обзор
Документация
Войти
/
afanasevn
/
MaxSystems
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
client/src/api/reports.ts
38 строк
903 B
IBS\NAfanasev
Add project files.
18 июн 2026, 01:12
18 июн 2026, 01:12
b06aa39
Код
Авторство
О чём код?
import { apiGet } from './http' import type { EquipmentSystem, WorkListItem, WorkStatus, WorkType } from './works' export type EquipmentReportItem = { id: string name: string system: EquipmentSystem location: string nextMaintenance: string | null } export type LowStockReportItem = { id: string name: string quantity: number minQuantity: number } export type DashboardStats = { equipmentTotal: number equipmentFaulty: number worksOverdue: number maintenanceOverdue: number maintenanceUpcoming: number lowStock: number zeroStock: number worksWithoutChecklist: number openWorks: number overdueWorks: WorkListItem[] overdueMaintenance: EquipmentReportItem[] lowStockItems: LowStockReportItem[] } export type { WorkStatus, WorkType } export async function fetchDashboard(): Promise<DashboardStats> { return apiGet<DashboardStats>('/api/reports/dashboard') }