feat(frontend): Ernten- und Schleuderungs-Ansichten (Modul 10)
/harvests/new (Bienenstand + Mehrfachauswahl Völker), /harvests/[id] und /extractions/new (Mehrfachauswahl Ernten). Bienenstand- und Ernte-Detailseiten verlinken direkt in die Kette.
This commit is contained in:
1 parent
340397b34d
commit
5c2c0608d1
9 files changed
+526
-2
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { apiFetch } from "@/lib/auth/api-client";
|
||||
import { CreateExtractionInput, Extraction } from "./types";
|
||||
|
||||
export function fetchExtractions(): Promise<Extraction[]> {
|
||||
return apiFetch<Extraction[]>("/extractions");
|
||||
}
|
||||
|
||||
export function createExtraction(input: CreateExtractionInput): Promise<Extraction> {
|
||||
return apiFetch<Extraction>("/extractions", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
export interface ExtractionHarvestEntry {
|
||||
id: string;
|
||||
harvestId: string;
|
||||
harvest: {
|
||||
id: string;
|
||||
date: string;
|
||||
colonies: {
|
||||
colonyId: string;
|
||||
colony: { id: string; code: string };
|
||||
}[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface Extraction {
|
||||
id: string;
|
||||
date: string;
|
||||
userId: string;
|
||||
amount: number | null;
|
||||
room: string | null;
|
||||
waterContent: number | null;
|
||||
temperature: number | null;
|
||||
notes: string | null;
|
||||
createdAt: string;
|
||||
harvests: ExtractionHarvestEntry[];
|
||||
}
|
||||
|
||||
export interface CreateExtractionInput {
|
||||
date: string;
|
||||
harvestIds: string[];
|
||||
amount?: number;
|
||||
room?: string;
|
||||
waterContent?: number;
|
||||
temperature?: number;
|
||||
notes?: string;
|
||||
}
|
||||
Reference in new issue
Block a user