-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathvalidators.ts
33 lines (30 loc) · 992 Bytes
/
validators.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { z } from "zod"
import { FindParams } from "../../../types/common"
export class StoreGetCartsCartParams extends FindParams {}
const Address = z
.object({
first_name: z.string().optional(),
last_name: z.string().optional(),
company: z.string().optional(),
address_1: z.string().optional(),
address_2: z.string().optional(),
city: z.string().optional(),
state: z.string().optional(),
postal_code: z.string().optional(),
country_code: z.string().optional(),
phone: z.string().optional(),
})
.strict()
export const StorePostCartReq = z
.object({
region_id: z.string().optional(),
customer_id: z.string().optional(),
email: z.string().optional(),
currency_code: z.string().optional(),
shipping_address: Address.optional(),
billing_address: Address.optional(),
items: z.array(z.unknown()).optional(),
sales_channel_id: z.string().optional(),
metadata: z.record(z.unknown()).optional(),
})
.strict()