import { z } from "zod";

// See schemas/auth.ts for the shared client/server validation rationale.

/**
 * Payload accepted by `GET /cooking-session`'s `?date=` query param — same
 * shape/rationale as `schemas/shopping-list.ts`'s `getShoppingListSchema`
 * (only the `YYYY-MM-DD` shape is checked here; real-calendar-date
 * validation is service-side via `@batch-cooking/date-tools`'s
 * `parseDateOnly`). Kept as its own schema rather than importing another
 * module's near-identical one — each router owns its own request contract
 * in this repo, even when two happen to share a shape.
 */
export const getCookingSessionSchema = z.object({
  date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Date invalide"),
});
/** Inferred TS type for {@link getCookingSessionSchema}'s validated output. */
export type GetCookingSessionInput = z.infer<typeof getCookingSessionSchema>;
