Track and save on groceries
1import z from "zod/v4";
2import { pageOptions, paginated } from "./pagination.js";
3
4export const Store = z
5 .object({
6 id: z.coerce.number().int().min(0),
7 name: z.string(),
8 })
9 .meta({
10 title: "Store",
11 description: "Store schema",
12 examples: [{ id: 1, name: "EDEKA" }],
13 });
14
15export const CreateStore = Store.omit({
16 id: true,
17}).meta({
18 title: "CreateStore",
19 description: "Create store schema",
20 examples: [{ name: "Lee Deal" }],
21});
22
23CreateStore.pick({});
24
25export const StoresQuery = pageOptions(Store, Store.shape.id);
26export const Stores = paginated(Store);