UNPKG

fullcart

Version:

Add stripe checkout to any website

23 lines (19 loc) 577 B
import { z } from 'astro/zod' import { errorMap } from 'zod-validation-error' import { productSchema } from './productSchema' z.setErrorMap(errorMap as any) export const customerSchema = z.object({ id: z.string().optional(), name: z.string().optional(), description: z.string().optional(), email: z.string().email().optional(), phone: z.string().optional(), address: z.string().optional(), lines: z .object({ quantity: z.number(), productId: productSchema.shape.id, }) .array(), }) export type Customer = z.infer<typeof customerSchema>