@voyantjs/bookings 0.119.2 → 0.119.3

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.
Files changed (37) hide show
  1. package/dist/pricing-assignment/age.d.ts +33 -0
  2. package/dist/pricing-assignment/age.d.ts.map +1 -0
  3. package/dist/pricing-assignment/age.js +109 -0
  4. package/dist/pricing-assignment/draft.d.ts +69 -0
  5. package/dist/pricing-assignment/draft.d.ts.map +1 -0
  6. package/dist/pricing-assignment/draft.js +284 -0
  7. package/dist/pricing-assignment/types.d.ts +113 -0
  8. package/dist/pricing-assignment/types.d.ts.map +1 -0
  9. package/dist/pricing-assignment/types.js +30 -0
  10. package/dist/pricing-assignment/unit-helpers.d.ts +11 -0
  11. package/dist/pricing-assignment/unit-helpers.d.ts.map +1 -0
  12. package/dist/pricing-assignment/unit-helpers.js +19 -0
  13. package/dist/pricing-assignment/verify.d.ts +67 -0
  14. package/dist/pricing-assignment/verify.d.ts.map +1 -0
  15. package/dist/pricing-assignment/verify.js +121 -0
  16. package/dist/pricing-assignment.d.ts +4 -275
  17. package/dist/pricing-assignment.d.ts.map +1 -1
  18. package/dist/pricing-assignment.js +4 -559
  19. package/dist/routes-admin.d.ts +2894 -0
  20. package/dist/routes-admin.d.ts.map +1 -0
  21. package/dist/routes-admin.js +2111 -0
  22. package/dist/routes.d.ts +1 -2893
  23. package/dist/routes.d.ts.map +1 -1
  24. package/dist/routes.js +1 -2111
  25. package/dist/service-core.d.ts +6240 -0
  26. package/dist/service-core.d.ts.map +1 -0
  27. package/dist/service-core.js +4350 -0
  28. package/dist/service-public-core.d.ts +907 -0
  29. package/dist/service-public-core.d.ts.map +1 -0
  30. package/dist/service-public-core.js +1176 -0
  31. package/dist/service-public.d.ts +1 -906
  32. package/dist/service-public.d.ts.map +1 -1
  33. package/dist/service-public.js +1 -1176
  34. package/dist/service.d.ts +1 -6239
  35. package/dist/service.d.ts.map +1 -1
  36. package/dist/service.js +1 -4350
  37. package/package.json +5 -5
