feat(frontend): Behandlungen-Modul (Modul 8)

Mobile-optimiertes Erfassungsformular unter /treatments/new sowie
"Behandlungen"-Ansicht auf der Volk-Detailseite.
This commit is contained in:
Nick Szaunig committed 2026-08-22 00:10:46 +02:00
1 parent 61e0bbe794
commit 1f71ac9e3c
6 files changed
+261 -1

No files matched your search

@@ -0,0 +1,13 @@
import { apiFetch } from "@/lib/auth/api-client";
import { CreateTreatmentInput, Treatment } from "./types";
export function fetchColonyTreatments(colonyId: string): Promise<Treatment[]> {
return apiFetch<Treatment[]>(`/colonies/${colonyId}/treatments`);
}
export function createTreatment(input: CreateTreatmentInput): Promise<Treatment> {
return apiFetch<Treatment>("/treatments", {
method: "POST",
body: JSON.stringify(input),
});
}
@@ -0,0 +1,30 @@
export interface Treatment {
id: string;
colonyId: string;
userId: string;
date: string;
startDate: string | null;
endDate: string | null;
product: string;
activeIngredient: string | null;
amount: string | null;
method: string | null;
reason: string | null;
batchNumber: string | null;
notes: string | null;
createdAt: string;
}
export interface CreateTreatmentInput {
colonyId: string;
date: string;
startDate?: string;
endDate?: string;
product: string;
activeIngredient?: string;
amount?: string;
method?: string;
reason?: string;
batchNumber?: string;
notes?: string;
}