@voyantjs/pricing 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/routes-public.d.ts +136 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +13 -0
- package/dist/routes.d.ts +2 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/service-public.d.ts +89 -0
- package/dist/service-public.d.ts.map +1 -0
- package/dist/service-public.js +355 -0
- package/dist/validation-public.d.ts +410 -0
- package/dist/validation-public.d.ts.map +1 -0
- package/dist/validation-public.js +109 -0
- package/dist/validation-shared.d.ts +71 -0
- package/dist/validation-shared.d.ts.map +1 -0
- package/dist/validation-shared.js +63 -0
- package/dist/validation.d.ts +2 -69
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +3 -62
- package/package.json +16 -8
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const publicProductPricingQuerySchema: z.ZodObject<{
|
|
3
|
+
catalogId: z.ZodOptional<z.ZodString>;
|
|
4
|
+
optionId: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const publicAvailabilitySnapshotQuerySchema: z.ZodObject<{
|
|
7
|
+
optionId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
dateFrom: z.ZodOptional<z.ZodString>;
|
|
9
|
+
dateTo: z.ZodOptional<z.ZodString>;
|
|
10
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
open: "open";
|
|
12
|
+
closed: "closed";
|
|
13
|
+
sold_out: "sold_out";
|
|
14
|
+
cancelled: "cancelled";
|
|
15
|
+
}>>;
|
|
16
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
17
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const publicPriceCatalogSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
code: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
currencyCode: z.ZodNullable<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export declare const publicPricingTierSchema: z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
minQuantity: z.ZodNumber;
|
|
28
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
29
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
30
|
+
sortOrder: z.ZodNumber;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const publicOptionUnitPriceSchema: z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
unitId: z.ZodString;
|
|
35
|
+
unitName: z.ZodString;
|
|
36
|
+
unitType: z.ZodEnum<{
|
|
37
|
+
group: "group";
|
|
38
|
+
room: "room";
|
|
39
|
+
vehicle: "vehicle";
|
|
40
|
+
service: "service";
|
|
41
|
+
other: "other";
|
|
42
|
+
person: "person";
|
|
43
|
+
}>;
|
|
44
|
+
pricingMode: z.ZodEnum<{
|
|
45
|
+
per_person: "per_person";
|
|
46
|
+
per_booking: "per_booking";
|
|
47
|
+
free: "free";
|
|
48
|
+
on_request: "on_request";
|
|
49
|
+
per_unit: "per_unit";
|
|
50
|
+
included: "included";
|
|
51
|
+
}>;
|
|
52
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
53
|
+
minQuantity: z.ZodNullable<z.ZodNumber>;
|
|
54
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
55
|
+
pricingCategoryId: z.ZodNullable<z.ZodString>;
|
|
56
|
+
sortOrder: z.ZodNumber;
|
|
57
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
minQuantity: z.ZodNumber;
|
|
60
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
61
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
62
|
+
sortOrder: z.ZodNumber;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export declare const publicStartTimeAdjustmentSchema: z.ZodObject<{
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
startTimeId: z.ZodString;
|
|
68
|
+
label: z.ZodNullable<z.ZodString>;
|
|
69
|
+
startTimeLocal: z.ZodString;
|
|
70
|
+
ruleMode: z.ZodEnum<{
|
|
71
|
+
included: "included";
|
|
72
|
+
excluded: "excluded";
|
|
73
|
+
override: "override";
|
|
74
|
+
adjustment: "adjustment";
|
|
75
|
+
}>;
|
|
76
|
+
adjustmentType: z.ZodNullable<z.ZodEnum<{
|
|
77
|
+
fixed: "fixed";
|
|
78
|
+
percentage: "percentage";
|
|
79
|
+
}>>;
|
|
80
|
+
sellAdjustmentCents: z.ZodNullable<z.ZodNumber>;
|
|
81
|
+
adjustmentBasisPoints: z.ZodNullable<z.ZodNumber>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
export declare const publicOptionPricingRuleSchema: z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
description: z.ZodNullable<z.ZodString>;
|
|
87
|
+
pricingMode: z.ZodEnum<{
|
|
88
|
+
per_person: "per_person";
|
|
89
|
+
per_booking: "per_booking";
|
|
90
|
+
starting_from: "starting_from";
|
|
91
|
+
free: "free";
|
|
92
|
+
on_request: "on_request";
|
|
93
|
+
}>;
|
|
94
|
+
baseSellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
95
|
+
minPerBooking: z.ZodNullable<z.ZodNumber>;
|
|
96
|
+
maxPerBooking: z.ZodNullable<z.ZodNumber>;
|
|
97
|
+
isDefault: z.ZodBoolean;
|
|
98
|
+
cancellationPolicyId: z.ZodNullable<z.ZodString>;
|
|
99
|
+
unitPrices: z.ZodArray<z.ZodObject<{
|
|
100
|
+
id: z.ZodString;
|
|
101
|
+
unitId: z.ZodString;
|
|
102
|
+
unitName: z.ZodString;
|
|
103
|
+
unitType: z.ZodEnum<{
|
|
104
|
+
group: "group";
|
|
105
|
+
room: "room";
|
|
106
|
+
vehicle: "vehicle";
|
|
107
|
+
service: "service";
|
|
108
|
+
other: "other";
|
|
109
|
+
person: "person";
|
|
110
|
+
}>;
|
|
111
|
+
pricingMode: z.ZodEnum<{
|
|
112
|
+
per_person: "per_person";
|
|
113
|
+
per_booking: "per_booking";
|
|
114
|
+
free: "free";
|
|
115
|
+
on_request: "on_request";
|
|
116
|
+
per_unit: "per_unit";
|
|
117
|
+
included: "included";
|
|
118
|
+
}>;
|
|
119
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
120
|
+
minQuantity: z.ZodNullable<z.ZodNumber>;
|
|
121
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
122
|
+
pricingCategoryId: z.ZodNullable<z.ZodString>;
|
|
123
|
+
sortOrder: z.ZodNumber;
|
|
124
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
minQuantity: z.ZodNumber;
|
|
127
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
128
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
129
|
+
sortOrder: z.ZodNumber;
|
|
130
|
+
}, z.core.$strip>>;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
startTimeAdjustments: z.ZodArray<z.ZodObject<{
|
|
133
|
+
id: z.ZodString;
|
|
134
|
+
startTimeId: z.ZodString;
|
|
135
|
+
label: z.ZodNullable<z.ZodString>;
|
|
136
|
+
startTimeLocal: z.ZodString;
|
|
137
|
+
ruleMode: z.ZodEnum<{
|
|
138
|
+
included: "included";
|
|
139
|
+
excluded: "excluded";
|
|
140
|
+
override: "override";
|
|
141
|
+
adjustment: "adjustment";
|
|
142
|
+
}>;
|
|
143
|
+
adjustmentType: z.ZodNullable<z.ZodEnum<{
|
|
144
|
+
fixed: "fixed";
|
|
145
|
+
percentage: "percentage";
|
|
146
|
+
}>>;
|
|
147
|
+
sellAdjustmentCents: z.ZodNullable<z.ZodNumber>;
|
|
148
|
+
adjustmentBasisPoints: z.ZodNullable<z.ZodNumber>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
export declare const publicPricedOptionSchema: z.ZodObject<{
|
|
152
|
+
id: z.ZodString;
|
|
153
|
+
name: z.ZodString;
|
|
154
|
+
description: z.ZodNullable<z.ZodString>;
|
|
155
|
+
status: z.ZodEnum<{
|
|
156
|
+
active: "active";
|
|
157
|
+
draft: "draft";
|
|
158
|
+
archived: "archived";
|
|
159
|
+
}>;
|
|
160
|
+
isDefault: z.ZodBoolean;
|
|
161
|
+
bookingMode: z.ZodEnum<{
|
|
162
|
+
other: "other";
|
|
163
|
+
date: "date";
|
|
164
|
+
open: "open";
|
|
165
|
+
date_time: "date_time";
|
|
166
|
+
stay: "stay";
|
|
167
|
+
transfer: "transfer";
|
|
168
|
+
itinerary: "itinerary";
|
|
169
|
+
}>;
|
|
170
|
+
capacityMode: z.ZodEnum<{
|
|
171
|
+
on_request: "on_request";
|
|
172
|
+
free_sale: "free_sale";
|
|
173
|
+
limited: "limited";
|
|
174
|
+
}>;
|
|
175
|
+
pricingRules: z.ZodArray<z.ZodObject<{
|
|
176
|
+
id: z.ZodString;
|
|
177
|
+
name: z.ZodString;
|
|
178
|
+
description: z.ZodNullable<z.ZodString>;
|
|
179
|
+
pricingMode: z.ZodEnum<{
|
|
180
|
+
per_person: "per_person";
|
|
181
|
+
per_booking: "per_booking";
|
|
182
|
+
starting_from: "starting_from";
|
|
183
|
+
free: "free";
|
|
184
|
+
on_request: "on_request";
|
|
185
|
+
}>;
|
|
186
|
+
baseSellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
187
|
+
minPerBooking: z.ZodNullable<z.ZodNumber>;
|
|
188
|
+
maxPerBooking: z.ZodNullable<z.ZodNumber>;
|
|
189
|
+
isDefault: z.ZodBoolean;
|
|
190
|
+
cancellationPolicyId: z.ZodNullable<z.ZodString>;
|
|
191
|
+
unitPrices: z.ZodArray<z.ZodObject<{
|
|
192
|
+
id: z.ZodString;
|
|
193
|
+
unitId: z.ZodString;
|
|
194
|
+
unitName: z.ZodString;
|
|
195
|
+
unitType: z.ZodEnum<{
|
|
196
|
+
group: "group";
|
|
197
|
+
room: "room";
|
|
198
|
+
vehicle: "vehicle";
|
|
199
|
+
service: "service";
|
|
200
|
+
other: "other";
|
|
201
|
+
person: "person";
|
|
202
|
+
}>;
|
|
203
|
+
pricingMode: z.ZodEnum<{
|
|
204
|
+
per_person: "per_person";
|
|
205
|
+
per_booking: "per_booking";
|
|
206
|
+
free: "free";
|
|
207
|
+
on_request: "on_request";
|
|
208
|
+
per_unit: "per_unit";
|
|
209
|
+
included: "included";
|
|
210
|
+
}>;
|
|
211
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
212
|
+
minQuantity: z.ZodNullable<z.ZodNumber>;
|
|
213
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
214
|
+
pricingCategoryId: z.ZodNullable<z.ZodString>;
|
|
215
|
+
sortOrder: z.ZodNumber;
|
|
216
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
217
|
+
id: z.ZodString;
|
|
218
|
+
minQuantity: z.ZodNumber;
|
|
219
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
220
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
221
|
+
sortOrder: z.ZodNumber;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
}, z.core.$strip>>;
|
|
224
|
+
startTimeAdjustments: z.ZodArray<z.ZodObject<{
|
|
225
|
+
id: z.ZodString;
|
|
226
|
+
startTimeId: z.ZodString;
|
|
227
|
+
label: z.ZodNullable<z.ZodString>;
|
|
228
|
+
startTimeLocal: z.ZodString;
|
|
229
|
+
ruleMode: z.ZodEnum<{
|
|
230
|
+
included: "included";
|
|
231
|
+
excluded: "excluded";
|
|
232
|
+
override: "override";
|
|
233
|
+
adjustment: "adjustment";
|
|
234
|
+
}>;
|
|
235
|
+
adjustmentType: z.ZodNullable<z.ZodEnum<{
|
|
236
|
+
fixed: "fixed";
|
|
237
|
+
percentage: "percentage";
|
|
238
|
+
}>>;
|
|
239
|
+
sellAdjustmentCents: z.ZodNullable<z.ZodNumber>;
|
|
240
|
+
adjustmentBasisPoints: z.ZodNullable<z.ZodNumber>;
|
|
241
|
+
}, z.core.$strip>>;
|
|
242
|
+
}, z.core.$strip>>;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
export declare const publicProductPricingSnapshotSchema: z.ZodObject<{
|
|
245
|
+
productId: z.ZodString;
|
|
246
|
+
catalog: z.ZodObject<{
|
|
247
|
+
id: z.ZodString;
|
|
248
|
+
code: z.ZodString;
|
|
249
|
+
name: z.ZodString;
|
|
250
|
+
currencyCode: z.ZodNullable<z.ZodString>;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
options: z.ZodArray<z.ZodObject<{
|
|
253
|
+
id: z.ZodString;
|
|
254
|
+
name: z.ZodString;
|
|
255
|
+
description: z.ZodNullable<z.ZodString>;
|
|
256
|
+
status: z.ZodEnum<{
|
|
257
|
+
active: "active";
|
|
258
|
+
draft: "draft";
|
|
259
|
+
archived: "archived";
|
|
260
|
+
}>;
|
|
261
|
+
isDefault: z.ZodBoolean;
|
|
262
|
+
bookingMode: z.ZodEnum<{
|
|
263
|
+
other: "other";
|
|
264
|
+
date: "date";
|
|
265
|
+
open: "open";
|
|
266
|
+
date_time: "date_time";
|
|
267
|
+
stay: "stay";
|
|
268
|
+
transfer: "transfer";
|
|
269
|
+
itinerary: "itinerary";
|
|
270
|
+
}>;
|
|
271
|
+
capacityMode: z.ZodEnum<{
|
|
272
|
+
on_request: "on_request";
|
|
273
|
+
free_sale: "free_sale";
|
|
274
|
+
limited: "limited";
|
|
275
|
+
}>;
|
|
276
|
+
pricingRules: z.ZodArray<z.ZodObject<{
|
|
277
|
+
id: z.ZodString;
|
|
278
|
+
name: z.ZodString;
|
|
279
|
+
description: z.ZodNullable<z.ZodString>;
|
|
280
|
+
pricingMode: z.ZodEnum<{
|
|
281
|
+
per_person: "per_person";
|
|
282
|
+
per_booking: "per_booking";
|
|
283
|
+
starting_from: "starting_from";
|
|
284
|
+
free: "free";
|
|
285
|
+
on_request: "on_request";
|
|
286
|
+
}>;
|
|
287
|
+
baseSellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
288
|
+
minPerBooking: z.ZodNullable<z.ZodNumber>;
|
|
289
|
+
maxPerBooking: z.ZodNullable<z.ZodNumber>;
|
|
290
|
+
isDefault: z.ZodBoolean;
|
|
291
|
+
cancellationPolicyId: z.ZodNullable<z.ZodString>;
|
|
292
|
+
unitPrices: z.ZodArray<z.ZodObject<{
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
unitId: z.ZodString;
|
|
295
|
+
unitName: z.ZodString;
|
|
296
|
+
unitType: z.ZodEnum<{
|
|
297
|
+
group: "group";
|
|
298
|
+
room: "room";
|
|
299
|
+
vehicle: "vehicle";
|
|
300
|
+
service: "service";
|
|
301
|
+
other: "other";
|
|
302
|
+
person: "person";
|
|
303
|
+
}>;
|
|
304
|
+
pricingMode: z.ZodEnum<{
|
|
305
|
+
per_person: "per_person";
|
|
306
|
+
per_booking: "per_booking";
|
|
307
|
+
free: "free";
|
|
308
|
+
on_request: "on_request";
|
|
309
|
+
per_unit: "per_unit";
|
|
310
|
+
included: "included";
|
|
311
|
+
}>;
|
|
312
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
313
|
+
minQuantity: z.ZodNullable<z.ZodNumber>;
|
|
314
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
315
|
+
pricingCategoryId: z.ZodNullable<z.ZodString>;
|
|
316
|
+
sortOrder: z.ZodNumber;
|
|
317
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
318
|
+
id: z.ZodString;
|
|
319
|
+
minQuantity: z.ZodNumber;
|
|
320
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
321
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
322
|
+
sortOrder: z.ZodNumber;
|
|
323
|
+
}, z.core.$strip>>;
|
|
324
|
+
}, z.core.$strip>>;
|
|
325
|
+
startTimeAdjustments: z.ZodArray<z.ZodObject<{
|
|
326
|
+
id: z.ZodString;
|
|
327
|
+
startTimeId: z.ZodString;
|
|
328
|
+
label: z.ZodNullable<z.ZodString>;
|
|
329
|
+
startTimeLocal: z.ZodString;
|
|
330
|
+
ruleMode: z.ZodEnum<{
|
|
331
|
+
included: "included";
|
|
332
|
+
excluded: "excluded";
|
|
333
|
+
override: "override";
|
|
334
|
+
adjustment: "adjustment";
|
|
335
|
+
}>;
|
|
336
|
+
adjustmentType: z.ZodNullable<z.ZodEnum<{
|
|
337
|
+
fixed: "fixed";
|
|
338
|
+
percentage: "percentage";
|
|
339
|
+
}>>;
|
|
340
|
+
sellAdjustmentCents: z.ZodNullable<z.ZodNumber>;
|
|
341
|
+
adjustmentBasisPoints: z.ZodNullable<z.ZodNumber>;
|
|
342
|
+
}, z.core.$strip>>;
|
|
343
|
+
}, z.core.$strip>>;
|
|
344
|
+
}, z.core.$strip>>;
|
|
345
|
+
}, z.core.$strip>;
|
|
346
|
+
export declare const publicAvailabilityStartTimeSchema: z.ZodObject<{
|
|
347
|
+
id: z.ZodString;
|
|
348
|
+
label: z.ZodNullable<z.ZodString>;
|
|
349
|
+
startTimeLocal: z.ZodString;
|
|
350
|
+
durationMinutes: z.ZodNullable<z.ZodNumber>;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
export declare const publicAvailabilitySlotSchema: z.ZodObject<{
|
|
353
|
+
id: z.ZodString;
|
|
354
|
+
optionId: z.ZodNullable<z.ZodString>;
|
|
355
|
+
dateLocal: z.ZodString;
|
|
356
|
+
startsAt: z.ZodString;
|
|
357
|
+
endsAt: z.ZodNullable<z.ZodString>;
|
|
358
|
+
timezone: z.ZodString;
|
|
359
|
+
status: z.ZodEnum<{
|
|
360
|
+
open: "open";
|
|
361
|
+
closed: "closed";
|
|
362
|
+
sold_out: "sold_out";
|
|
363
|
+
cancelled: "cancelled";
|
|
364
|
+
}>;
|
|
365
|
+
unlimited: z.ZodBoolean;
|
|
366
|
+
remainingPax: z.ZodNullable<z.ZodNumber>;
|
|
367
|
+
remainingResources: z.ZodNullable<z.ZodNumber>;
|
|
368
|
+
pastCutoff: z.ZodBoolean;
|
|
369
|
+
tooEarly: z.ZodBoolean;
|
|
370
|
+
startTime: z.ZodNullable<z.ZodObject<{
|
|
371
|
+
id: z.ZodString;
|
|
372
|
+
label: z.ZodNullable<z.ZodString>;
|
|
373
|
+
startTimeLocal: z.ZodString;
|
|
374
|
+
durationMinutes: z.ZodNullable<z.ZodNumber>;
|
|
375
|
+
}, z.core.$strip>>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
export declare const publicAvailabilitySnapshotSchema: z.ZodObject<{
|
|
378
|
+
productId: z.ZodString;
|
|
379
|
+
slots: z.ZodArray<z.ZodObject<{
|
|
380
|
+
id: z.ZodString;
|
|
381
|
+
optionId: z.ZodNullable<z.ZodString>;
|
|
382
|
+
dateLocal: z.ZodString;
|
|
383
|
+
startsAt: z.ZodString;
|
|
384
|
+
endsAt: z.ZodNullable<z.ZodString>;
|
|
385
|
+
timezone: z.ZodString;
|
|
386
|
+
status: z.ZodEnum<{
|
|
387
|
+
open: "open";
|
|
388
|
+
closed: "closed";
|
|
389
|
+
sold_out: "sold_out";
|
|
390
|
+
cancelled: "cancelled";
|
|
391
|
+
}>;
|
|
392
|
+
unlimited: z.ZodBoolean;
|
|
393
|
+
remainingPax: z.ZodNullable<z.ZodNumber>;
|
|
394
|
+
remainingResources: z.ZodNullable<z.ZodNumber>;
|
|
395
|
+
pastCutoff: z.ZodBoolean;
|
|
396
|
+
tooEarly: z.ZodBoolean;
|
|
397
|
+
startTime: z.ZodNullable<z.ZodObject<{
|
|
398
|
+
id: z.ZodString;
|
|
399
|
+
label: z.ZodNullable<z.ZodString>;
|
|
400
|
+
startTimeLocal: z.ZodString;
|
|
401
|
+
durationMinutes: z.ZodNullable<z.ZodNumber>;
|
|
402
|
+
}, z.core.$strip>>;
|
|
403
|
+
}, z.core.$strip>>;
|
|
404
|
+
total: z.ZodNumber;
|
|
405
|
+
limit: z.ZodNumber;
|
|
406
|
+
offset: z.ZodNumber;
|
|
407
|
+
}, z.core.$strip>;
|
|
408
|
+
export type PublicProductPricingQuery = z.infer<typeof publicProductPricingQuerySchema>;
|
|
409
|
+
export type PublicAvailabilitySnapshotQuery = z.infer<typeof publicAvailabilitySnapshotQuerySchema>;
|
|
410
|
+
//# sourceMappingURL=validation-public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-public.d.ts","sourceRoot":"","sources":["../src/validation-public.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,eAAO,MAAM,+BAA+B;;;iBAG1C,CAAA;AAEF,eAAO,MAAM,qCAAqC;;;;;;;;;;;;iBAOhD,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;iBAMlC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYtC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;iBAS1C,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYxC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASnC,CAAA;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI7C,CAAA;AAEF,eAAO,MAAM,iCAAiC;;;;;iBAK5C,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;iBAcvC,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM3C,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AACvF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { availabilitySlotStatusSchema } from "@voyantjs/availability/validation";
|
|
2
|
+
import { optionUnitTypeSchema, productBookingModeSchema, productCapacityModeSchema, productOptionStatusSchema, } from "@voyantjs/products/validation";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { optionPricingModeSchema, optionStartTimeRuleModeSchema, optionUnitPricingModeSchema, priceAdjustmentTypeSchema, } from "./validation-shared.js";
|
|
5
|
+
const isoDateSchema = z.string().date();
|
|
6
|
+
export const publicProductPricingQuerySchema = z.object({
|
|
7
|
+
catalogId: z.string().optional(),
|
|
8
|
+
optionId: z.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
export const publicAvailabilitySnapshotQuerySchema = z.object({
|
|
11
|
+
optionId: z.string().optional(),
|
|
12
|
+
dateFrom: isoDateSchema.optional(),
|
|
13
|
+
dateTo: isoDateSchema.optional(),
|
|
14
|
+
status: availabilitySlotStatusSchema.optional(),
|
|
15
|
+
limit: z.coerce.number().int().min(1).max(200).default(100),
|
|
16
|
+
offset: z.coerce.number().int().min(0).default(0),
|
|
17
|
+
});
|
|
18
|
+
export const publicPriceCatalogSchema = z.object({
|
|
19
|
+
id: z.string(),
|
|
20
|
+
code: z.string(),
|
|
21
|
+
name: z.string(),
|
|
22
|
+
currencyCode: z.string().nullable(),
|
|
23
|
+
});
|
|
24
|
+
export const publicPricingTierSchema = z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
minQuantity: z.number().int(),
|
|
27
|
+
maxQuantity: z.number().int().nullable(),
|
|
28
|
+
sellAmountCents: z.number().int().nullable(),
|
|
29
|
+
sortOrder: z.number().int(),
|
|
30
|
+
});
|
|
31
|
+
export const publicOptionUnitPriceSchema = z.object({
|
|
32
|
+
id: z.string(),
|
|
33
|
+
unitId: z.string(),
|
|
34
|
+
unitName: z.string(),
|
|
35
|
+
unitType: optionUnitTypeSchema,
|
|
36
|
+
pricingMode: optionUnitPricingModeSchema,
|
|
37
|
+
sellAmountCents: z.number().int().nullable(),
|
|
38
|
+
minQuantity: z.number().int().nullable(),
|
|
39
|
+
maxQuantity: z.number().int().nullable(),
|
|
40
|
+
pricingCategoryId: z.string().nullable(),
|
|
41
|
+
sortOrder: z.number().int(),
|
|
42
|
+
tiers: z.array(publicPricingTierSchema),
|
|
43
|
+
});
|
|
44
|
+
export const publicStartTimeAdjustmentSchema = z.object({
|
|
45
|
+
id: z.string(),
|
|
46
|
+
startTimeId: z.string(),
|
|
47
|
+
label: z.string().nullable(),
|
|
48
|
+
startTimeLocal: z.string(),
|
|
49
|
+
ruleMode: optionStartTimeRuleModeSchema,
|
|
50
|
+
adjustmentType: priceAdjustmentTypeSchema.nullable(),
|
|
51
|
+
sellAdjustmentCents: z.number().int().nullable(),
|
|
52
|
+
adjustmentBasisPoints: z.number().int().nullable(),
|
|
53
|
+
});
|
|
54
|
+
export const publicOptionPricingRuleSchema = z.object({
|
|
55
|
+
id: z.string(),
|
|
56
|
+
name: z.string(),
|
|
57
|
+
description: z.string().nullable(),
|
|
58
|
+
pricingMode: optionPricingModeSchema,
|
|
59
|
+
baseSellAmountCents: z.number().int().nullable(),
|
|
60
|
+
minPerBooking: z.number().int().nullable(),
|
|
61
|
+
maxPerBooking: z.number().int().nullable(),
|
|
62
|
+
isDefault: z.boolean(),
|
|
63
|
+
cancellationPolicyId: z.string().nullable(),
|
|
64
|
+
unitPrices: z.array(publicOptionUnitPriceSchema),
|
|
65
|
+
startTimeAdjustments: z.array(publicStartTimeAdjustmentSchema),
|
|
66
|
+
});
|
|
67
|
+
export const publicPricedOptionSchema = z.object({
|
|
68
|
+
id: z.string(),
|
|
69
|
+
name: z.string(),
|
|
70
|
+
description: z.string().nullable(),
|
|
71
|
+
status: productOptionStatusSchema,
|
|
72
|
+
isDefault: z.boolean(),
|
|
73
|
+
bookingMode: productBookingModeSchema,
|
|
74
|
+
capacityMode: productCapacityModeSchema,
|
|
75
|
+
pricingRules: z.array(publicOptionPricingRuleSchema),
|
|
76
|
+
});
|
|
77
|
+
export const publicProductPricingSnapshotSchema = z.object({
|
|
78
|
+
productId: z.string(),
|
|
79
|
+
catalog: publicPriceCatalogSchema,
|
|
80
|
+
options: z.array(publicPricedOptionSchema),
|
|
81
|
+
});
|
|
82
|
+
export const publicAvailabilityStartTimeSchema = z.object({
|
|
83
|
+
id: z.string(),
|
|
84
|
+
label: z.string().nullable(),
|
|
85
|
+
startTimeLocal: z.string(),
|
|
86
|
+
durationMinutes: z.number().int().nullable(),
|
|
87
|
+
});
|
|
88
|
+
export const publicAvailabilitySlotSchema = z.object({
|
|
89
|
+
id: z.string(),
|
|
90
|
+
optionId: z.string().nullable(),
|
|
91
|
+
dateLocal: z.string(),
|
|
92
|
+
startsAt: z.string(),
|
|
93
|
+
endsAt: z.string().nullable(),
|
|
94
|
+
timezone: z.string(),
|
|
95
|
+
status: availabilitySlotStatusSchema,
|
|
96
|
+
unlimited: z.boolean(),
|
|
97
|
+
remainingPax: z.number().int().nullable(),
|
|
98
|
+
remainingResources: z.number().int().nullable(),
|
|
99
|
+
pastCutoff: z.boolean(),
|
|
100
|
+
tooEarly: z.boolean(),
|
|
101
|
+
startTime: publicAvailabilityStartTimeSchema.nullable(),
|
|
102
|
+
});
|
|
103
|
+
export const publicAvailabilitySnapshotSchema = z.object({
|
|
104
|
+
productId: z.string(),
|
|
105
|
+
slots: z.array(publicAvailabilitySlotSchema),
|
|
106
|
+
total: z.number().int(),
|
|
107
|
+
limit: z.number().int(),
|
|
108
|
+
offset: z.number().int(),
|
|
109
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const pricingCategoryTypeSchema: z.ZodEnum<{
|
|
3
|
+
adult: "adult";
|
|
4
|
+
child: "child";
|
|
5
|
+
infant: "infant";
|
|
6
|
+
senior: "senior";
|
|
7
|
+
group: "group";
|
|
8
|
+
room: "room";
|
|
9
|
+
vehicle: "vehicle";
|
|
10
|
+
service: "service";
|
|
11
|
+
other: "other";
|
|
12
|
+
}>;
|
|
13
|
+
export declare const pricingDependencyTypeSchema: z.ZodEnum<{
|
|
14
|
+
requires: "requires";
|
|
15
|
+
limits_per_master: "limits_per_master";
|
|
16
|
+
limits_sum: "limits_sum";
|
|
17
|
+
excludes: "excludes";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const cancellationPolicyTypeSchema: z.ZodEnum<{
|
|
20
|
+
simple: "simple";
|
|
21
|
+
advanced: "advanced";
|
|
22
|
+
non_refundable: "non_refundable";
|
|
23
|
+
custom: "custom";
|
|
24
|
+
}>;
|
|
25
|
+
export declare const cancellationChargeTypeSchema: z.ZodEnum<{
|
|
26
|
+
none: "none";
|
|
27
|
+
amount: "amount";
|
|
28
|
+
percentage: "percentage";
|
|
29
|
+
}>;
|
|
30
|
+
export declare const priceCatalogTypeSchema: z.ZodEnum<{
|
|
31
|
+
internal: "internal";
|
|
32
|
+
other: "other";
|
|
33
|
+
public: "public";
|
|
34
|
+
contract: "contract";
|
|
35
|
+
net: "net";
|
|
36
|
+
gross: "gross";
|
|
37
|
+
promo: "promo";
|
|
38
|
+
}>;
|
|
39
|
+
export declare const optionPricingModeSchema: z.ZodEnum<{
|
|
40
|
+
per_person: "per_person";
|
|
41
|
+
per_booking: "per_booking";
|
|
42
|
+
starting_from: "starting_from";
|
|
43
|
+
free: "free";
|
|
44
|
+
on_request: "on_request";
|
|
45
|
+
}>;
|
|
46
|
+
export declare const optionUnitPricingModeSchema: z.ZodEnum<{
|
|
47
|
+
per_person: "per_person";
|
|
48
|
+
per_booking: "per_booking";
|
|
49
|
+
free: "free";
|
|
50
|
+
on_request: "on_request";
|
|
51
|
+
per_unit: "per_unit";
|
|
52
|
+
included: "included";
|
|
53
|
+
}>;
|
|
54
|
+
export declare const optionStartTimeRuleModeSchema: z.ZodEnum<{
|
|
55
|
+
included: "included";
|
|
56
|
+
excluded: "excluded";
|
|
57
|
+
override: "override";
|
|
58
|
+
adjustment: "adjustment";
|
|
59
|
+
}>;
|
|
60
|
+
export declare const priceAdjustmentTypeSchema: z.ZodEnum<{
|
|
61
|
+
fixed: "fixed";
|
|
62
|
+
percentage: "percentage";
|
|
63
|
+
}>;
|
|
64
|
+
export declare const addonPricingModeSchema: z.ZodEnum<{
|
|
65
|
+
per_person: "per_person";
|
|
66
|
+
per_booking: "per_booking";
|
|
67
|
+
on_request: "on_request";
|
|
68
|
+
included: "included";
|
|
69
|
+
unavailable: "unavailable";
|
|
70
|
+
}>;
|
|
71
|
+
//# sourceMappingURL=validation-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-shared.d.ts","sourceRoot":"","sources":["../src/validation-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,yBAAyB;;;;;;;;;;EAUpC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;EAKtC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;EAKvC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;EAA2C,CAAA;AACpF,eAAO,MAAM,sBAAsB;;;;;;;;EAQjC,CAAA;AACF,eAAO,MAAM,uBAAuB;;;;;;EAMlC,CAAA;AACF,eAAO,MAAM,2BAA2B;;;;;;;EAOtC,CAAA;AACF,eAAO,MAAM,6BAA6B;;;;;EAKxC,CAAA;AACF,eAAO,MAAM,yBAAyB;;;EAAkC,CAAA;AACxE,eAAO,MAAM,sBAAsB;;;;;;EAMjC,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const pricingCategoryTypeSchema = z.enum([
|
|
3
|
+
"adult",
|
|
4
|
+
"child",
|
|
5
|
+
"infant",
|
|
6
|
+
"senior",
|
|
7
|
+
"group",
|
|
8
|
+
"room",
|
|
9
|
+
"vehicle",
|
|
10
|
+
"service",
|
|
11
|
+
"other",
|
|
12
|
+
]);
|
|
13
|
+
export const pricingDependencyTypeSchema = z.enum([
|
|
14
|
+
"requires",
|
|
15
|
+
"limits_per_master",
|
|
16
|
+
"limits_sum",
|
|
17
|
+
"excludes",
|
|
18
|
+
]);
|
|
19
|
+
export const cancellationPolicyTypeSchema = z.enum([
|
|
20
|
+
"simple",
|
|
21
|
+
"advanced",
|
|
22
|
+
"non_refundable",
|
|
23
|
+
"custom",
|
|
24
|
+
]);
|
|
25
|
+
export const cancellationChargeTypeSchema = z.enum(["none", "amount", "percentage"]);
|
|
26
|
+
export const priceCatalogTypeSchema = z.enum([
|
|
27
|
+
"public",
|
|
28
|
+
"contract",
|
|
29
|
+
"net",
|
|
30
|
+
"gross",
|
|
31
|
+
"promo",
|
|
32
|
+
"internal",
|
|
33
|
+
"other",
|
|
34
|
+
]);
|
|
35
|
+
export const optionPricingModeSchema = z.enum([
|
|
36
|
+
"per_person",
|
|
37
|
+
"per_booking",
|
|
38
|
+
"starting_from",
|
|
39
|
+
"free",
|
|
40
|
+
"on_request",
|
|
41
|
+
]);
|
|
42
|
+
export const optionUnitPricingModeSchema = z.enum([
|
|
43
|
+
"per_unit",
|
|
44
|
+
"per_person",
|
|
45
|
+
"per_booking",
|
|
46
|
+
"included",
|
|
47
|
+
"free",
|
|
48
|
+
"on_request",
|
|
49
|
+
]);
|
|
50
|
+
export const optionStartTimeRuleModeSchema = z.enum([
|
|
51
|
+
"included",
|
|
52
|
+
"excluded",
|
|
53
|
+
"override",
|
|
54
|
+
"adjustment",
|
|
55
|
+
]);
|
|
56
|
+
export const priceAdjustmentTypeSchema = z.enum(["fixed", "percentage"]);
|
|
57
|
+
export const addonPricingModeSchema = z.enum([
|
|
58
|
+
"included",
|
|
59
|
+
"per_person",
|
|
60
|
+
"per_booking",
|
|
61
|
+
"on_request",
|
|
62
|
+
"unavailable",
|
|
63
|
+
]);
|