@@ -0,0 +1,907 @@
1
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
+ import type { ResolveBookingBillingPerson, ResolveBookingTravelerPerson } from "./route-runtime.js";
3
+ import { type BookingServiceRuntime } from "./service.js";
4
+ import type { InternalBookingOverviewLookupQuery, PublicBookingOverviewAccessQuery, PublicBookingOverviewLookupQuery, PublicBookingSessionMutationInput, PublicBookingSessionRepriceInput, PublicCreateBookingSessionInput, PublicUpdateBookingSessionInput, PublicUpsertBookingSessionStateInput } from "./validation-public.js";
5
+ /**
6
+ * Optional resolver bundle for storefront/public booking flows. When
7
+ * supplied, billing-contact + traveler payloads are run through the
8
+ * caller's resolver to look up (or create) the matching CRM person
9
+ * and the booking / traveler rows pick up the resulting `person_id`.
10
+ * Default (omitted) behaviour is the historic one: rows land with
11
+ * `person_id = NULL`. See issue #961.
12
+ */
13
+ export interface PublicBookingsServiceResolvers {
14
+ resolveBillingPerson?: ResolveBookingBillingPerson;
15
+ resolveTravelerPerson?: ResolveBookingTravelerPerson;
16
+ }
17
+ /**
18
+ * Resolves the catalog-scoped pricing snapshot for a product (options → option
19
+ * price rules → per-unit price rules → tiers). The snapshot is the same data
20
+ * the storefront booking session uses to compute a total — exposing it as a
21
+ * standalone admin preview lets operator dialogs, tour-sheet exports, and
22
+ * reconciliation flows see the same numbers the customer would see, without
23
+ * creating a throwaway session.
24
+ *
25
+ * Returns `null` when the product isn't publicly visible or there's no active
26
+ * catalog / matching option (caller can decide whether to 404 or surface a
27
+ * "pricing unavailable for this selection" message).
28
+ */
29
+ export declare function resolveSessionPricingSnapshot(db: PostgresJsDatabase, productId: string, input: {
30
+ catalogId?: string | undefined;
31
+ departureId?: string | undefined;
32
+ optionId?: string | undefined;
33
+ /** Public/session flows require storefront-visible products. Admin previews can price active internal products. */
34
+ requirePublicProduct?: boolean | undefined;
35
+ }): Promise<{
36
+ catalog: {
37
+ id: string;
38
+ currencyCode: string | null;
39
+ };
40
+ options: {
41
+ id: string;
42
+ name: string;
43
+ isDefault: boolean;
44
+ }[];
45
+ rules: {
46
+ id: string;
47
+ optionId: string;
48
+ pricingMode: string;
49
+ baseSellAmountCents: number | null;
50
+ isDefault: boolean;
51
+ }[];
52
+ pricingCategories: never[] | {
53
+ id: string;
54
+ name: string;
55
+ code: string | null;
56
+ categoryType: string;
57
+ minAge: number | null;
58
+ maxAge: number | null;
59
+ metadata: Record<string, unknown> | null;
60
+ sortOrder: number;
61
+ }[];
62
+ unitPrices: {
63
+ sellAmountCents: number | null;
64
+ tiers: {
65
+ id: string;
66
+ optionUnitPriceRuleId: string;
67
+ minQuantity: number;
68
+ maxQuantity: number | null;
69
+ sellAmountCents: number | null;
70
+ sortOrder: number;
71
+ }[];
72
+ id: string;
73
+ optionPriceRuleId: string;
74
+ optionId: string;
75
+ unitId: string;
76
+ unitName: string;
77
+ unitType: string | null;
78
+ occupancyMax: number | null;
79
+ pricingCategoryId: string | null;
80
+ pricingMode: string;
81
+ minQuantity: number | null;
82
+ maxQuantity: number | null;
83
+ }[];
84
+ } | null>;
85
+ export declare const publicBookingsService: {
86
+ createSession(db: PostgresJsDatabase, input: PublicCreateBookingSessionInput, userId?: string, resolvers?: PublicBookingsServiceResolvers): Promise<{
87
+ status: Exclude<string, "ok">;
88
+ } | {
89
+ status: "ok";
90
+ session: {
91
+ sessionId: string;
92
+ bookingNumber: string;
93
+ status: "expired" | "cancelled" | "completed" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress";
94
+ externalBookingRef: string | null;
95
+ communicationLanguage: string | null;
96
+ sellCurrency: string;
97
+ sellAmountCents: number | null;
98
+ startDate: string | null;
99
+ endDate: string | null;
100
+ pax: number | null;
101
+ holdExpiresAt: string | null;
102
+ confirmedAt: string | null;
103
+ expiredAt: string | null;
104
+ cancelledAt: string | null;
105
+ completedAt: string | null;
106
+ travelers: {
107
+ id: string;
108
+ participantType: "other" | "traveler" | "occupant";
109
+ travelerCategory: "child" | "other" | "adult" | "infant" | "senior" | null;
110
+ firstName: string;
111
+ lastName: string;
112
+ email: string | null;
113
+ phone: string | null;
114
+ preferredLanguage: string | null;
115
+ specialRequests: string | null;
116
+ isPrimary: boolean;
117
+ notes: string | null;
118
+ }[];
119
+ items: {
120
+ id: string;
121
+ title: string;
122
+ description: string | null;
123
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
124
+ status: "expired" | "cancelled" | "draft" | "on_hold" | "confirmed" | "fulfilled";
125
+ serviceDate: string | null;
126
+ startsAt: string | null;
127
+ endsAt: string | null;
128
+ quantity: number;
129
+ sellCurrency: string;
130
+ unitSellAmountCents: number | null;
131
+ totalSellAmountCents: number | null;
132
+ costCurrency: string | null;
133
+ unitCostAmountCents: number | null;
134
+ totalCostAmountCents: number | null;
135
+ notes: string | null;
136
+ productId: string | null;
137
+ optionId: string | null;
138
+ optionUnitId: string | null;
139
+ pricingCategoryId: string | null;
140
+ travelerLinks: {
141
+ id: string;
142
+ travelerId: string;
143
+ role: string;
144
+ isPrimary: boolean;
145
+ }[];
146
+ }[];
147
+ allocations: {
148
+ id: string;
149
+ bookingItemId: string;
150
+ productId: string | null;
151
+ optionId: string | null;
152
+ optionUnitId: string | null;
153
+ pricingCategoryId: string | null;
154
+ availabilitySlotId: string | null;
155
+ quantity: number;
156
+ allocationType: "resource" | "unit" | "pickup";
157
+ status: "expired" | "cancelled" | "confirmed" | "fulfilled" | "held" | "released";
158
+ holdExpiresAt: string | null;
159
+ confirmedAt: string | null;
160
+ releasedAt: string | null;
161
+ }[];
162
+ checklist: {
163
+ hasTravelers: boolean;
164
+ hasPrimaryTraveler: boolean;
165
+ hasItems: boolean;
166
+ hasAllocations: boolean;
167
+ readyForConfirmation: boolean;
168
+ };
169
+ state: {
170
+ sessionId: string;
171
+ stateKey: "wizard";
172
+ currentStep: string | null;
173
+ completedSteps: string[];
174
+ payload: Record<string, unknown>;
175
+ version: number;
176
+ createdAt: string;
177
+ updatedAt: string;
178
+ } | null;
179
+ };
180
+ }>;
181
+ getSessionById(db: PostgresJsDatabase, bookingId: string): Promise<{
182
+ sessionId: string;
183
+ bookingNumber: string;
184
+ status: "expired" | "cancelled" | "completed" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress";
185
+ externalBookingRef: string | null;
186
+ communicationLanguage: string | null;
187
+ sellCurrency: string;
188
+ sellAmountCents: number | null;
189
+ startDate: string | null;
190
+ endDate: string | null;
191
+ pax: number | null;
192
+ holdExpiresAt: string | null;
193
+ confirmedAt: string | null;
194
+ expiredAt: string | null;
195
+ cancelledAt: string | null;
196
+ completedAt: string | null;
197
+ travelers: {
198
+ id: string;
199
+ participantType: "other" | "traveler" | "occupant";
200
+ travelerCategory: "child" | "other" | "adult" | "infant" | "senior" | null;
201
+ firstName: string;
202
+ lastName: string;
203
+ email: string | null;
204
+ phone: string | null;
205
+ preferredLanguage: string | null;
206
+ specialRequests: string | null;
207
+ isPrimary: boolean;
208
+ notes: string | null;
209
+ }[];
210
+ items: {
211
+ id: string;
212
+ title: string;
213
+ description: string | null;
214
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
215
+ status: "expired" | "cancelled" | "draft" | "on_hold" | "confirmed" | "fulfilled";
216
+ serviceDate: string | null;
217
+ startsAt: string | null;
218
+ endsAt: string | null;
219
+ quantity: number;
220
+ sellCurrency: string;
221
+ unitSellAmountCents: number | null;
222
+ totalSellAmountCents: number | null;
223
+ costCurrency: string | null;
224
+ unitCostAmountCents: number | null;
225
+ totalCostAmountCents: number | null;
226
+ notes: string | null;
227
+ productId: string | null;
228
+ optionId: string | null;
229
+ optionUnitId: string | null;
230
+ pricingCategoryId: string | null;
231
+ travelerLinks: {
232
+ id: string;
233
+ travelerId: string;
234
+ role: string;
235
+ isPrimary: boolean;
236
+ }[];
237
+ }[];
238
+ allocations: {
239
+ id: string;
240
+ bookingItemId: string;
241
+ productId: string | null;
242
+ optionId: string | null;
243
+ optionUnitId: string | null;
244
+ pricingCategoryId: string | null;
245
+ availabilitySlotId: string | null;
246
+ quantity: number;
247
+ allocationType: "resource" | "unit" | "pickup";
248
+ status: "expired" | "cancelled" | "confirmed" | "fulfilled" | "held" | "released";
249
+ holdExpiresAt: string | null;
250
+ confirmedAt: string | null;
251
+ releasedAt: string | null;
252
+ }[];
253
+ checklist: {
254
+ hasTravelers: boolean;
255
+ hasPrimaryTraveler: boolean;
256
+ hasItems: boolean;
257
+ hasAllocations: boolean;
258
+ readyForConfirmation: boolean;
259
+ };
260
+ state: {
261
+ sessionId: string;
262
+ stateKey: "wizard";
263
+ currentStep: string | null;
264
+ completedSteps: string[];
265
+ payload: Record<string, unknown>;
266
+ version: number;
267
+ createdAt: string;
268
+ updatedAt: string;
269
+ } | null;
270
+ } | null>;
271
+ getSessionState(db: PostgresJsDatabase, bookingId: string): Promise<{
272
+ sessionId: string;
273
+ stateKey: "wizard";
274
+ currentStep: string | null;
275
+ completedSteps: string[];
276
+ payload: Record<string, unknown>;
277
+ version: number;
278
+ createdAt: string;
279
+ updatedAt: string;
280
+ } | null>;
281
+ updateSessionState(db: PostgresJsDatabase, bookingId: string, input: PublicUpsertBookingSessionStateInput, resolvers?: PublicBookingsServiceResolvers, userId?: string): Promise<{
282
+ status: "not_found";
283
+ state?: undefined;
284
+ } | {
285
+ status: "ok";
286
+ state: {
287
+ sessionId: string;
288
+ stateKey: "wizard";
289
+ currentStep: string | null;
290
+ completedSteps: string[];
291
+ payload: Record<string, unknown>;
292
+ version: number;
293
+ createdAt: string;
294
+ updatedAt: string;
295
+ };
296
+ }>;
297
+ updateSession(db: PostgresJsDatabase, bookingId: string, input: PublicUpdateBookingSessionInput, userId?: string, resolvers?: PublicBookingsServiceResolvers): Promise<{
298
+ status: Exclude<string, "ok">;
299
+ } | {
300
+ status: "ok";
301
+ session: {
302
+ sessionId: string;
303
+ bookingNumber: string;
304
+ status: "expired" | "cancelled" | "completed" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress";
305
+ externalBookingRef: string | null;
306
+ communicationLanguage: string | null;
307
+ sellCurrency: string;
308
+ sellAmountCents: number | null;
309
+ startDate: string | null;
310
+ endDate: string | null;
311
+ pax: number | null;
312
+ holdExpiresAt: string | null;
313
+ confirmedAt: string | null;
314
+ expiredAt: string | null;
315
+ cancelledAt: string | null;
316
+ completedAt: string | null;
317
+ travelers: {
318
+ id: string;
319
+ participantType: "other" | "traveler" | "occupant";
320
+ travelerCategory: "child" | "other" | "adult" | "infant" | "senior" | null;
321
+ firstName: string;
322
+ lastName: string;
323
+ email: string | null;
324
+ phone: string | null;
325
+ preferredLanguage: string | null;
326
+ specialRequests: string | null;
327
+ isPrimary: boolean;
328
+ notes: string | null;
329
+ }[];
330
+ items: {
331
+ id: string;
332
+ title: string;
333
+ description: string | null;
334
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
335
+ status: "expired" | "cancelled" | "draft" | "on_hold" | "confirmed" | "fulfilled";
336
+ serviceDate: string | null;
337
+ startsAt: string | null;
338
+ endsAt: string | null;
339
+ quantity: number;
340
+ sellCurrency: string;
341
+ unitSellAmountCents: number | null;
342
+ totalSellAmountCents: number | null;
343
+ costCurrency: string | null;
344
+ unitCostAmountCents: number | null;
345
+ totalCostAmountCents: number | null;
346
+ notes: string | null;
347
+ productId: string | null;
348
+ optionId: string | null;
349
+ optionUnitId: string | null;
350
+ pricingCategoryId: string | null;
351
+ travelerLinks: {
352
+ id: string;
353
+ travelerId: string;
354
+ role: string;
355
+ isPrimary: boolean;
356
+ }[];
357
+ }[];
358
+ allocations: {
359
+ id: string;
360
+ bookingItemId: string;
361
+ productId: string | null;
362
+ optionId: string | null;
363
+ optionUnitId: string | null;
364
+ pricingCategoryId: string | null;
365
+ availabilitySlotId: string | null;
366
+ quantity: number;
367
+ allocationType: "resource" | "unit" | "pickup";
368
+ status: "expired" | "cancelled" | "confirmed" | "fulfilled" | "held" | "released";
369
+ holdExpiresAt: string | null;
370
+ confirmedAt: string | null;
371
+ releasedAt: string | null;
372
+ }[];
373
+ checklist: {
374
+ hasTravelers: boolean;
375
+ hasPrimaryTraveler: boolean;
376
+ hasItems: boolean;
377
+ hasAllocations: boolean;
378
+ readyForConfirmation: boolean;
379
+ };
380
+ state: {
381
+ sessionId: string;
382
+ stateKey: "wizard";
383
+ currentStep: string | null;
384
+ completedSteps: string[];
385
+ payload: Record<string, unknown>;
386
+ version: number;
387
+ createdAt: string;
388
+ updatedAt: string;
389
+ } | null;
390
+ };
391
+ }>;
392
+ repriceSession(db: PostgresJsDatabase, bookingId: string, input: PublicBookingSessionRepriceInput): Promise<{
393
+ status: "not_found";
394
+ pricing?: undefined;
395
+ session?: undefined;
396
+ } | {
397
+ status: "invalid_selection";
398
+ pricing?: undefined;
399
+ session?: undefined;
400
+ } | {
401
+ status: "pricing_unavailable";
402
+ pricing?: undefined;
403
+ session?: undefined;
404
+ } | {
405
+ status: "quantity_change_requires_reallocation";
406
+ pricing?: undefined;
407
+ session?: undefined;
408
+ } | {
409
+ status: "ok";
410
+ pricing: {
411
+ sessionId: string;
412
+ catalogId: string | null;
413
+ currencyCode: string;
414
+ totalSellAmountCents: number;
415
+ items: {
416
+ itemId: string;
417
+ title: string;
418
+ productId: string | null;
419
+ optionId: string | null;
420
+ optionUnitId: string | null;
421
+ optionUnitName: string | null;
422
+ optionUnitType: string | null;
423
+ pricingCategoryId: string | null;
424
+ quantity: number;
425
+ pricingMode: string;
426
+ unitSellAmountCents: number | null;
427
+ totalSellAmountCents: number | null;
428
+ warnings: string[];
429
+ }[];
430
+ warnings: string[];
431
+ appliedToSession: boolean;
432
+ };
433
+ session: {
434
+ sessionId: string;
435
+ bookingNumber: string;
436
+ status: "expired" | "cancelled" | "completed" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress";
437
+ externalBookingRef: string | null;
438
+ communicationLanguage: string | null;
439
+ sellCurrency: string;
440
+ sellAmountCents: number | null;
441
+ startDate: string | null;
442
+ endDate: string | null;
443
+ pax: number | null;
444
+ holdExpiresAt: string | null;
445
+ confirmedAt: string | null;
446
+ expiredAt: string | null;
447
+ cancelledAt: string | null;
448
+ completedAt: string | null;
449
+ travelers: {
450
+ id: string;
451
+ participantType: "other" | "traveler" | "occupant";
452
+ travelerCategory: "child" | "other" | "adult" | "infant" | "senior" | null;
453
+ firstName: string;
454
+ lastName: string;
455
+ email: string | null;
456
+ phone: string | null;
457
+ preferredLanguage: string | null;
458
+ specialRequests: string | null;
459
+ isPrimary: boolean;
460
+ notes: string | null;
461
+ }[];
462
+ items: {
463
+ id: string;
464
+ title: string;
465
+ description: string | null;
466
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
467
+ status: "expired" | "cancelled" | "draft" | "on_hold" | "confirmed" | "fulfilled";
468
+ serviceDate: string | null;
469
+ startsAt: string | null;
470
+ endsAt: string | null;
471
+ quantity: number;
472
+ sellCurrency: string;
473
+ unitSellAmountCents: number | null;
474
+ totalSellAmountCents: number | null;
475
+ costCurrency: string | null;
476
+ unitCostAmountCents: number | null;
477
+ totalCostAmountCents: number | null;
478
+ notes: string | null;
479
+ productId: string | null;
480
+ optionId: string | null;
481
+ optionUnitId: string | null;
482
+ pricingCategoryId: string | null;
483
+ travelerLinks: {
484
+ id: string;
485
+ travelerId: string;
486
+ role: string;
487
+ isPrimary: boolean;
488
+ }[];
489
+ }[];
490
+ allocations: {
491
+ id: string;
492
+ bookingItemId: string;
493
+ productId: string | null;
494
+ optionId: string | null;
495
+ optionUnitId: string | null;
496
+ pricingCategoryId: string | null;
497
+ availabilitySlotId: string | null;
498
+ quantity: number;
499
+ allocationType: "resource" | "unit" | "pickup";
500
+ status: "expired" | "cancelled" | "confirmed" | "fulfilled" | "held" | "released";
501
+ holdExpiresAt: string | null;
502
+ confirmedAt: string | null;
503
+ releasedAt: string | null;
504
+ }[];
505
+ checklist: {
506
+ hasTravelers: boolean;
507
+ hasPrimaryTraveler: boolean;
508
+ hasItems: boolean;
509
+ hasAllocations: boolean;
510
+ readyForConfirmation: boolean;
511
+ };
512
+ state: {
513
+ sessionId: string;
514
+ stateKey: "wizard";
515
+ currentStep: string | null;
516
+ completedSteps: string[];
517
+ payload: Record<string, unknown>;
518
+ version: number;
519
+ createdAt: string;
520
+ updatedAt: string;
521
+ } | null;
522
+ } | null;
523
+ }>;
524
+ confirmSession(db: PostgresJsDatabase, bookingId: string, input: PublicBookingSessionMutationInput, userId?: string): Promise<{
525
+ status: Exclude<string, "ok">;
526
+ } | {
527
+ status: "ok";
528
+ session: {
529
+ sessionId: string;
530
+ bookingNumber: string;
531
+ status: "expired" | "cancelled" | "completed" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress";
532
+ externalBookingRef: string | null;
533
+ communicationLanguage: string | null;
534
+ sellCurrency: string;
535
+ sellAmountCents: number | null;
536
+ startDate: string | null;
537
+ endDate: string | null;
538
+ pax: number | null;
539
+ holdExpiresAt: string | null;
540
+ confirmedAt: string | null;
541
+ expiredAt: string | null;
542
+ cancelledAt: string | null;
543
+ completedAt: string | null;
544
+ travelers: {
545
+ id: string;
546
+ participantType: "other" | "traveler" | "occupant";
547
+ travelerCategory: "child" | "other" | "adult" | "infant" | "senior" | null;
548
+ firstName: string;
549
+ lastName: string;
550
+ email: string | null;
551
+ phone: string | null;
552
+ preferredLanguage: string | null;
553
+ specialRequests: string | null;
554
+ isPrimary: boolean;
555
+ notes: string | null;
556
+ }[];
557
+ items: {
558
+ id: string;
559
+ title: string;
560
+ description: string | null;
561
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
562
+ status: "expired" | "cancelled" | "draft" | "on_hold" | "confirmed" | "fulfilled";
563
+ serviceDate: string | null;
564
+ startsAt: string | null;
565
+ endsAt: string | null;
566
+ quantity: number;
567
+ sellCurrency: string;
568
+ unitSellAmountCents: number | null;
569
+ totalSellAmountCents: number | null;
570
+ costCurrency: string | null;
571
+ unitCostAmountCents: number | null;
572
+ totalCostAmountCents: number | null;
573
+ notes: string | null;
574
+ productId: string | null;
575
+ optionId: string | null;
576
+ optionUnitId: string | null;
577
+ pricingCategoryId: string | null;
578
+ travelerLinks: {
579
+ id: string;
580
+ travelerId: string;
581
+ role: string;
582
+ isPrimary: boolean;
583
+ }[];
584
+ }[];
585
+ allocations: {
586
+ id: string;
587
+ bookingItemId: string;
588
+ productId: string | null;
589
+ optionId: string | null;
590
+ optionUnitId: string | null;
591
+ pricingCategoryId: string | null;
592
+ availabilitySlotId: string | null;
593
+ quantity: number;
594
+ allocationType: "resource" | "unit" | "pickup";
595
+ status: "expired" | "cancelled" | "confirmed" | "fulfilled" | "held" | "released";
596
+ holdExpiresAt: string | null;
597
+ confirmedAt: string | null;
598
+ releasedAt: string | null;
599
+ }[];
600
+ checklist: {
601
+ hasTravelers: boolean;
602
+ hasPrimaryTraveler: boolean;
603
+ hasItems: boolean;
604
+ hasAllocations: boolean;
605
+ readyForConfirmation: boolean;
606
+ };
607
+ state: {
608
+ sessionId: string;
609
+ stateKey: "wizard";
610
+ currentStep: string | null;
611
+ completedSteps: string[];
612
+ payload: Record<string, unknown>;
613
+ version: number;
614
+ createdAt: string;
615
+ updatedAt: string;
616
+ } | null;
617
+ };
618
+ }>;
619
+ expireSession(db: PostgresJsDatabase, bookingId: string, input: PublicBookingSessionMutationInput, userId?: string, runtime?: BookingServiceRuntime): Promise<{
620
+ status: Exclude<string, "ok">;
621
+ } | {
622
+ status: "ok";
623
+ session: {
624
+ sessionId: string;
625
+ bookingNumber: string;
626
+ status: "expired" | "cancelled" | "completed" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress";
627
+ externalBookingRef: string | null;
628
+ communicationLanguage: string | null;
629
+ sellCurrency: string;
630
+ sellAmountCents: number | null;
631
+ startDate: string | null;
632
+ endDate: string | null;
633
+ pax: number | null;
634
+ holdExpiresAt: string | null;
635
+ confirmedAt: string | null;
636
+ expiredAt: string | null;
637
+ cancelledAt: string | null;
638
+ completedAt: string | null;
639
+ travelers: {
640
+ id: string;
641
+ participantType: "other" | "traveler" | "occupant";
642
+ travelerCategory: "child" | "other" | "adult" | "infant" | "senior" | null;
643
+ firstName: string;
644
+ lastName: string;
645
+ email: string | null;
646
+ phone: string | null;
647
+ preferredLanguage: string | null;
648
+ specialRequests: string | null;
649
+ isPrimary: boolean;
650
+ notes: string | null;
651
+ }[];
652
+ items: {
653
+ id: string;
654
+ title: string;
655
+ description: string | null;
656
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
657
+ status: "expired" | "cancelled" | "draft" | "on_hold" | "confirmed" | "fulfilled";
658
+ serviceDate: string | null;
659
+ startsAt: string | null;
660
+ endsAt: string | null;
661
+ quantity: number;
662
+ sellCurrency: string;
663
+ unitSellAmountCents: number | null;
664
+ totalSellAmountCents: number | null;
665
+ costCurrency: string | null;
666
+ unitCostAmountCents: number | null;
667
+ totalCostAmountCents: number | null;
668
+ notes: string | null;
669
+ productId: string | null;
670
+ optionId: string | null;
671
+ optionUnitId: string | null;
672
+ pricingCategoryId: string | null;
673
+ travelerLinks: {
674
+ id: string;
675
+ travelerId: string;
676
+ role: string;
677
+ isPrimary: boolean;
678
+ }[];
679
+ }[];
680
+ allocations: {
681
+ id: string;
682
+ bookingItemId: string;
683
+ productId: string | null;
684
+ optionId: string | null;
685
+ optionUnitId: string | null;
686
+ pricingCategoryId: string | null;
687
+ availabilitySlotId: string | null;
688
+ quantity: number;
689
+ allocationType: "resource" | "unit" | "pickup";
690
+ status: "expired" | "cancelled" | "confirmed" | "fulfilled" | "held" | "released";
691
+ holdExpiresAt: string | null;
692
+ confirmedAt: string | null;
693
+ releasedAt: string | null;
694
+ }[];
695
+ checklist: {
696
+ hasTravelers: boolean;
697
+ hasPrimaryTraveler: boolean;
698
+ hasItems: boolean;
699
+ hasAllocations: boolean;
700
+ readyForConfirmation: boolean;
701
+ };
702
+ state: {
703
+ sessionId: string;
704
+ stateKey: "wizard";
705
+ currentStep: string | null;
706
+ completedSteps: string[];
707
+ payload: Record<string, unknown>;
708
+ version: number;
709
+ createdAt: string;
710
+ updatedAt: string;
711
+ } | null;
712
+ };
713
+ }>;
714
+ getOverview(db: PostgresJsDatabase, query: PublicBookingOverviewLookupQuery): Promise<{
715
+ bookingId: string;
716
+ bookingNumber: string;
717
+ status: "expired" | "cancelled" | "completed" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress";
718
+ sellCurrency: string;
719
+ sellAmountCents: number | null;
720
+ startDate: string | null;
721
+ endDate: string | null;
722
+ pax: number | null;
723
+ confirmedAt: string | null;
724
+ cancelledAt: string | null;
725
+ completedAt: string | null;
726
+ travelers: {
727
+ id: string;
728
+ participantType: "other" | "traveler" | "occupant";
729
+ firstName: string;
730
+ lastName: string;
731
+ isPrimary: boolean;
732
+ }[];
733
+ items: {
734
+ id: string;
735
+ title: string;
736
+ description: string | null;
737
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
738
+ status: "expired" | "cancelled" | "draft" | "on_hold" | "confirmed" | "fulfilled";
739
+ serviceDate: string | null;
740
+ startsAt: string | null;
741
+ endsAt: string | null;
742
+ quantity: number;
743
+ sellCurrency: string;
744
+ unitSellAmountCents: number | null;
745
+ totalSellAmountCents: number | null;
746
+ costCurrency: string | null;
747
+ unitCostAmountCents: number | null;
748
+ totalCostAmountCents: number | null;
749
+ notes: string | null;
750
+ productId: string | null;
751
+ optionId: string | null;
752
+ optionUnitId: string | null;
753
+ pricingCategoryId: string | null;
754
+ travelerLinks: {
755
+ id: string;
756
+ travelerId: string;
757
+ role: string;
758
+ isPrimary: boolean;
759
+ }[];
760
+ }[];
761
+ documents: {
762
+ id: string;
763
+ travelerId: string | null;
764
+ type: "visa" | "other" | "insurance" | "health" | "passport_copy";
765
+ fileName: string;
766
+ fileUrl: string;
767
+ }[];
768
+ fulfillments: {
769
+ id: string;
770
+ bookingItemId: string | null;
771
+ travelerId: string | null;
772
+ fulfillmentType: "other" | "pdf" | "voucher" | "ticket" | "qr_code" | "barcode" | "mobile";
773
+ deliveryChannel: "api" | "email" | "other" | "download" | "wallet";
774
+ status: "failed" | "pending" | "revoked" | "issued" | "reissued";
775
+ artifactUrl: string | null;
776
+ }[];
777
+ } | null>;
778
+ getOverviewByGuestAccess(db: PostgresJsDatabase, query: PublicBookingOverviewAccessQuery): Promise<{
779
+ bookingId: string;
780
+ bookingNumber: string;
781
+ status: "expired" | "cancelled" | "completed" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress";
782
+ sellCurrency: string;
783
+ sellAmountCents: number | null;
784
+ startDate: string | null;
785
+ endDate: string | null;
786
+ pax: number | null;
787
+ confirmedAt: string | null;
788
+ cancelledAt: string | null;
789
+ completedAt: string | null;
790
+ travelers: {
791
+ id: string;
792
+ participantType: "other" | "traveler" | "occupant";
793
+ firstName: string;
794
+ lastName: string;
795
+ isPrimary: boolean;
796
+ }[];
797
+ items: {
798
+ id: string;
799
+ title: string;
800
+ description: string | null;
801
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
802
+ status: "expired" | "cancelled" | "draft" | "on_hold" | "confirmed" | "fulfilled";
803
+ serviceDate: string | null;
804
+ startsAt: string | null;
805
+ endsAt: string | null;
806
+ quantity: number;
807
+ sellCurrency: string;
808
+ unitSellAmountCents: number | null;
809
+ totalSellAmountCents: number | null;
810
+ costCurrency: string | null;
811
+ unitCostAmountCents: number | null;
812
+ totalCostAmountCents: number | null;
813
+ notes: string | null;
814
+ productId: string | null;
815
+ optionId: string | null;
816
+ optionUnitId: string | null;
817
+ pricingCategoryId: string | null;
818
+ travelerLinks: {
819
+ id: string;
820
+ travelerId: string;
821
+ role: string;
822
+ isPrimary: boolean;
823
+ }[];
824
+ }[];
825
+ documents: {
826
+ id: string;
827
+ travelerId: string | null;
828
+ type: "visa" | "other" | "insurance" | "health" | "passport_copy";
829
+ fileName: string;
830
+ fileUrl: string;
831
+ }[];
832
+ fulfillments: {
833
+ id: string;
834
+ bookingItemId: string | null;
835
+ travelerId: string | null;
836
+ fulfillmentType: "other" | "pdf" | "voucher" | "ticket" | "qr_code" | "barcode" | "mobile";
837
+ deliveryChannel: "api" | "email" | "other" | "download" | "wallet";
838
+ status: "failed" | "pending" | "revoked" | "issued" | "reissued";
839
+ artifactUrl: string | null;
840
+ }[];
841
+ } | null>;
842
+ getOverviewByLookup(db: PostgresJsDatabase, query: InternalBookingOverviewLookupQuery): Promise<{
843
+ bookingId: string;
844
+ bookingNumber: string;
845
+ status: "expired" | "cancelled" | "completed" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress";
846
+ sellCurrency: string;
847
+ sellAmountCents: number | null;
848
+ startDate: string | null;
849
+ endDate: string | null;
850
+ pax: number | null;
851
+ confirmedAt: string | null;
852
+ cancelledAt: string | null;
853
+ completedAt: string | null;
854
+ travelers: {
855
+ id: string;
856
+ participantType: "other" | "traveler" | "occupant";
857
+ firstName: string;
858
+ lastName: string;
859
+ isPrimary: boolean;
860
+ }[];
861
+ items: {
862
+ id: string;
863
+ title: string;
864
+ description: string | null;
865
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
866
+ status: "expired" | "cancelled" | "draft" | "on_hold" | "confirmed" | "fulfilled";
867
+ serviceDate: string | null;
868
+ startsAt: string | null;
869
+ endsAt: string | null;
870
+ quantity: number;
871
+ sellCurrency: string;
872
+ unitSellAmountCents: number | null;
873
+ totalSellAmountCents: number | null;
874
+ costCurrency: string | null;
875
+ unitCostAmountCents: number | null;
876
+ totalCostAmountCents: number | null;
877
+ notes: string | null;
878
+ productId: string | null;
879
+ optionId: string | null;
880
+ optionUnitId: string | null;
881
+ pricingCategoryId: string | null;
882
+ travelerLinks: {
883
+ id: string;
884
+ travelerId: string;
885
+ role: string;
886
+ isPrimary: boolean;
887
+ }[];
888
+ }[];
889
+ documents: {
890
+ id: string;
891
+ travelerId: string | null;
892
+ type: "visa" | "other" | "insurance" | "health" | "passport_copy";
893
+ fileName: string;
894
+ fileUrl: string;
895
+ }[];
896
+ fulfillments: {
897
+ id: string;
898
+ bookingItemId: string | null;
899
+ travelerId: string | null;
900
+ fulfillmentType: "other" | "pdf" | "voucher" | "ticket" | "qr_code" | "barcode" | "mobile";
901
+ deliveryChannel: "api" | "email" | "other" | "download" | "wallet";
902
+ status: "failed" | "pending" | "revoked" | "issued" | "reissued";
903
+ artifactUrl: string | null;
904
+ }[];
905
+ } | null>;
906
+ };
907
+ //# sourceMappingURL=service-public-core.d.ts.map