@voyantjs/bookings 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.
@@ -0,0 +1,773 @@
1
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
+ import type { InternalBookingOverviewLookupQuery, PublicBookingOverviewLookupQuery, PublicBookingSessionMutationInput, PublicBookingSessionRepriceInput, PublicCreateBookingSessionInput, PublicUpdateBookingSessionInput, PublicUpsertBookingSessionStateInput } from "./validation-public.js";
3
+ export declare const publicBookingsService: {
4
+ createSession(db: PostgresJsDatabase, input: PublicCreateBookingSessionInput, userId?: string): Promise<{
5
+ status: Exclude<string, "ok">;
6
+ } | {
7
+ status: "ok";
8
+ session: {
9
+ sessionId: string;
10
+ bookingNumber: string;
11
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
12
+ externalBookingRef: string | null;
13
+ communicationLanguage: string | null;
14
+ sellCurrency: string;
15
+ sellAmountCents: number | null;
16
+ startDate: string | null;
17
+ endDate: string | null;
18
+ pax: number | null;
19
+ holdExpiresAt: string | null;
20
+ confirmedAt: string | null;
21
+ expiredAt: string | null;
22
+ cancelledAt: string | null;
23
+ completedAt: string | null;
24
+ participants: {
25
+ id: string;
26
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
27
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
28
+ firstName: string;
29
+ lastName: string;
30
+ email: string | null;
31
+ phone: string | null;
32
+ preferredLanguage: string | null;
33
+ accessibilityNeeds: string | null;
34
+ specialRequests: string | null;
35
+ isPrimary: boolean;
36
+ notes: string | null;
37
+ }[];
38
+ items: {
39
+ id: string;
40
+ title: string;
41
+ description: string | null;
42
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
43
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
44
+ serviceDate: string | null;
45
+ startsAt: string | null;
46
+ endsAt: string | null;
47
+ quantity: number;
48
+ sellCurrency: string;
49
+ unitSellAmountCents: number | null;
50
+ totalSellAmountCents: number | null;
51
+ costCurrency: string | null;
52
+ unitCostAmountCents: number | null;
53
+ totalCostAmountCents: number | null;
54
+ notes: string | null;
55
+ productId: string | null;
56
+ optionId: string | null;
57
+ optionUnitId: string | null;
58
+ pricingCategoryId: string | null;
59
+ participantLinks: {
60
+ id: string;
61
+ participantId: string;
62
+ role: string;
63
+ isPrimary: boolean;
64
+ }[];
65
+ }[];
66
+ allocations: {
67
+ id: string;
68
+ bookingItemId: string;
69
+ productId: string | null;
70
+ optionId: string | null;
71
+ optionUnitId: string | null;
72
+ pricingCategoryId: string | null;
73
+ availabilitySlotId: string | null;
74
+ quantity: number;
75
+ allocationType: "unit" | "pickup" | "resource";
76
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
77
+ holdExpiresAt: string | null;
78
+ confirmedAt: string | null;
79
+ releasedAt: string | null;
80
+ }[];
81
+ checklist: {
82
+ hasParticipants: boolean;
83
+ hasTraveler: boolean;
84
+ hasPrimaryParticipant: boolean;
85
+ hasItems: boolean;
86
+ hasAllocations: boolean;
87
+ readyForConfirmation: boolean;
88
+ };
89
+ state: {
90
+ sessionId: string;
91
+ stateKey: "wizard";
92
+ currentStep: string | null;
93
+ completedSteps: string[];
94
+ payload: Record<string, unknown>;
95
+ version: number;
96
+ createdAt: string;
97
+ updatedAt: string;
98
+ } | null;
99
+ };
100
+ }>;
101
+ getSessionById(db: PostgresJsDatabase, bookingId: string): Promise<{
102
+ sessionId: string;
103
+ bookingNumber: string;
104
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
105
+ externalBookingRef: string | null;
106
+ communicationLanguage: string | null;
107
+ sellCurrency: string;
108
+ sellAmountCents: number | null;
109
+ startDate: string | null;
110
+ endDate: string | null;
111
+ pax: number | null;
112
+ holdExpiresAt: string | null;
113
+ confirmedAt: string | null;
114
+ expiredAt: string | null;
115
+ cancelledAt: string | null;
116
+ completedAt: string | null;
117
+ participants: {
118
+ id: string;
119
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
120
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
121
+ firstName: string;
122
+ lastName: string;
123
+ email: string | null;
124
+ phone: string | null;
125
+ preferredLanguage: string | null;
126
+ accessibilityNeeds: string | null;
127
+ specialRequests: string | null;
128
+ isPrimary: boolean;
129
+ notes: string | null;
130
+ }[];
131
+ items: {
132
+ id: string;
133
+ title: string;
134
+ description: string | null;
135
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
136
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
137
+ serviceDate: string | null;
138
+ startsAt: string | null;
139
+ endsAt: string | null;
140
+ quantity: number;
141
+ sellCurrency: string;
142
+ unitSellAmountCents: number | null;
143
+ totalSellAmountCents: number | null;
144
+ costCurrency: string | null;
145
+ unitCostAmountCents: number | null;
146
+ totalCostAmountCents: number | null;
147
+ notes: string | null;
148
+ productId: string | null;
149
+ optionId: string | null;
150
+ optionUnitId: string | null;
151
+ pricingCategoryId: string | null;
152
+ participantLinks: {
153
+ id: string;
154
+ participantId: string;
155
+ role: string;
156
+ isPrimary: boolean;
157
+ }[];
158
+ }[];
159
+ allocations: {
160
+ id: string;
161
+ bookingItemId: string;
162
+ productId: string | null;
163
+ optionId: string | null;
164
+ optionUnitId: string | null;
165
+ pricingCategoryId: string | null;
166
+ availabilitySlotId: string | null;
167
+ quantity: number;
168
+ allocationType: "unit" | "pickup" | "resource";
169
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
170
+ holdExpiresAt: string | null;
171
+ confirmedAt: string | null;
172
+ releasedAt: string | null;
173
+ }[];
174
+ checklist: {
175
+ hasParticipants: boolean;
176
+ hasTraveler: boolean;
177
+ hasPrimaryParticipant: boolean;
178
+ hasItems: boolean;
179
+ hasAllocations: boolean;
180
+ readyForConfirmation: boolean;
181
+ };
182
+ state: {
183
+ sessionId: string;
184
+ stateKey: "wizard";
185
+ currentStep: string | null;
186
+ completedSteps: string[];
187
+ payload: Record<string, unknown>;
188
+ version: number;
189
+ createdAt: string;
190
+ updatedAt: string;
191
+ } | null;
192
+ } | null>;
193
+ getSessionState(db: PostgresJsDatabase, bookingId: string): Promise<{
194
+ sessionId: string;
195
+ stateKey: "wizard";
196
+ currentStep: string | null;
197
+ completedSteps: string[];
198
+ payload: Record<string, unknown>;
199
+ version: number;
200
+ createdAt: string;
201
+ updatedAt: string;
202
+ } | null>;
203
+ updateSessionState(db: PostgresJsDatabase, bookingId: string, input: PublicUpsertBookingSessionStateInput): Promise<{
204
+ status: "not_found";
205
+ state?: undefined;
206
+ } | {
207
+ status: "ok";
208
+ state: {
209
+ sessionId: string;
210
+ stateKey: "wizard";
211
+ currentStep: string | null;
212
+ completedSteps: string[];
213
+ payload: Record<string, unknown>;
214
+ version: number;
215
+ createdAt: string;
216
+ updatedAt: string;
217
+ } | null;
218
+ }>;
219
+ updateSession(db: PostgresJsDatabase, bookingId: string, input: PublicUpdateBookingSessionInput, userId?: string): Promise<{
220
+ status: Exclude<string, "ok">;
221
+ } | {
222
+ status: "ok";
223
+ session: {
224
+ sessionId: string;
225
+ bookingNumber: string;
226
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
227
+ externalBookingRef: string | null;
228
+ communicationLanguage: string | null;
229
+ sellCurrency: string;
230
+ sellAmountCents: number | null;
231
+ startDate: string | null;
232
+ endDate: string | null;
233
+ pax: number | null;
234
+ holdExpiresAt: string | null;
235
+ confirmedAt: string | null;
236
+ expiredAt: string | null;
237
+ cancelledAt: string | null;
238
+ completedAt: string | null;
239
+ participants: {
240
+ id: string;
241
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
242
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
243
+ firstName: string;
244
+ lastName: string;
245
+ email: string | null;
246
+ phone: string | null;
247
+ preferredLanguage: string | null;
248
+ accessibilityNeeds: string | null;
249
+ specialRequests: string | null;
250
+ isPrimary: boolean;
251
+ notes: string | null;
252
+ }[];
253
+ items: {
254
+ id: string;
255
+ title: string;
256
+ description: string | null;
257
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
258
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
259
+ serviceDate: string | null;
260
+ startsAt: string | null;
261
+ endsAt: string | null;
262
+ quantity: number;
263
+ sellCurrency: string;
264
+ unitSellAmountCents: number | null;
265
+ totalSellAmountCents: number | null;
266
+ costCurrency: string | null;
267
+ unitCostAmountCents: number | null;
268
+ totalCostAmountCents: number | null;
269
+ notes: string | null;
270
+ productId: string | null;
271
+ optionId: string | null;
272
+ optionUnitId: string | null;
273
+ pricingCategoryId: string | null;
274
+ participantLinks: {
275
+ id: string;
276
+ participantId: string;
277
+ role: string;
278
+ isPrimary: boolean;
279
+ }[];
280
+ }[];
281
+ allocations: {
282
+ id: string;
283
+ bookingItemId: string;
284
+ productId: string | null;
285
+ optionId: string | null;
286
+ optionUnitId: string | null;
287
+ pricingCategoryId: string | null;
288
+ availabilitySlotId: string | null;
289
+ quantity: number;
290
+ allocationType: "unit" | "pickup" | "resource";
291
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
292
+ holdExpiresAt: string | null;
293
+ confirmedAt: string | null;
294
+ releasedAt: string | null;
295
+ }[];
296
+ checklist: {
297
+ hasParticipants: boolean;
298
+ hasTraveler: boolean;
299
+ hasPrimaryParticipant: boolean;
300
+ hasItems: boolean;
301
+ hasAllocations: boolean;
302
+ readyForConfirmation: boolean;
303
+ };
304
+ state: {
305
+ sessionId: string;
306
+ stateKey: "wizard";
307
+ currentStep: string | null;
308
+ completedSteps: string[];
309
+ payload: Record<string, unknown>;
310
+ version: number;
311
+ createdAt: string;
312
+ updatedAt: string;
313
+ } | null;
314
+ };
315
+ }>;
316
+ repriceSession(db: PostgresJsDatabase, bookingId: string, input: PublicBookingSessionRepriceInput): Promise<{
317
+ status: "not_found";
318
+ pricing?: undefined;
319
+ session?: undefined;
320
+ } | {
321
+ status: "invalid_selection";
322
+ pricing?: undefined;
323
+ session?: undefined;
324
+ } | {
325
+ status: "pricing_unavailable";
326
+ pricing?: undefined;
327
+ session?: undefined;
328
+ } | {
329
+ status: "quantity_change_requires_reallocation";
330
+ pricing?: undefined;
331
+ session?: undefined;
332
+ } | {
333
+ status: "ok";
334
+ pricing: {
335
+ sessionId: string;
336
+ catalogId: string | null;
337
+ currencyCode: string;
338
+ totalSellAmountCents: number;
339
+ items: {
340
+ itemId: string;
341
+ title: string;
342
+ productId: string | null;
343
+ optionId: string | null;
344
+ optionUnitId: string | null;
345
+ optionUnitName: string | null;
346
+ optionUnitType: string | null;
347
+ pricingCategoryId: string | null;
348
+ quantity: number;
349
+ pricingMode: string;
350
+ unitSellAmountCents: number | null;
351
+ totalSellAmountCents: number | null;
352
+ warnings: string[];
353
+ }[];
354
+ warnings: string[];
355
+ appliedToSession: boolean;
356
+ };
357
+ session: {
358
+ sessionId: string;
359
+ bookingNumber: string;
360
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
361
+ externalBookingRef: string | null;
362
+ communicationLanguage: string | null;
363
+ sellCurrency: string;
364
+ sellAmountCents: number | null;
365
+ startDate: string | null;
366
+ endDate: string | null;
367
+ pax: number | null;
368
+ holdExpiresAt: string | null;
369
+ confirmedAt: string | null;
370
+ expiredAt: string | null;
371
+ cancelledAt: string | null;
372
+ completedAt: string | null;
373
+ participants: {
374
+ id: string;
375
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
376
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
377
+ firstName: string;
378
+ lastName: string;
379
+ email: string | null;
380
+ phone: string | null;
381
+ preferredLanguage: string | null;
382
+ accessibilityNeeds: string | null;
383
+ specialRequests: string | null;
384
+ isPrimary: boolean;
385
+ notes: string | null;
386
+ }[];
387
+ items: {
388
+ id: string;
389
+ title: string;
390
+ description: string | null;
391
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
392
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
393
+ serviceDate: string | null;
394
+ startsAt: string | null;
395
+ endsAt: string | null;
396
+ quantity: number;
397
+ sellCurrency: string;
398
+ unitSellAmountCents: number | null;
399
+ totalSellAmountCents: number | null;
400
+ costCurrency: string | null;
401
+ unitCostAmountCents: number | null;
402
+ totalCostAmountCents: number | null;
403
+ notes: string | null;
404
+ productId: string | null;
405
+ optionId: string | null;
406
+ optionUnitId: string | null;
407
+ pricingCategoryId: string | null;
408
+ participantLinks: {
409
+ id: string;
410
+ participantId: string;
411
+ role: string;
412
+ isPrimary: boolean;
413
+ }[];
414
+ }[];
415
+ allocations: {
416
+ id: string;
417
+ bookingItemId: string;
418
+ productId: string | null;
419
+ optionId: string | null;
420
+ optionUnitId: string | null;
421
+ pricingCategoryId: string | null;
422
+ availabilitySlotId: string | null;
423
+ quantity: number;
424
+ allocationType: "unit" | "pickup" | "resource";
425
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
426
+ holdExpiresAt: string | null;
427
+ confirmedAt: string | null;
428
+ releasedAt: string | null;
429
+ }[];
430
+ checklist: {
431
+ hasParticipants: boolean;
432
+ hasTraveler: boolean;
433
+ hasPrimaryParticipant: boolean;
434
+ hasItems: boolean;
435
+ hasAllocations: boolean;
436
+ readyForConfirmation: boolean;
437
+ };
438
+ state: {
439
+ sessionId: string;
440
+ stateKey: "wizard";
441
+ currentStep: string | null;
442
+ completedSteps: string[];
443
+ payload: Record<string, unknown>;
444
+ version: number;
445
+ createdAt: string;
446
+ updatedAt: string;
447
+ } | null;
448
+ } | null;
449
+ }>;
450
+ confirmSession(db: PostgresJsDatabase, bookingId: string, input: PublicBookingSessionMutationInput, userId?: string): Promise<{
451
+ status: Exclude<string, "ok">;
452
+ } | {
453
+ status: "ok";
454
+ session: {
455
+ sessionId: string;
456
+ bookingNumber: string;
457
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
458
+ externalBookingRef: string | null;
459
+ communicationLanguage: string | null;
460
+ sellCurrency: string;
461
+ sellAmountCents: number | null;
462
+ startDate: string | null;
463
+ endDate: string | null;
464
+ pax: number | null;
465
+ holdExpiresAt: string | null;
466
+ confirmedAt: string | null;
467
+ expiredAt: string | null;
468
+ cancelledAt: string | null;
469
+ completedAt: string | null;
470
+ participants: {
471
+ id: string;
472
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
473
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
474
+ firstName: string;
475
+ lastName: string;
476
+ email: string | null;
477
+ phone: string | null;
478
+ preferredLanguage: string | null;
479
+ accessibilityNeeds: string | null;
480
+ specialRequests: string | null;
481
+ isPrimary: boolean;
482
+ notes: string | null;
483
+ }[];
484
+ items: {
485
+ id: string;
486
+ title: string;
487
+ description: string | null;
488
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
489
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
490
+ serviceDate: string | null;
491
+ startsAt: string | null;
492
+ endsAt: string | null;
493
+ quantity: number;
494
+ sellCurrency: string;
495
+ unitSellAmountCents: number | null;
496
+ totalSellAmountCents: number | null;
497
+ costCurrency: string | null;
498
+ unitCostAmountCents: number | null;
499
+ totalCostAmountCents: number | null;
500
+ notes: string | null;
501
+ productId: string | null;
502
+ optionId: string | null;
503
+ optionUnitId: string | null;
504
+ pricingCategoryId: string | null;
505
+ participantLinks: {
506
+ id: string;
507
+ participantId: string;
508
+ role: string;
509
+ isPrimary: boolean;
510
+ }[];
511
+ }[];
512
+ allocations: {
513
+ id: string;
514
+ bookingItemId: string;
515
+ productId: string | null;
516
+ optionId: string | null;
517
+ optionUnitId: string | null;
518
+ pricingCategoryId: string | null;
519
+ availabilitySlotId: string | null;
520
+ quantity: number;
521
+ allocationType: "unit" | "pickup" | "resource";
522
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
523
+ holdExpiresAt: string | null;
524
+ confirmedAt: string | null;
525
+ releasedAt: string | null;
526
+ }[];
527
+ checklist: {
528
+ hasParticipants: boolean;
529
+ hasTraveler: boolean;
530
+ hasPrimaryParticipant: boolean;
531
+ hasItems: boolean;
532
+ hasAllocations: boolean;
533
+ readyForConfirmation: boolean;
534
+ };
535
+ state: {
536
+ sessionId: string;
537
+ stateKey: "wizard";
538
+ currentStep: string | null;
539
+ completedSteps: string[];
540
+ payload: Record<string, unknown>;
541
+ version: number;
542
+ createdAt: string;
543
+ updatedAt: string;
544
+ } | null;
545
+ };
546
+ }>;
547
+ expireSession(db: PostgresJsDatabase, bookingId: string, input: PublicBookingSessionMutationInput, userId?: string): Promise<{
548
+ status: Exclude<string, "ok">;
549
+ } | {
550
+ status: "ok";
551
+ session: {
552
+ sessionId: string;
553
+ bookingNumber: string;
554
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
555
+ externalBookingRef: string | null;
556
+ communicationLanguage: string | null;
557
+ sellCurrency: string;
558
+ sellAmountCents: number | null;
559
+ startDate: string | null;
560
+ endDate: string | null;
561
+ pax: number | null;
562
+ holdExpiresAt: string | null;
563
+ confirmedAt: string | null;
564
+ expiredAt: string | null;
565
+ cancelledAt: string | null;
566
+ completedAt: string | null;
567
+ participants: {
568
+ id: string;
569
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
570
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
571
+ firstName: string;
572
+ lastName: string;
573
+ email: string | null;
574
+ phone: string | null;
575
+ preferredLanguage: string | null;
576
+ accessibilityNeeds: string | null;
577
+ specialRequests: string | null;
578
+ isPrimary: boolean;
579
+ notes: string | null;
580
+ }[];
581
+ items: {
582
+ id: string;
583
+ title: string;
584
+ description: string | null;
585
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
586
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
587
+ serviceDate: string | null;
588
+ startsAt: string | null;
589
+ endsAt: string | null;
590
+ quantity: number;
591
+ sellCurrency: string;
592
+ unitSellAmountCents: number | null;
593
+ totalSellAmountCents: number | null;
594
+ costCurrency: string | null;
595
+ unitCostAmountCents: number | null;
596
+ totalCostAmountCents: number | null;
597
+ notes: string | null;
598
+ productId: string | null;
599
+ optionId: string | null;
600
+ optionUnitId: string | null;
601
+ pricingCategoryId: string | null;
602
+ participantLinks: {
603
+ id: string;
604
+ participantId: string;
605
+ role: string;
606
+ isPrimary: boolean;
607
+ }[];
608
+ }[];
609
+ allocations: {
610
+ id: string;
611
+ bookingItemId: string;
612
+ productId: string | null;
613
+ optionId: string | null;
614
+ optionUnitId: string | null;
615
+ pricingCategoryId: string | null;
616
+ availabilitySlotId: string | null;
617
+ quantity: number;
618
+ allocationType: "unit" | "pickup" | "resource";
619
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
620
+ holdExpiresAt: string | null;
621
+ confirmedAt: string | null;
622
+ releasedAt: string | null;
623
+ }[];
624
+ checklist: {
625
+ hasParticipants: boolean;
626
+ hasTraveler: boolean;
627
+ hasPrimaryParticipant: boolean;
628
+ hasItems: boolean;
629
+ hasAllocations: boolean;
630
+ readyForConfirmation: boolean;
631
+ };
632
+ state: {
633
+ sessionId: string;
634
+ stateKey: "wizard";
635
+ currentStep: string | null;
636
+ completedSteps: string[];
637
+ payload: Record<string, unknown>;
638
+ version: number;
639
+ createdAt: string;
640
+ updatedAt: string;
641
+ } | null;
642
+ };
643
+ }>;
644
+ getOverview(db: PostgresJsDatabase, query: PublicBookingOverviewLookupQuery): Promise<{
645
+ bookingId: string;
646
+ bookingNumber: string;
647
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
648
+ sellCurrency: string;
649
+ sellAmountCents: number | null;
650
+ startDate: string | null;
651
+ endDate: string | null;
652
+ pax: number | null;
653
+ confirmedAt: string | null;
654
+ cancelledAt: string | null;
655
+ completedAt: string | null;
656
+ participants: {
657
+ id: string;
658
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
659
+ firstName: string;
660
+ lastName: string;
661
+ isPrimary: boolean;
662
+ }[];
663
+ items: {
664
+ id: string;
665
+ title: string;
666
+ description: string | null;
667
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
668
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
669
+ serviceDate: string | null;
670
+ startsAt: string | null;
671
+ endsAt: string | null;
672
+ quantity: number;
673
+ sellCurrency: string;
674
+ unitSellAmountCents: number | null;
675
+ totalSellAmountCents: number | null;
676
+ costCurrency: string | null;
677
+ unitCostAmountCents: number | null;
678
+ totalCostAmountCents: number | null;
679
+ notes: string | null;
680
+ productId: string | null;
681
+ optionId: string | null;
682
+ optionUnitId: string | null;
683
+ pricingCategoryId: string | null;
684
+ participantLinks: {
685
+ id: string;
686
+ participantId: string;
687
+ role: string;
688
+ isPrimary: boolean;
689
+ }[];
690
+ }[];
691
+ documents: {
692
+ id: string;
693
+ participantId: string | null;
694
+ type: "visa" | "other" | "insurance" | "health" | "passport_copy";
695
+ fileName: string;
696
+ fileUrl: string;
697
+ }[];
698
+ fulfillments: {
699
+ id: string;
700
+ bookingItemId: string | null;
701
+ participantId: string | null;
702
+ fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
703
+ deliveryChannel: "other" | "download" | "email" | "api" | "wallet";
704
+ status: "pending" | "issued" | "reissued" | "revoked" | "failed";
705
+ artifactUrl: string | null;
706
+ }[];
707
+ } | null>;
708
+ getOverviewByLookup(db: PostgresJsDatabase, query: InternalBookingOverviewLookupQuery): Promise<{
709
+ bookingId: string;
710
+ bookingNumber: string;
711
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
712
+ sellCurrency: string;
713
+ sellAmountCents: number | null;
714
+ startDate: string | null;
715
+ endDate: string | null;
716
+ pax: number | null;
717
+ confirmedAt: string | null;
718
+ cancelledAt: string | null;
719
+ completedAt: string | null;
720
+ participants: {
721
+ id: string;
722
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
723
+ firstName: string;
724
+ lastName: string;
725
+ isPrimary: boolean;
726
+ }[];
727
+ items: {
728
+ id: string;
729
+ title: string;
730
+ description: string | null;
731
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
732
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
733
+ serviceDate: string | null;
734
+ startsAt: string | null;
735
+ endsAt: string | null;
736
+ quantity: number;
737
+ sellCurrency: string;
738
+ unitSellAmountCents: number | null;
739
+ totalSellAmountCents: number | null;
740
+ costCurrency: string | null;
741
+ unitCostAmountCents: number | null;
742
+ totalCostAmountCents: number | null;
743
+ notes: string | null;
744
+ productId: string | null;
745
+ optionId: string | null;
746
+ optionUnitId: string | null;
747
+ pricingCategoryId: string | null;
748
+ participantLinks: {
749
+ id: string;
750
+ participantId: string;
751
+ role: string;
752
+ isPrimary: boolean;
753
+ }[];
754
+ }[];
755
+ documents: {
756
+ id: string;
757
+ participantId: string | null;
758
+ type: "visa" | "other" | "insurance" | "health" | "passport_copy";
759
+ fileName: string;
760
+ fileUrl: string;
761
+ }[];
762
+ fulfillments: {
763
+ id: string;
764
+ bookingItemId: string | null;
765
+ participantId: string | null;
766
+ fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
767
+ deliveryChannel: "other" | "download" | "email" | "api" | "wallet";
768
+ status: "pending" | "issued" | "reissued" | "revoked" | "failed";
769
+ artifactUrl: string | null;
770
+ }[];
771
+ } | null>;
772
+ };
773
+ //# sourceMappingURL=service-public.d.ts.map