@voyantjs/catalog-authoring 0.104.1 → 0.106.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/spec.d.ts CHANGED
@@ -5,12 +5,12 @@ export declare const unitSpecSchema: z.ZodObject<{
5
5
  code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
6
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
7
  unitType: z.ZodDefault<z.ZodEnum<{
8
- person: "person";
9
8
  group: "group";
10
9
  room: "room";
11
10
  vehicle: "vehicle";
12
11
  service: "service";
13
12
  other: "other";
13
+ person: "person";
14
14
  }>>;
15
15
  minQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
16
  maxQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -34,12 +34,12 @@ export declare const unitPriceRuleSpecSchema: z.ZodObject<{
34
34
  unitRef: z.ZodString;
35
35
  pricingCategoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
36
  pricingMode: z.ZodDefault<z.ZodEnum<{
37
- per_unit: "per_unit";
38
37
  per_person: "per_person";
39
38
  per_booking: "per_booking";
40
- included: "included";
41
39
  free: "free";
42
40
  on_request: "on_request";
41
+ per_unit: "per_unit";
42
+ included: "included";
43
43
  }>>;
44
44
  sellAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
45
45
  costAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -48,6 +48,7 @@ export declare const unitPriceRuleSpecSchema: z.ZodObject<{
48
48
  active: z.ZodDefault<z.ZodBoolean>;
49
49
  sortOrder: z.ZodDefault<z.ZodNumber>;
50
50
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
51
52
  tiers: z.ZodDefault<z.ZodArray<z.ZodObject<{
52
53
  minQuantity: z.ZodNumber;
53
54
  maxQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -67,9 +68,9 @@ export declare const optionPriceRuleSpecSchema: z.ZodObject<{
67
68
  pricingMode: z.ZodDefault<z.ZodEnum<{
68
69
  per_person: "per_person";
69
70
  per_booking: "per_booking";
71
+ starting_from: "starting_from";
70
72
  free: "free";
71
73
  on_request: "on_request";
72
- starting_from: "starting_from";
73
74
  }>>;
74
75
  baseSellAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
75
76
  baseCostAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -78,16 +79,18 @@ export declare const optionPriceRuleSpecSchema: z.ZodObject<{
78
79
  allPricingCategories: z.ZodDefault<z.ZodBoolean>;
79
80
  isDefault: z.ZodDefault<z.ZodBoolean>;
80
81
  active: z.ZodDefault<z.ZodBoolean>;
82
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
81
84
  unitPriceRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
82
85
  unitRef: z.ZodString;
83
86
  pricingCategoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
87
  pricingMode: z.ZodDefault<z.ZodEnum<{
85
- per_unit: "per_unit";
86
88
  per_person: "per_person";
87
89
  per_booking: "per_booking";
88
- included: "included";
89
90
  free: "free";
90
91
  on_request: "on_request";
92
+ per_unit: "per_unit";
93
+ included: "included";
91
94
  }>>;
92
95
  sellAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
93
96
  costAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -96,6 +99,7 @@ export declare const optionPriceRuleSpecSchema: z.ZodObject<{
96
99
  active: z.ZodDefault<z.ZodBoolean>;
97
100
  sortOrder: z.ZodDefault<z.ZodNumber>;
98
101
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
99
103
  tiers: z.ZodDefault<z.ZodArray<z.ZodObject<{
100
104
  minQuantity: z.ZodNumber;
101
105
  maxQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -114,7 +118,6 @@ export declare const optionSpecSchema: z.ZodObject<{
114
118
  status: z.ZodDefault<z.ZodEnum<{
115
119
  active: "active";
116
120
  draft: "draft";
117
- inactive: "inactive";
118
121
  archived: "archived";
119
122
  }>>;
120
123
  isDefault: z.ZodDefault<z.ZodBoolean>;
@@ -127,12 +130,12 @@ export declare const optionSpecSchema: z.ZodObject<{
127
130
  code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
128
131
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
129
132
  unitType: z.ZodDefault<z.ZodEnum<{
130
- person: "person";
131
133
  group: "group";
132
134
  room: "room";
133
135
  vehicle: "vehicle";
134
136
  service: "service";
135
137
  other: "other";
138
+ person: "person";
136
139
  }>>;
137
140
  minQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
138
141
  maxQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -154,9 +157,9 @@ export declare const optionSpecSchema: z.ZodObject<{
154
157
  pricingMode: z.ZodDefault<z.ZodEnum<{
155
158
  per_person: "per_person";
156
159
  per_booking: "per_booking";
160
+ starting_from: "starting_from";
157
161
  free: "free";
158
162
  on_request: "on_request";
159
- starting_from: "starting_from";
160
163
  }>>;
161
164
  baseSellAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
162
165
  baseCostAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -165,16 +168,18 @@ export declare const optionSpecSchema: z.ZodObject<{
165
168
  allPricingCategories: z.ZodDefault<z.ZodBoolean>;
166
169
  isDefault: z.ZodDefault<z.ZodBoolean>;
167
170
  active: z.ZodDefault<z.ZodBoolean>;
171
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
172
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
168
173
  unitPriceRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
169
174
  unitRef: z.ZodString;
170
175
  pricingCategoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
171
176
  pricingMode: z.ZodDefault<z.ZodEnum<{
172
- per_unit: "per_unit";
173
177
  per_person: "per_person";
174
178
  per_booking: "per_booking";
175
- included: "included";
176
179
  free: "free";
177
180
  on_request: "on_request";
181
+ per_unit: "per_unit";
182
+ included: "included";
178
183
  }>>;
179
184
  sellAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
180
185
  costAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -183,6 +188,7 @@ export declare const optionSpecSchema: z.ZodObject<{
183
188
  active: z.ZodDefault<z.ZodBoolean>;
184
189
  sortOrder: z.ZodDefault<z.ZodNumber>;
185
190
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
191
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
186
192
  tiers: z.ZodDefault<z.ZodArray<z.ZodObject<{
187
193
  minQuantity: z.ZodNumber;
188
194
  maxQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -206,8 +212,8 @@ export declare const dayServiceSpecSchema: z.ZodObject<{
206
212
  supplierServiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
207
213
  serviceType: z.ZodEnum<{
208
214
  other: "other";
209
- accommodation: "accommodation";
210
215
  transfer: "transfer";
216
+ accommodation: "accommodation";
211
217
  experience: "experience";
212
218
  guide: "guide";
213
219
  meal: "meal";
@@ -230,8 +236,8 @@ export declare const daySpecSchema: z.ZodObject<{
230
236
  supplierServiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
237
  serviceType: z.ZodEnum<{
232
238
  other: "other";
233
- accommodation: "accommodation";
234
239
  transfer: "transfer";
240
+ accommodation: "accommodation";
235
241
  experience: "experience";
236
242
  guide: "guide";
237
243
  meal: "meal";
@@ -259,8 +265,8 @@ export declare const itinerarySpecSchema: z.ZodObject<{
259
265
  supplierServiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
260
266
  serviceType: z.ZodEnum<{
261
267
  other: "other";
262
- accommodation: "accommodation";
263
268
  transfer: "transfer";
269
+ accommodation: "accommodation";
264
270
  experience: "experience";
265
271
  guide: "guide";
266
272
  meal: "meal";
@@ -281,43 +287,48 @@ export declare const productRowSpecSchema: z.ZodObject<{
281
287
  status: z.ZodDefault<z.ZodEnum<{
282
288
  active: "active";
283
289
  draft: "draft";
284
- inactive: "inactive";
285
290
  archived: "archived";
286
291
  }>>;
287
292
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
288
293
  inclusionsHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
289
294
  exclusionsHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
295
  termsHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
+ termsShowOnContract: z.ZodDefault<z.ZodBoolean>;
291
297
  bookingMode: z.ZodDefault<z.ZodEnum<{
292
- date: "date";
293
298
  other: "other";
294
- transfer: "transfer";
299
+ date: "date";
295
300
  date_time: "date_time";
296
301
  open: "open";
297
302
  stay: "stay";
303
+ transfer: "transfer";
298
304
  itinerary: "itinerary";
299
305
  }>>;
300
306
  capacityMode: z.ZodDefault<z.ZodEnum<{
307
+ on_request: "on_request";
308
+ free_sale: "free_sale";
301
309
  limited: "limited";
302
- unlimited: "unlimited";
303
310
  }>>;
304
311
  timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
305
312
  defaultLanguageTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
306
313
  visibility: z.ZodDefault<z.ZodEnum<{
307
- private: "private";
308
314
  public: "public";
309
- unlisted: "unlisted";
315
+ private: "private";
316
+ hidden: "hidden";
310
317
  }>>;
311
318
  sellCurrency: z.ZodString;
312
319
  sellAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
313
320
  costAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
314
321
  marginPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
322
+ reservationTimeoutMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
315
323
  facilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
316
324
  supplierId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
317
325
  startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
318
326
  endDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
319
327
  pax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
320
328
  productTypeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
329
+ contractTemplateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
330
+ taxClassId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
331
+ customerPaymentPolicy: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
321
332
  tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
322
333
  }, z.core.$strip>;
323
334
  export declare const productGraphSpecSchema: z.ZodObject<{
@@ -326,43 +337,48 @@ export declare const productGraphSpecSchema: z.ZodObject<{
326
337
  status: z.ZodDefault<z.ZodEnum<{
327
338
  active: "active";
328
339
  draft: "draft";
329
- inactive: "inactive";
330
340
  archived: "archived";
331
341
  }>>;
332
342
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
343
  inclusionsHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
334
344
  exclusionsHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
345
  termsHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
346
+ termsShowOnContract: z.ZodDefault<z.ZodBoolean>;
336
347
  bookingMode: z.ZodDefault<z.ZodEnum<{
337
- date: "date";
338
348
  other: "other";
339
- transfer: "transfer";
349
+ date: "date";
340
350
  date_time: "date_time";
341
351
  open: "open";
342
352
  stay: "stay";
353
+ transfer: "transfer";
343
354
  itinerary: "itinerary";
344
355
  }>>;
345
356
  capacityMode: z.ZodDefault<z.ZodEnum<{
357
+ on_request: "on_request";
358
+ free_sale: "free_sale";
346
359
  limited: "limited";
347
- unlimited: "unlimited";
348
360
  }>>;
349
361
  timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
350
362
  defaultLanguageTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
351
363
  visibility: z.ZodDefault<z.ZodEnum<{
352
- private: "private";
353
364
  public: "public";
354
- unlisted: "unlisted";
365
+ private: "private";
366
+ hidden: "hidden";
355
367
  }>>;
356
368
  sellCurrency: z.ZodString;
357
369
  sellAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
358
370
  costAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
359
371
  marginPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
372
+ reservationTimeoutMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
360
373
  facilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
361
374
  supplierId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
362
375
  startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
363
376
  endDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
364
377
  pax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
365
378
  productTypeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
379
+ contractTemplateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
380
+ taxClassId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
381
+ customerPaymentPolicy: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
366
382
  tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
367
383
  }, z.core.$strip>;
368
384
  options: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -373,7 +389,6 @@ export declare const productGraphSpecSchema: z.ZodObject<{
373
389
  status: z.ZodDefault<z.ZodEnum<{
374
390
  active: "active";
375
391
  draft: "draft";
376
- inactive: "inactive";
377
392
  archived: "archived";
378
393
  }>>;
379
394
  isDefault: z.ZodDefault<z.ZodBoolean>;
@@ -386,12 +401,12 @@ export declare const productGraphSpecSchema: z.ZodObject<{
386
401
  code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
387
402
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
388
403
  unitType: z.ZodDefault<z.ZodEnum<{
389
- person: "person";
390
404
  group: "group";
391
405
  room: "room";
392
406
  vehicle: "vehicle";
393
407
  service: "service";
394
408
  other: "other";
409
+ person: "person";
395
410
  }>>;
396
411
  minQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
397
412
  maxQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -413,9 +428,9 @@ export declare const productGraphSpecSchema: z.ZodObject<{
413
428
  pricingMode: z.ZodDefault<z.ZodEnum<{
414
429
  per_person: "per_person";
415
430
  per_booking: "per_booking";
431
+ starting_from: "starting_from";
416
432
  free: "free";
417
433
  on_request: "on_request";
418
- starting_from: "starting_from";
419
434
  }>>;
420
435
  baseSellAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
421
436
  baseCostAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -424,16 +439,18 @@ export declare const productGraphSpecSchema: z.ZodObject<{
424
439
  allPricingCategories: z.ZodDefault<z.ZodBoolean>;
425
440
  isDefault: z.ZodDefault<z.ZodBoolean>;
426
441
  active: z.ZodDefault<z.ZodBoolean>;
442
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
443
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
427
444
  unitPriceRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
428
445
  unitRef: z.ZodString;
429
446
  pricingCategoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
430
447
  pricingMode: z.ZodDefault<z.ZodEnum<{
431
- per_unit: "per_unit";
432
448
  per_person: "per_person";
433
449
  per_booking: "per_booking";
434
- included: "included";
435
450
  free: "free";
436
451
  on_request: "on_request";
452
+ per_unit: "per_unit";
453
+ included: "included";
437
454
  }>>;
438
455
  sellAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
439
456
  costAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -442,6 +459,7 @@ export declare const productGraphSpecSchema: z.ZodObject<{
442
459
  active: z.ZodDefault<z.ZodBoolean>;
443
460
  sortOrder: z.ZodDefault<z.ZodNumber>;
444
461
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
462
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
445
463
  tiers: z.ZodDefault<z.ZodArray<z.ZodObject<{
446
464
  minQuantity: z.ZodNumber;
447
465
  maxQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -474,8 +492,8 @@ export declare const productGraphSpecSchema: z.ZodObject<{
474
492
  supplierServiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
475
493
  serviceType: z.ZodEnum<{
476
494
  other: "other";
477
- accommodation: "accommodation";
478
495
  transfer: "transfer";
496
+ accommodation: "accommodation";
479
497
  experience: "experience";
480
498
  guide: "guide";
481
499
  meal: "meal";
@@ -1 +1 @@
1
- {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../src/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAuBvB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;iBAezB,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;iBAO7B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAelC,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A"}
package/dist/spec.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { optionPricingModeEnum, optionUnitPricingModeEnum } from "@voyantjs/pricing/schema";
2
+ import { optionUnitTypeEnum, productBookingModeEnum, productCapacityModeEnum, productOptionStatusEnum, productStatusEnum, productVisibilityEnum, serviceTypeEnum, } from "@voyantjs/products/schema";
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * Normalized, transport-agnostic description of a bookable product graph.
@@ -18,12 +20,13 @@ import { z } from "zod";
18
20
  * Home of this type is under review (here vs `@voyantjs/products-contracts`).
19
21
  */
20
22
  const money = z.number().int();
23
+ const jsonRecord = z.record(z.string(), z.unknown());
21
24
  export const unitSpecSchema = z.object({
22
25
  ref: z.string().min(1),
23
26
  name: z.string().min(1).max(255),
24
27
  code: z.string().max(255).nullish(),
25
28
  description: z.string().nullish(),
26
- unitType: z.enum(["person", "group", "room", "vehicle", "service", "other"]).default("person"),
29
+ unitType: z.enum(optionUnitTypeEnum.enumValues).default("person"),
27
30
  minQuantity: z.number().int().nullish(),
28
31
  maxQuantity: z.number().int().nullish(),
29
32
  minAge: z.number().int().nullish(),
@@ -46,9 +49,7 @@ export const unitPriceRuleSpecSchema = z.object({
46
49
  /** Resolves to a sibling unit's `ref` within the same option. */
47
50
  unitRef: z.string().min(1),
48
51
  pricingCategoryId: z.string().nullish(),
49
- pricingMode: z
50
- .enum(["per_unit", "per_person", "per_booking", "included", "free", "on_request"])
51
- .default("per_unit"),
52
+ pricingMode: z.enum(optionUnitPricingModeEnum.enumValues).default("per_unit"),
52
53
  sellAmountCents: money.nullish(),
53
54
  costAmountCents: money.nullish(),
54
55
  minQuantity: z.number().int().nullish(),
@@ -56,6 +57,7 @@ export const unitPriceRuleSpecSchema = z.object({
56
57
  active: z.boolean().default(true),
57
58
  sortOrder: z.number().int().default(0),
58
59
  notes: z.string().nullish(),
60
+ metadata: jsonRecord.nullish(),
59
61
  tiers: z.array(unitTierSpecSchema).default([]),
60
62
  });
61
63
  export const optionPriceRuleSpecSchema = z.object({
@@ -69,9 +71,7 @@ export const optionPriceRuleSpecSchema = z.object({
69
71
  code: z.string().nullish(),
70
72
  name: z.string().min(1).max(255),
71
73
  description: z.string().nullish(),
72
- pricingMode: z
73
- .enum(["per_person", "per_booking", "starting_from", "free", "on_request"])
74
- .default("per_person"),
74
+ pricingMode: z.enum(optionPricingModeEnum.enumValues).default("per_person"),
75
75
  baseSellAmountCents: money.nullish(),
76
76
  baseCostAmountCents: money.nullish(),
77
77
  minPerBooking: z.number().int().nullish(),
@@ -79,6 +79,8 @@ export const optionPriceRuleSpecSchema = z.object({
79
79
  allPricingCategories: z.boolean().default(true),
80
80
  isDefault: z.boolean().default(false),
81
81
  active: z.boolean().default(true),
82
+ notes: z.string().nullish(),
83
+ metadata: jsonRecord.nullish(),
82
84
  unitPriceRules: z.array(unitPriceRuleSpecSchema).default([]),
83
85
  });
84
86
  export const optionSpecSchema = z.object({
@@ -86,7 +88,7 @@ export const optionSpecSchema = z.object({
86
88
  name: z.string().min(1).max(255),
87
89
  code: z.string().max(255).nullish(),
88
90
  description: z.string().nullish(),
89
- status: z.enum(["draft", "active", "inactive", "archived"]).default("draft"),
91
+ status: z.enum(productOptionStatusEnum.enumValues).default("draft"),
90
92
  isDefault: z.boolean().default(false),
91
93
  sortOrder: z.number().int().default(0),
92
94
  availableFrom: z.string().nullish(),
@@ -105,7 +107,7 @@ export const paxPricingTierSpecSchema = z.object({
105
107
  });
106
108
  export const dayServiceSpecSchema = z.object({
107
109
  supplierServiceId: z.string().nullish(),
108
- serviceType: z.enum(["accommodation", "transfer", "experience", "guide", "meal", "other"]),
110
+ serviceType: z.enum(serviceTypeEnum.enumValues),
109
111
  name: z.string().min(1).max(255),
110
112
  description: z.string().nullish(),
111
113
  countryCode: z.string().nullish(),
@@ -130,28 +132,31 @@ export const itinerarySpecSchema = z.object({
130
132
  });
131
133
  export const productRowSpecSchema = z.object({
132
134
  name: z.string().min(1).max(255),
133
- status: z.enum(["draft", "active", "inactive", "archived"]).default("draft"),
135
+ status: z.enum(productStatusEnum.enumValues).default("draft"),
134
136
  description: z.string().nullish(),
135
137
  inclusionsHtml: z.string().nullish(),
136
138
  exclusionsHtml: z.string().nullish(),
137
139
  termsHtml: z.string().nullish(),
138
- bookingMode: z
139
- .enum(["date", "date_time", "open", "stay", "transfer", "itinerary", "other"])
140
- .default("date"),
141
- capacityMode: z.enum(["limited", "unlimited"]).default("limited"),
140
+ termsShowOnContract: z.boolean().default(false),
141
+ bookingMode: z.enum(productBookingModeEnum.enumValues).default("date"),
142
+ capacityMode: z.enum(productCapacityModeEnum.enumValues).default("limited"),
142
143
  timezone: z.string().nullish(),
143
144
  defaultLanguageTag: z.string().nullish(),
144
- visibility: z.enum(["private", "public", "unlisted"]).default("private"),
145
+ visibility: z.enum(productVisibilityEnum.enumValues).default("private"),
145
146
  sellCurrency: z.string().min(3).max(3),
146
147
  sellAmountCents: money.nullish(),
147
148
  costAmountCents: money.nullish(),
148
149
  marginPercent: z.number().int().nullish(),
150
+ reservationTimeoutMinutes: z.number().int().nullish(),
149
151
  facilityId: z.string().nullish(),
150
152
  supplierId: z.string().nullish(),
151
153
  startDate: z.string().nullish(),
152
154
  endDate: z.string().nullish(),
153
155
  pax: z.number().int().nullish(),
154
156
  productTypeId: z.string().nullish(),
157
+ contractTemplateId: z.string().nullish(),
158
+ taxClassId: z.string().nullish(),
159
+ customerPaymentPolicy: z.unknown().nullish(),
155
160
  tags: z.array(z.string()).default([]),
156
161
  });
157
162
  export const productGraphSpecSchema = z.object({
@@ -0,0 +1,17 @@
1
+ import type { AuthoringIssue } from "./errors.js";
2
+ import type { ProductGraphSpec } from "./spec.js";
3
+ /**
4
+ * Category-aware shape validation. Runs before the builder (compose path) so a
5
+ * wrong-shape spec is rejected with descriptive, agent-recoverable issues
6
+ * instead of producing a malformed-but-bookable product.
7
+ *
8
+ * Keyed on `bookingMode` (the structural classifier that exists in the schema
9
+ * today; `supplyModel` is still proposed). See the voyantjs/platform authoring
10
+ * spec for the canonical per-category rules.
11
+ *
12
+ * Scope: the generic products graph — excursion (`date`/`date_time`), multi-day
13
+ * tour/package (`itinerary`), transfer (`transfer`). Other modes (`stay`,
14
+ * `open`, `other`) pass through leniently in v1.
15
+ */
16
+ export declare function validateProductGraph(spec: ProductGraphSpec): AuthoringIssue[];
17
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAEjD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,gBAAgB,GAAG,cAAc,EAAE,CAyE7E"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Category-aware shape validation. Runs before the builder (compose path) so a
3
+ * wrong-shape spec is rejected with descriptive, agent-recoverable issues
4
+ * instead of producing a malformed-but-bookable product.
5
+ *
6
+ * Keyed on `bookingMode` (the structural classifier that exists in the schema
7
+ * today; `supplyModel` is still proposed). See the voyantjs/platform authoring
8
+ * spec for the canonical per-category rules.
9
+ *
10
+ * Scope: the generic products graph — excursion (`date`/`date_time`), multi-day
11
+ * tour/package (`itinerary`), transfer (`transfer`). Other modes (`stay`,
12
+ * `open`, `other`) pass through leniently in v1.
13
+ */
14
+ export function validateProductGraph(spec) {
15
+ const issues = [];
16
+ const mode = spec.product.bookingMode;
17
+ const totalDays = spec.itineraries.reduce((n, i) => n + i.days.length, 0);
18
+ const allUnits = spec.options.flatMap((o) => o.units);
19
+ // Every bookable product needs at least one option with a unit.
20
+ if (spec.options.length === 0) {
21
+ issues.push({
22
+ code: "no_options",
23
+ field: "options",
24
+ message: "Product has no options, so it cannot be booked.",
25
+ fix: "Add at least one option with at least one unit.",
26
+ });
27
+ }
28
+ else if (allUnits.length === 0) {
29
+ issues.push({
30
+ code: "no_units",
31
+ field: "options[].units",
32
+ message: "No option has any units, so there is nothing to price or book.",
33
+ fix: "Add at least one unit (e.g. an 'Adult' person unit) to an option.",
34
+ });
35
+ }
36
+ if (mode === "date" || mode === "date_time") {
37
+ if (totalDays > 1) {
38
+ issues.push({
39
+ code: "excursion_multi_day",
40
+ field: "itineraries",
41
+ message: `A '${mode}' (excursion) product is single-day, but the spec has ${totalDays} itinerary days.`,
42
+ fix: "Use bookingMode 'itinerary' for a multi-day product, or reduce the itinerary to a single day.",
43
+ });
44
+ }
45
+ const roomUnit = allUnits.find((u) => u.unitType === "room");
46
+ if (roomUnit) {
47
+ issues.push({
48
+ code: "excursion_room_unit",
49
+ field: "options[].units[].unitType",
50
+ message: `Excursions price per person, but unit '${roomUnit.name}' has unitType 'room'.`,
51
+ fix: "Set the unit's unitType to 'person', or switch bookingMode to 'stay'/'itinerary' for room-based products.",
52
+ });
53
+ }
54
+ }
55
+ if (mode === "itinerary" && totalDays < 2) {
56
+ issues.push({
57
+ code: "tour_needs_days",
58
+ field: "itineraries",
59
+ message: `A multi-day ('itinerary') product needs at least 2 itinerary days; found ${totalDays}.`,
60
+ fix: "Add itinerary days, or use bookingMode 'date' for a single-day excursion.",
61
+ });
62
+ }
63
+ if (mode === "transfer") {
64
+ if (totalDays > 0) {
65
+ issues.push({
66
+ code: "transfer_no_days",
67
+ field: "itineraries",
68
+ message: `Transfers are point-to-point and take no itinerary days; found ${totalDays}.`,
69
+ fix: "Remove the itinerary days; model the journey via pickup/dropoff pricing instead.",
70
+ });
71
+ }
72
+ const badUnit = allUnits.find((u) => u.unitType !== "vehicle" && u.unitType !== "person");
73
+ if (badUnit) {
74
+ issues.push({
75
+ code: "transfer_unit_type",
76
+ field: "options[].units[].unitType",
77
+ message: `Transfer unit '${badUnit.name}' has unitType '${badUnit.unitType}'; transfers sell per vehicle or per seat.`,
78
+ fix: "Set the unit's unitType to 'vehicle' or 'person'.",
79
+ });
80
+ }
81
+ }
82
+ return issues;
83
+ }