@voyantjs/storefront 0.49.0 → 0.50.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.
package/dist/service.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import type { EventBus } from "@voyantjs/core";
2
2
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
3
+ import { type StorefrontBookingSessionBootstrapOptions } from "./service-booking-session-bootstrap.js";
3
4
  import { type StorefrontIntakeGuard, type StorefrontIntakeOptions } from "./service-intake.js";
4
- import { type StorefrontDepartureListQuery, type StorefrontDeparturePricePreviewInput, type StorefrontLeadIntakeInput, type StorefrontNewsletterSubscribeInput, type StorefrontOfferApplyInput, type StorefrontOfferMutationResult, type StorefrontOfferRedeemInput, type StorefrontProductAvailabilitySummaryQuery, type StorefrontPromotionalOffer, type StorefrontSettings, type StorefrontSettingsInput } from "./validation.js";
5
+ import { type StorefrontBookingSessionBootstrapInput, type StorefrontDepartureListQuery, type StorefrontDeparturePricePreviewInput, type StorefrontLeadIntakeInput, type StorefrontNewsletterSubscribeInput, type StorefrontOfferApplyInput, type StorefrontOfferMutationResult, type StorefrontOfferRedeemInput, type StorefrontProductAvailabilitySummaryQuery, type StorefrontPromotionalOffer, type StorefrontSettings, type StorefrontSettingsInput, type StorefrontSettingsPatchInput } from "./validation.js";
5
6
  import type { StorefrontTransportEligibilityInput, StorefrontTransportEligibilityResult, StorefrontTransportEligibilityRuleInput } from "./validation-transport-eligibility.js";
6
7
  export interface StorefrontServiceOptions {
7
8
  settings?: StorefrontSettingsInput;
8
9
  resolveSettings?: (context: StorefrontRequestContext) => Promise<StorefrontSettingsInput> | StorefrontSettingsInput;
10
+ updateSettings?: (input: StorefrontSettings, context: StorefrontRequestContext) => Promise<StorefrontSettingsInput | StorefrontSettings> | StorefrontSettingsInput | StorefrontSettings;
9
11
  offers?: StorefrontOfferResolvers;
10
12
  resolveOffers?: (context: StorefrontRequestContext) => Promise<StorefrontOfferResolvers | null | undefined> | StorefrontOfferResolvers | null | undefined;
11
13
  transportEligibilityRules?: StorefrontTransportEligibilityRuleInput[];
@@ -16,6 +18,7 @@ export interface StorefrontServiceOptions {
16
18
  travelEndsOn?: string | null;
17
19
  } & StorefrontRequestContext) => Promise<StorefrontTransportEligibilityRuleInput[]> | StorefrontTransportEligibilityRuleInput[];
18
20
  intake?: StorefrontIntakeOptions;
21
+ bookingSessionBootstrap?: StorefrontBookingSessionBootstrapOptions;
19
22
  }
20
23
  export interface StorefrontRequestContext {
21
24
  db?: PostgresJsDatabase;
@@ -42,22 +45,36 @@ export interface StorefrontOfferResolvers {
42
45
  } & StorefrontRequestContext) => Promise<StorefrontOfferMutationResult> | StorefrontOfferMutationResult;
43
46
  }
44
47
  export declare function resolveStorefrontSettings(input?: StorefrontSettingsInput): StorefrontSettings;
