feat(frontend): Statistik-Seite mit animierten Auswertungen (Modul 27)
Tab-basierte /statistics-Seite (Voelker, Koeniginnen, Bienenstaende, Varroa, Honig, Futter) mit animierten Balkendiagrammen, Sidebar-Eintrag und Live-Verifikation ueber alle Tabs sowie Mobile-Breakpoint.
This commit is contained in:
1 parent
e8177432b0
commit
8856d7d0f5
6 files changed
+449
-2
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { apiFetch } from "@/lib/auth/api-client";
|
||||
import { ApiaryStats, ColonyStats, FeedingStats, HoneyStats, QueenStats, VarroaStats } from "./types";
|
||||
|
||||
export function fetchColonyStats(): Promise<ColonyStats> {
|
||||
return apiFetch<ColonyStats>("/statistics/colonies");
|
||||
}
|
||||
|
||||
export function fetchQueenStats(): Promise<QueenStats> {
|
||||
return apiFetch<QueenStats>("/statistics/queens");
|
||||
}
|
||||
|
||||
export function fetchApiaryStats(): Promise<ApiaryStats> {
|
||||
return apiFetch<ApiaryStats>("/statistics/apiaries");
|
||||
}
|
||||
|
||||
export function fetchVarroaStats(): Promise<VarroaStats> {
|
||||
return apiFetch<VarroaStats>("/statistics/varroa");
|
||||
}
|
||||
|
||||
export function fetchHoneyStats(): Promise<HoneyStats> {
|
||||
return apiFetch<HoneyStats>("/statistics/honey");
|
||||
}
|
||||
|
||||
export function fetchFeedingStats(): Promise<FeedingStats> {
|
||||
return apiFetch<FeedingStats>("/statistics/feeding");
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
export interface ColonyStats {
|
||||
byStatus: { status: string; count: number }[];
|
||||
strengthOverTime: { colonyId: string; date: string; colonyStrength: number }[];
|
||||
lossesByYear: Record<string, number>;
|
||||
}
|
||||
|
||||
export interface QueenEvaluationAverage {
|
||||
queenId: string;
|
||||
code: string;
|
||||
evaluationCount: number;
|
||||
colonyStrength: number;
|
||||
gentleness: number;
|
||||
combBuild: number;
|
||||
swarmingTendency: number;
|
||||
broodPattern: number;
|
||||
honeyYield: number;
|
||||
}
|
||||
|
||||
export interface QueenStats {
|
||||
totalActive: number;
|
||||
averageLifespanDays: number | null;
|
||||
evaluationAverages: QueenEvaluationAverage[];
|
||||
}
|
||||
|
||||
export interface ApiaryStatsEntry {
|
||||
apiaryId: string;
|
||||
name: string;
|
||||
activeColonies: number;
|
||||
lostColonies: number;
|
||||
totalHoneyKg: number;
|
||||
averageHoneyKgPerColony: number;
|
||||
}
|
||||
|
||||
export type ApiaryStats = ApiaryStatsEntry[];
|
||||
|
||||
export interface VarroaStats {
|
||||
measurements: { colonyId: string; date: string; miteCount: number; method: string }[];
|
||||
treatmentCountByColony: { colonyId: string; treatmentCount: number }[];
|
||||
}
|
||||
|
||||
export interface HoneyStats {
|
||||
totalHarvestKg: number;
|
||||
totalHoneyBatchKg: number;
|
||||
yieldPerYear: Record<string, number>;
|
||||
yieldPerApiary: Record<string, number>;
|
||||
}
|
||||
|
||||
export interface FeedingStats {
|
||||
byColony: Record<string, number>;
|
||||
bySeason: Record<string, number>;
|
||||
}
|
||||
Reference in new issue
Block a user