feat(frontend): Koeniginnenbewertung (Modul 31)
Bewertungsformular (Volksstaerke, Sanftmut, Wabensitz, Schwarm- trieb, Brutbild, Honigertrag je 1-5) plus Verlauf auf der Koenigin-Detailseite. Live verifiziert.
This commit is contained in:
1 parent
50268fa591
commit
fb2b09a929
5 files changed
+197
-1
No files matched your search
@@ -1,9 +1,11 @@
|
||||
import { apiFetch } from "@/lib/auth/api-client";
|
||||
import {
|
||||
AssignColonyInput,
|
||||
CreateQueenEvaluationInput,
|
||||
CreateQueenInput,
|
||||
Queen,
|
||||
QueenColonyHistoryEntry,
|
||||
QueenEvaluation,
|
||||
QueenStatus,
|
||||
UpdateQueenInput,
|
||||
} from "./types";
|
||||
@@ -47,3 +49,17 @@ export function assignQueenColony(id: string, input: AssignColonyInput): Promise
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
|
||||
export function fetchQueenEvaluations(id: string): Promise<QueenEvaluation[]> {
|
||||
return apiFetch<QueenEvaluation[]>(`/queens/${id}/evaluations`);
|
||||
}
|
||||
|
||||
export function addQueenEvaluation(
|
||||
id: string,
|
||||
input: CreateQueenEvaluationInput,
|
||||
): Promise<QueenEvaluation> {
|
||||
return apiFetch<QueenEvaluation>(`/queens/${id}/evaluations`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
@@ -55,3 +55,30 @@ export interface QueenColonyHistoryEntry {
|
||||
endDate: string | null;
|
||||
notes: string | null;
|
||||
}
|
||||
|
||||
export interface QueenEvaluation {
|
||||
id: string;
|
||||
queenId: string;
|
||||
colonyId: string | null;
|
||||
date: string;
|
||||
colonyStrength: number;
|
||||
gentleness: number;
|
||||
combBuild: number;
|
||||
swarmingTendency: number;
|
||||
broodPattern: number;
|
||||
honeyYield: number;
|
||||
notes: string | null;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface CreateQueenEvaluationInput {
|
||||
colonyId?: string;
|
||||
date: string;
|
||||
colonyStrength: number;
|
||||
gentleness: number;
|
||||
combBuild: number;
|
||||
swarmingTendency: number;
|
||||
broodPattern: number;
|
||||
honeyYield: number;
|
||||
notes?: string;
|
||||
}
|
||||
Reference in new issue
Block a user