import { z } from "zod"; // See schemas/auth.ts for the shared client/server validation rationale. /** * Payload accepted by `GET /shopping-list`'s `?date=` query param — same * shape/rationale as `schemas/planning.ts`'s `getPlanningByDateSchema` * (only checks the `YYYY-MM-DD` shape, real-calendar-date validation is * service-side via `@batch-cooking/date-tools`'s `parseDateOnly`). Kept as * its own schema rather than importing `getPlanningByDateSchema` — each * router module owns its own request contract in this repo, even when two * happen to share a shape (see the two near-identical `date` fields already * inside `schemas/planning.ts` itself). */ export const getShoppingListSchema = z.object({ date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Date invalide"), }); /** Inferred TS type for {@link getShoppingListSchema}'s validated output. */ export type GetShoppingListInput = z.infer;