48
+ export declare function mergeStorefrontSettingsPatch(current: StorefrontSettings, patch: StorefrontSettingsPatchInput): StorefrontSettings;
45
49
  export declare function createStorefrontService(options?: StorefrontServiceOptions): {
46
50
  getSettings(): StorefrontSettings;
47
51
  resolveSettings: (context?: StorefrontRequestContext) => Promise<{
48
52
  branding: {
49
53
  logoUrl: string | null;
54
+ faviconUrl: string | null;
55
+ brandMarkUrl: string | null;
56
+ primaryColor: string | null;
57
+ accentColor: string | null;
50
58
  supportedLanguages: string[];
51
59
  };
52
60
  support: {
53
61
  email: string | null;
54
62
  phone: string | null;
63
+ links: {
64
+ label: string;
65
+ url: string;
66
+ }[];
55
67
  };
56
68
  legal: {
57
69
  termsUrl: string | null;
58
70
  privacyUrl: string | null;
71
+ cancellationUrl: string | null;
59
72
  defaultContractTemplateId: string | null;
60
73
  };
74
+ localization: {
75
+ defaultLocale: string | null;
76
+ currencyDisplay: "symbol" | "name" | "code";
77
+ };
61
78
  forms: {
62
79
  billing: {
63
80
  fields: {
@@ -91,15 +108,136 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
91
108
  };
92
109
  };
93
110
  payment: {
94
- defaultMethod: "voucher" | "bank_transfer" | "card" | "cash" | "invoice" | null;
111
+ defaultMethod: "voucher" | "bank_transfer" | "cash" | "invoice" | "card" | null;
95
112
  methods: {
96
- code: "voucher" | "bank_transfer" | "card" | "cash" | "invoice";
113
+ code: "voucher" | "bank_transfer" | "cash" | "invoice" | "card";
97
114
  label: string;
98
115
  description: string | null;
99
116
  enabled: boolean;
100
117
  }[];
118
+ structure: "split" | "full";
119
+ schedule: {
120
+ percent: number;
121
+ dueInDays: number;
122
+ dueCondition: "after_booking" | "before_departure";
123
+ }[];
124
+ defaultSchedule: {
125
+ depositPercent: number | null;
126
+ balanceDueDaysBeforeDeparture: number | null;
127
+ } | null;
128
+ bankTransfer: {
129
+ dueDays: number | null;
130
+ account: {
131
+ provider: string | null;
132
+ currency: string | null;
133
+ iban: string;
134
+ beneficiary: string;
135
+ bank: string;
136
+ } | null;
137
+ accountHolder: string | null;
138
+ bankName: string | null;
139
+ iban: string | null;
140
+ bic: string | null;
141
+ paymentReference: string | null;
142
+ instructions: string | null;
143
+ } | null;
101
144
  };
102
145
  }>;
146
+ updateSettings: (patch: StorefrontSettingsPatchInput, context?: StorefrontRequestContext) => Promise<{
147
+ branding: {
148
+ logoUrl: string | null;
149
+ faviconUrl: string | null;
150
+ brandMarkUrl: string | null;
151
+ primaryColor: string | null;
152
+ accentColor: string | null;
153
+ supportedLanguages: string[];
154
+ };
155
+ support: {
156
+ email: string | null;
157
+ phone: string | null;
158
+ links: {
159
+ label: string;
160
+ url: string;
161
+ }[];
162
+ };
163
+ legal: {
164
+ termsUrl: string | null;
165
+ privacyUrl: string | null;
166
+ cancellationUrl: string | null;
167
+ defaultContractTemplateId: string | null;
168
+ };
169
+ localization: {
170
+ defaultLocale: string | null;
171
+ currencyDisplay: "symbol" | "name" | "code";
172
+ };
173
+ forms: {
174
+ billing: {
175
+ fields: {
176
+ key: string;
177
+ label: string;
178
+ type: "text" | "date" | "select" | "email" | "country" | "tel" | "textarea" | "checkbox";
179
+ required: boolean;
180
+ placeholder: string | null;
181
+ description: string | null;
182
+ autocomplete: string | null;
183
+ options: {
184
+ value: string;
185
+ label: string;
186
+ }[];
187
+ }[];
188
+ };
189
+ travelers: {
190
+ fields: {
191
+ key: string;
192
+ label: string;
193
+ type: "text" | "date" | "select" | "email" | "country" | "tel" | "textarea" | "checkbox";
194
+ required: boolean;
195
+ placeholder: string | null;
196
+ description: string | null;
197
+ autocomplete: string | null;
198
+ options: {
199
+ value: string;
200
+ label: string;
201
+ }[];
202
+ }[];
203
+ };
204
+ };
205
+ payment: {
206
+ defaultMethod: "voucher" | "bank_transfer" | "cash" | "invoice" | "card" | null;
207
+ methods: {
208
+ code: "voucher" | "bank_transfer" | "cash" | "invoice" | "card";
209
+ label: string;
210
+ description: string | null;
211
+ enabled: boolean;
212
+ }[];
213
+ structure: "split" | "full";
214
+ schedule: {
215
+ percent: number;
216
+ dueInDays: number;
217
+ dueCondition: "after_booking" | "before_departure";
218
+ }[];
219
+ defaultSchedule: {
220
+ depositPercent: number | null;
221
+ balanceDueDaysBeforeDeparture: number | null;
222
+ } | null;
223
+ bankTransfer: {
224
+ dueDays: number | null;
225
+ account: {
226
+ provider: string | null;
227
+ currency: string | null;
228
+ iban: string;
229
+ beneficiary: string;
230
+ bank: string;
231
+ } | null;
232
+ accountHolder: string | null;
233
+ bankName: string | null;
234
+ iban: string | null;
235
+ bic: string | null;
236
+ paymentReference: string | null;
237
+ instructions: string | null;
238
+ } | null;
239
+ };
240
+ } | null>;
103
241
  getDeparture(db: PostgresJsDatabase, departureId: string): Promise<{
104
242
  id: string;
105
243
  productId: string;
@@ -195,7 +333,7 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
195
333
  limit: number;
196
334
  offset: number;
197
335
  }>;
198
- previewDeparturePrice(db: PostgresJsDatabase, departureId: string, input: StorefrontDeparturePricePreviewInput): Promise<{
336
+ previewDeparturePrice(db: PostgresJsDatabase, departureId: string, input: StorefrontDeparturePricePreviewInput, context?: StorefrontRequestContext): Promise<{
199
337
  departureId: string;
200
338
  productId: string;
201
339
  optionId: string | null;
@@ -210,6 +348,272 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
210
348
  quantity: number;
211
349
  unitPrice: number;
212
350
  }[];
351
+ allocation: {
352
+ slot: {
353
+ id: string;
354
+ productId: string;
355
+ optionId: string | null;
356
+ dateLocal: string | null;
357
+ startAt: string | null;
358
+ endAt: string | null;
359
+ timezone: string;
360
+ status: "cancelled" | "open" | "closed" | "sold_out" | "on_request";
361
+ availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "on_request" | "unavailable" | "available";
362
+ capacity: number | null;
363
+ remaining: number | null;
364
+ pastCutoff: boolean;
365
+ tooEarly: boolean;
366
+ };
367
+ pax: {
368
+ adults: number;
369
+ children: number;
370
+ infants: number;
371
+ total: number;
372
+ };
373
+ requestedUnits: {
374
+ unitId: string | null;
375
+ requestRef: string | null;
376
+ name: string;
377
+ unitType: string | null;
378
+ quantity: number;
379
+ pricingMode: string | null;
380
+ unitPrice: number;
381
+ total: number;
382
+ currencyCode: string;
383
+ tierId: string | null;
384
+ }[];
385
+ rooms: {
386
+ unitId: string;
387
+ name: string;
388
+ occupancy: number;
389
+ quantity: number;
390
+ pax: number;
391
+ pricingMode: string | null;
392
+ unitPrice: number;
393
+ total: number;
394
+ currencyCode: string;
395
+ tierId: string | null;
396
+ }[];
397
+ };
398
+ units: {
399
+ unitId: string | null;
400
+ requestRef: string | null;
401
+ name: string;
402
+ unitType: string | null;
403
+ quantity: number;
404
+ pricingMode: string | null;
405
+ unitPrice: number;
406
+ total: number;
407
+ currencyCode: string;
408
+ tierId: string | null;
409
+ }[];
410
+ rooms: {
411
+ unitId: string;
412
+ name: string;
413
+ occupancy: number;
414
+ quantity: number;
415
+ pax: number;
416
+ pricingMode: string | null;
417
+ unitPrice: number;
418
+ total: number;
419
+ currencyCode: string;
420
+ tierId: string | null;
421
+ }[];
422
+ extras: {
423
+ extraId: string;
424
+ name: string;
425
+ required: boolean;
426
+ selectable: boolean;
427
+ selected: boolean;
428
+ pricingMode: string;
429
+ quantity: number;
430
+ unitPrice: number;
431
+ total: number;
432
+ currencyCode: string;
433
+ }[];
434
+ offers: {
435
+ available: {
436
+ offer: {
437
+ id: string;
438
+ name: string;
439
+ slug: string | null;
440
+ description: string | null;
441
+ discountType: "percentage" | "fixed_amount";
442
+ discountValue: string;
443
+ currency: string | null;
444
+ applicableProductIds: string[];
445
+ applicableDepartureIds: string[];
446
+ validFrom: string | null;
447
+ validTo: string | null;
448
+ minTravelers: number | null;
449
+ imageMobileUrl: string | null;
450
+ imageDesktopUrl: string | null;
451
+ stackable: boolean;
452
+ createdAt: string;
453
+ updatedAt: string;
454
+ };
455
+ status: string;
456
+ reason: string | null;
457
+ selected: boolean;
458
+ discountAppliedCents: number;
459
+ discountedPriceCents: number;
460
+ }[];
461
+ requested: ({
462
+ kind: "slug";
463
+ value: string;
464
+ result: {
465
+ status: "applied" | "not_applicable" | "conflict" | "invalid";
466
+ reason: "scope" | "currency" | "booking_mismatch" | "conflict" | "min_pax" | "no_discount" | "offer_not_found" | "offer_expired" | "offer_not_yet_valid" | "code_not_found" | "code_required" | "code_expired" | "code_not_yet_valid" | "session_mismatch" | null;
467
+ offer: {
468
+ id: string;
469
+ name: string;
470
+ slug: string | null;
471
+ description: string | null;
472
+ discountType: "percentage" | "fixed_amount";
473
+ discountValue: string;
474
+ currency: string | null;
475
+ applicableProductIds: string[];
476
+ applicableDepartureIds: string[];
477
+ validFrom: string | null;
478
+ validTo: string | null;
479
+ minTravelers: number | null;
480
+ imageMobileUrl: string | null;
481
+ imageDesktopUrl: string | null;
482
+ stackable: boolean;
483
+ createdAt: string;
484
+ updatedAt: string;
485
+ } | null;
486
+ target: {
487
+ bookingId: string | null;
488
+ sessionId: string | null;
489
+ productId: string;
490
+ departureId: string | null;
491
+ };
492
+ pricing: {
493
+ basePriceCents: number;
494
+ currency: string;
495
+ discountAppliedCents: number;
496
+ discountedPriceCents: number;
497
+ };
498
+ appliedOffers: {
499
+ offerId: string;
500
+ offerName: string;
501
+ discountAppliedCents: number;
502
+ discountedPriceCents: number;
503
+ currency: string;
504
+ discountKind: "percentage" | "fixed_amount";
505
+ discountPercent: number | null;
506
+ discountAmountCents: number | null;
507
+ appliedCode: string | null;
508
+ stackable: boolean;
509
+ }[];
510
+ conflict: {
511
+ policy: "best_discount_wins" | "stackable_compose";
512
+ autoAppliedOfferIds: string[];
513
+ manualOfferId: string | null;
514
+ selectedOfferIds: string[];
515
+ message: string;
516
+ } | null;
517
+ } | null;
518
+ } | {
519
+ kind: "code";
520
+ value: string;
521
+ result: {
522
+ status: "applied" | "not_applicable" | "conflict" | "invalid";
523
+ reason: "scope" | "currency" | "booking_mismatch" | "conflict" | "min_pax" | "no_discount" | "offer_not_found" | "offer_expired" | "offer_not_yet_valid" | "code_not_found" | "code_required" | "code_expired" | "code_not_yet_valid" | "session_mismatch" | null;
524
+ offer: {
525
+ id: string;
526
+ name: string;
527
+ slug: string | null;
528
+ description: string | null;
529
+ discountType: "percentage" | "fixed_amount";
530
+ discountValue: string;
531
+ currency: string | null;
532
+ applicableProductIds: string[];
533
+ applicableDepartureIds: string[];
534
+ validFrom: string | null;
535
+ validTo: string | null;
536
+ minTravelers: number | null;
537
+ imageMobileUrl: string | null;
538
+ imageDesktopUrl: string | null;
539
+ stackable: boolean;
540
+ createdAt: string;
541
+ updatedAt: string;
542
+ } | null;
543
+ target: {
544
+ bookingId: string | null;
545
+ sessionId: string | null;
546
+ productId: string;
547
+ departureId: string | null;
548
+ };
549
+ pricing: {
550
+ basePriceCents: number;
551
+ currency: string;
552
+ discountAppliedCents: number;
553
+ discountedPriceCents: number;
554
+ };
555
+ appliedOffers: {
556
+ offerId: string;
557
+ offerName: string;
558
+ discountAppliedCents: number;
559
+ discountedPriceCents: number;
560
+ currency: string;
561
+ discountKind: "percentage" | "fixed_amount";
562
+ discountPercent: number | null;
563
+ discountAmountCents: number | null;
564
+ appliedCode: string | null;
565
+ stackable: boolean;
566
+ }[];
567
+ conflict: {
568
+ policy: "best_discount_wins" | "stackable_compose";
569
+ autoAppliedOfferIds: string[];
570
+ manualOfferId: string | null;
571
+ selectedOfferIds: string[];
572
+ message: string;
573
+ } | null;
574
+ } | null;
575
+ })[];
576
+ applied: {
577
+ offerId: string;
578
+ offerName: string;
579
+ discountAppliedCents: number;
580
+ discountedPriceCents: number;
581
+ currency: string;
582
+ discountKind: "percentage" | "fixed_amount";
583
+ discountPercent: number | null;
584
+ discountAmountCents: number | null;
585
+ appliedCode: string | null;
586
+ stackable: boolean;
587
+ }[];
588
+ conflict: {
589
+ policy: "best_discount_wins" | "stackable_compose";
590
+ autoAppliedOfferIds: string[];
591
+ manualOfferId: string | null;
592
+ selectedOfferIds: string[];
593
+ message: string;
594
+ } | {
595
+ policy: string;
596
+ autoAppliedOfferIds: string[];
597
+ manualOfferId: null;
598
+ selectedOfferIds: string[];
599
+ message: string;
600
+ } | null;
601
+ discountTotal: number;
602
+ discountTotalCents: number;
603
+ totalAfterDiscount: number;
604
+ currencyCode: string;
605
+ };
606
+ totals: {
607
+ currencyCode: string;
608
+ base: number;
609
+ extras: number;
610
+ subtotal: number;
611
+ discount: number;
612
+ tax: number;
613
+ total: number;
614
+ perPerson: number;
615
+ perBooking: number;
616
+ };
213
617
  } | null>;
214
618
  getProductExtensions(db: PostgresJsDatabase, productId: string, optionId?: string): Promise<{
215
619
  extensions: {
@@ -257,7 +661,7 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
257
661
  }>;
258
662
  getProductAvailabilitySummary(db: PostgresJsDatabase, productId: string, query: StorefrontProductAvailabilitySummaryQuery): Promise<{
259
663
  productId: string;
260
- availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "unavailable" | "on_request" | "available";
664
+ availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "on_request" | "unavailable" | "available";
261
665
  counts: {
262
666
  total: number;
263
667
  open: number;
@@ -278,7 +682,7 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
278
682
  endAt: string | null;
279
683
  timezone: string;
280
684
  status: "cancelled" | "open" | "closed" | "sold_out" | "on_request";
281
- availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "unavailable" | "on_request" | "available";
685
+ availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "on_request" | "unavailable" | "available";
282
686
  capacity: number | null;
283
687
  remaining: number | null;
284
688
  pastCutoff: boolean;
@@ -314,6 +718,221 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
314
718
  body: StorefrontTransportEligibilityInput;
315
719
  context?: StorefrontRequestContext;
316
720
  }): Promise<StorefrontTransportEligibilityResult>;
721
+ bootstrapBookingSession(context: StorefrontRequestContext & {
722
+ db: PostgresJsDatabase;
723
+ }, input: StorefrontBookingSessionBootstrapInput, userId?: string): Promise<{
724
+ status: Exclude<string, "ok">;
725
+ } | {
726
+ status: "stale_quote";
727
+ repricing: {
728
+ originalQuote: {
729
+ currencyCode: string;
730
+ totalSellAmountCents: number;
731
+ quotedAt?: string | null | undefined;
732
+ expiresAt?: string | null | undefined;
733
+ };
734
+ current: {
735
+ sessionId: string;
736
+ catalogId: string | null;
737
+ currencyCode: string;
738
+ totalSellAmountCents: number;
739
+ items: {
740
+ inputIndex: number;
741
+ itemId: string;
742
+ title: string;
743
+ productId: string | null;
744
+ optionId: string | null;
745
+ optionUnitId: string | null;
746
+ optionUnitName: string | null;
747
+ optionUnitType: string | null;
748
+ pricingCategoryId: string | null;
749
+ quantity: number;
750
+ pricingMode: string;
751
+ unitSellAmountCents: number | null;
752
+ totalSellAmountCents: number | null;
753
+ warnings: string[];
754
+ }[];
755
+ warnings: never[];
756
+ appliedToSession: boolean;
757
+ };
758
+ deltaAmountCents: number;
759
+ staleQuote: boolean;
760
+ };
761
+ bootstrap?: undefined;
762
+ } | {
763
+ status: "ok";
764
+ bootstrap: {
765
+ session: {
766
+ sessionId: string;
767
+ bookingNumber: string;
768
+ status: "completed" | "cancelled" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "expired";
769
+ externalBookingRef: string | null;
770
+ communicationLanguage: string | null;
771
+ sellCurrency: string;
772
+ sellAmountCents: number | null;
773
+ startDate: string | null;
774
+ endDate: string | null;
775
+ pax: number | null;
776
+ holdExpiresAt: string | null;
777
+ confirmedAt: string | null;
778
+ expiredAt: string | null;
779
+ cancelledAt: string | null;
780
+ completedAt: string | null;
781
+ travelers: {
782
+ id: string;
783
+ participantType: "other" | "traveler" | "occupant";
784
+ travelerCategory: "child" | "other" | "adult" | "infant" | "senior" | null;
785
+ firstName: string;
786
+ lastName: string;
787
+ email: string | null;
788
+ phone: string | null;
789
+ preferredLanguage: string | null;
790
+ specialRequests: string | null;
791
+ isPrimary: boolean;
792
+ notes: string | null;
793
+ }[];
794
+ items: {
795
+ id: string;
796
+ title: string;
797
+ description: string | null;
798
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
799
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
800
+ serviceDate: string | null;
801
+ startsAt: string | null;
802
+ endsAt: string | null;
803
+ quantity: number;
804
+ sellCurrency: string;
805
+ unitSellAmountCents: number | null;
806
+ totalSellAmountCents: number | null;
807
+ costCurrency: string | null;
808
+ unitCostAmountCents: number | null;
809
+ totalCostAmountCents: number | null;
810
+ notes: string | null;
811
+ productId: string | null;
812
+ optionId: string | null;
813
+ optionUnitId: string | null;
814
+ pricingCategoryId: string | null;
815
+ travelerLinks: {
816
+ id: string;
817
+ travelerId: string;
818
+ role: string;
819
+ isPrimary: boolean;
820
+ }[];
821
+ }[];
822
+ allocations: {
823
+ id: string;
824
+ bookingItemId: string;
825
+ productId: string | null;
826
+ optionId: string | null;
827
+ optionUnitId: string | null;
828
+ pricingCategoryId: string | null;
829
+ availabilitySlotId: string | null;
830
+ quantity: number;
831
+ allocationType: "resource" | "pickup" | "unit";
832
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
833
+ holdExpiresAt: string | null;
834
+ confirmedAt: string | null;
835
+ releasedAt: string | null;
836
+ }[];
837
+ checklist: {
838
+ hasTravelers: boolean;
839
+ hasPrimaryTraveler: boolean;
840
+ hasItems: boolean;
841
+ hasAllocations: boolean;
842
+ readyForConfirmation: boolean;
843
+ };
844
+ state: {
845
+ sessionId: string;
846
+ stateKey: "wizard";
847
+ currentStep: string | null;
848
+ completedSteps: string[];
849
+ payload: Record<string, unknown>;
850
+ version: number;
851
+ createdAt: string;
852
+ updatedAt: string;
853
+ } | null;
854
+ };
855
+ paymentPlan: {
856
+ source: "storefront_default";
857
+ depositKind: import("@voyantjs/finance").DepositKind;
858
+ depositPercent: number | null;
859
+ depositAmountCents: number | null;
860
+ requiresFullPayment: boolean;
861
+ };
862
+ paymentSchedule: {
863
+ id: string;
864
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
865
+ status: "pending" | "cancelled" | "expired" | "paid" | "due" | "waived";
866
+ dueDate: string;
867
+ currency: string;
868
+ amountCents: number;
869
+ notes: string | null;
870
+ }[];
871
+ repricing: {
872
+ originalQuote: {
873
+ currencyCode: string;
874
+ totalSellAmountCents: number;
875
+ quotedAt?: string | null | undefined;
876
+ expiresAt?: string | null | undefined;
877
+ };
878
+ current: {
879
+ sessionId: string;
880
+ items: {
881
+ itemId: string;
882
+ title: string;
883
+ productId: string | null;
884
+ optionId: string | null;
885
+ optionUnitId: string | null;
886
+ optionUnitName: string | null;
887
+ optionUnitType: string | null;
888
+ pricingCategoryId: string | null;
889
+ quantity: number;
890
+ pricingMode: string;
891
+ unitSellAmountCents: number | null;
892
+ totalSellAmountCents: number | null;
893
+ warnings: string[];
894
+ }[];
895
+ catalogId: string | null;
896
+ currencyCode: string;
897
+ totalSellAmountCents: number;
898
+ warnings: never[];
899
+ appliedToSession: boolean;
900
+ };
901
+ deltaAmountCents: number;
902
+ staleQuote: boolean;
903
+ };
904
+ availability: {
905
+ departureId: string;
906
+ slotId: string;
907
+ productId: string;
908
+ optionId: string | null;
909
+ dateLocal: string;
910
+ startsAt: string | null;
911
+ endsAt: string | null;
912
+ timezone: string;
913
+ status: "cancelled" | "open" | "closed" | "sold_out";
914
+ capacity: number | null;
915
+ remaining: number | null;
916
+ };
917
+ allocation: {
918
+ id: string;
919
+ bookingItemId: string;
920
+ productId: string | null;
921
+ optionId: string | null;
922
+ optionUnitId: string | null;
923
+ pricingCategoryId: string | null;
924
+ availabilitySlotId: string | null;
925
+ quantity: number;
926
+ allocationType: "resource" | "pickup" | "unit";
927
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
928
+ holdExpiresAt: string | null;
929
+ confirmedAt: string | null;
930
+ releasedAt: string | null;
931
+ }[];
932
+ currency: string;
933
+ };
934
+ repricing?: undefined;
935
+ }>;
317
936
  listApplicableOffers(input: {
318
937
  productId: string;
319
938
  departureId?: string;
@@ -350,7 +969,7 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
350
969
  id: string;
351
970
  personId: string;
352
971
  kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
353
- source: "admin" | "form" | "phone" | "website" | "booking" | "abandoned_cart";
972
+ source: "admin" | "form" | "phone" | "booking" | "website" | "abandoned_cart";
354
973
  status: "expired" | "converted" | "lost" | "new" | "contacted" | "qualified";
355
974
  duplicate: boolean;
356
975
  }>;
@@ -361,10 +980,10 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
361
980
  id: string;
362
981
  personId: string;
363
982
  kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
364
- source: "admin" | "form" | "phone" | "website" | "booking" | "abandoned_cart";
983
+ source: "admin" | "form" | "phone" | "booking" | "website" | "abandoned_cart";
365
984
  status: "expired" | "converted" | "lost" | "new" | "contacted" | "qualified";
366
985
  duplicate: boolean;
367
- doubleOptIn: "not_configured" | "requested";
986
+ doubleOptIn: "requested" | "not_configured";
368
987
  }>;
369
988
  };
370
989
  export type { StorefrontIntakeGuard, StorefrontIntakeOptions };