Files
Cibello-app/packages/validation/src/recommendations.ts
T
2026-08-05 19:21:11 +07:00

19 lines
862 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { z } from "zod";
import { MEAL_TYPES } from "@app/shared-types";
/**
* "Vad ska vi äta?" (spec §18) + "Jag är sugen på" (spec §19).
* Alla parametrar är valfria motorn använder hushållets kontext som standard.
*/
export const whatToEatQuerySchema = z.object({
mealType: z.enum(MEAL_TYPES).default("dinner"),
persons: z.coerce.number().int().min(1).max(20).optional(),
maxMinutes: z.coerce.number().int().min(5).max(600).optional(),
maxCostMinorPerPortion: z.coerce.number().int().min(0).max(100_000).optional(),
/** Fritext eller röst-transkription: "krämigt", "asiatiskt", "under 500 kcal" … */
craving: z.string().max(300).optional(),
includeLeftovers: z.coerce.boolean().default(true),
limit: z.coerce.number().int().min(1).max(20).default(5),
});
export type WhatToEatQuery = z.infer<typeof whatToEatQuerySchema>;