feat(frontend): Dashboard-Ansicht (Modul 13)
/dashboard als Startseite nach Login mit Kennzahlen-Kacheln und Hinweisen (überfällige Aufgaben, auffällige Völker, Lagerartikel unter Mindestbestand).
This commit is contained in:
1 parent
09407d4378
commit
55b9bc2587
7 files changed
+123
-3
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import { apiFetch } from "@/lib/auth/api-client";
|
||||
import { DashboardAlert, DashboardSummary } from "./types";
|
||||
|
||||
export function fetchDashboardSummary(): Promise<DashboardSummary> {
|
||||
return apiFetch<DashboardSummary>("/dashboard/summary");
|
||||
}
|
||||
|
||||
export function fetchDashboardAlerts(): Promise<DashboardAlert[]> {
|
||||
return apiFetch<DashboardAlert[]>("/dashboard/alerts");
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
export interface DashboardSummary {
|
||||
apiariesActive: number;
|
||||
coloniesActive: number;
|
||||
queensActive: number;
|
||||
openTasks: number;
|
||||
honeyBatchesTotal: number;
|
||||
stockItemsLowCount: number;
|
||||
}
|
||||
|
||||
export type DashboardAlertType = "OVERDUE_TASK" | "COLONY_ATTENTION" | "LOW_STOCK";
|
||||
|
||||
export interface DashboardAlert {
|
||||
type: DashboardAlertType;
|
||||
message: string;
|
||||
relatedType: string;
|
||||
relatedId: string;
|
||||
}
|
||||
Reference in new issue
Block a user