import { z } from 'zod' export const loginSchema = z.object({ email: z.string().email('Ungültige E-Mail-Adresse'), password: z.string().min(1, 'Passwort erforderlich'), }) export const PROJECT_MODES = ['EINSATZ', 'UEBUNG'] as const export type ProjectMode = (typeof PROJECT_MODES)[number] export const projectSchema = z.object({ title: z.string().min(1, 'Titel erforderlich').max(200, 'Titel zu lang'), mode: z.enum(PROJECT_MODES).optional(), exerciseEvaluation: z.string().max(10000).optional(), location: z.string().optional(), description: z.string().optional(), einsatzleiter: z.string().optional(), journalfuehrer: z.string().optional(), // Windrichtung in Grad (0=N, 90=O …), meteorologisch „Wind aus"; null = nicht gesetzt windDirection: z.number().int().min(0).max(359).nullable().optional(), mapCenter: z.object({ lng: z.number(), lat: z.number(), }).optional(), mapZoom: z.number().min(1).max(22).optional(), }) export const featureSchema = z.object({ type: z.string(), geometry: z.object({ type: z.string(), coordinates: z.any(), }), properties: z.record(z.any()).optional(), }) export const iconUploadSchema = z.object({ name: z.string().min(1, 'Name erforderlich').max(100, 'Name zu lang'), categoryId: z.string().uuid('Ungültige Kategorie'), }) export type LoginInput = z.infer export type ProjectInput = z.infer export type FeatureInput = z.infer export type IconUploadInput = z.infer