@voyantjs/octo 0.2.0 → 0.3.1

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