feat(frontend): Durchsichten-Modul (Modul 5)
Mobile-optimiertes Schnellformular unter /inspections/new sowie "Durchsichten"-Ansicht auf der Volk-Detailseite.
This commit is contained in:
1 parent
9b59e4bb35
commit
829753ec90
6 files changed
+347
-1
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { apiFetch } from "@/lib/auth/api-client";
|
||||
import {
|
||||
CreateInspectionInput,
|
||||
CreateTaskFromInspectionInput,
|
||||
Inspection,
|
||||
InspectionTask,
|
||||
} from "./types";
|
||||
|
||||
export function fetchColonyInspections(colonyId: string): Promise<Inspection[]> {
|
||||
return apiFetch<Inspection[]>(`/colonies/${colonyId}/inspections`);
|
||||
}
|
||||
|
||||
export function createInspection(input: CreateInspectionInput): Promise<Inspection> {
|
||||
return apiFetch<Inspection>("/inspections", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
|
||||
export function createTaskFromInspection(
|
||||
id: string,
|
||||
input: CreateTaskFromInspectionInput,
|
||||
): Promise<InspectionTask> {
|
||||
return apiFetch<InspectionTask>(`/inspections/${id}/create-task`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
export interface Inspection {
|
||||
id: string;
|
||||
colonyId: string;
|
||||
userId: string;
|
||||
date: string;
|
||||
weather: string | null;
|
||||
temperature: number | null;
|
||||
colonyStrength: number | null;
|
||||
broodAmount: string | null;
|
||||
broodPattern: number | null;
|
||||
openBroodPresent: boolean | null;
|
||||
cappedBroodPresent: boolean | null;
|
||||
eggsPresent: boolean | null;
|
||||
queenSeen: boolean | null;
|
||||
queenCellsPresent: boolean | null;
|
||||
swarmMood: number | null;
|
||||
gentleness: number | null;
|
||||
combBehavior: number | null;
|
||||
feedStatus: string | null;
|
||||
honeySuperStatus: string | null;
|
||||
healthIssues: string | null;
|
||||
varroaIssues: string | null;
|
||||
measures: string | null;
|
||||
notes: string | null;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface CreateInspectionInput {
|
||||
colonyId: string;
|
||||
date: string;
|
||||
weather?: string;
|
||||
temperature?: number;
|
||||
colonyStrength?: number;
|
||||
queenSeen?: boolean;
|
||||
queenCellsPresent?: boolean;
|
||||
feedStatus?: string;
|
||||
healthIssues?: string;
|
||||
varroaIssues?: string;
|
||||
measures?: string;
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export interface CreateTaskFromInspectionInput {
|
||||
title: string;
|
||||
description?: string;
|
||||
priority?: string;
|
||||
dueDate?: string;
|
||||
assignedUserId?: string;
|
||||
}
|
||||
|
||||
export interface InspectionTask {
|
||||
id: string;
|
||||
sourceInspectionId: string | null;
|
||||
}
|
||||
Reference in new issue
Block a user