@voyantjs/storefront 0.47.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/service.d.ts CHANGED
@@ -1,9 +1,13 @@
1
+ import type { EventBus } from "@voyantjs/core";
1
2
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
- import { type StorefrontDepartureListQuery, type StorefrontDeparturePricePreviewInput, type StorefrontOfferApplyInput, type StorefrontOfferMutationResult, type StorefrontOfferRedeemInput, type StorefrontProductAvailabilitySummaryQuery, type StorefrontPromotionalOffer, type StorefrontSettings, type StorefrontSettingsInput } from "./validation.js";
3
+ import { type StorefrontBookingSessionBootstrapOptions } from "./service-booking-session-bootstrap.js";
4
+ import { type StorefrontIntakeGuard, type StorefrontIntakeOptions } from "./service-intake.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";
3
6
  import type { StorefrontTransportEligibilityInput, StorefrontTransportEligibilityResult, StorefrontTransportEligibilityRuleInput } from "./validation-transport-eligibility.js";
4
7
  export interface StorefrontServiceOptions {
5
8
  settings?: StorefrontSettingsInput;
6
9
  resolveSettings?: (context: StorefrontRequestContext) => Promise<StorefrontSettingsInput> | StorefrontSettingsInput;
10
+ updateSettings?: (input: StorefrontSettings, context: StorefrontRequestContext) => Promise<StorefrontSettingsInput | StorefrontSettings> | StorefrontSettingsInput | StorefrontSettings;
7
11
  offers?: StorefrontOfferResolvers;
8
12
  resolveOffers?: (context: StorefrontRequestContext) => Promise<StorefrontOfferResolvers | null | undefined> | StorefrontOfferResolvers | null | undefined;
9
13
  transportEligibilityRules?: StorefrontTransportEligibilityRuleInput[];
@@ -13,9 +17,12 @@ export interface StorefrontServiceOptions {
13
17
  travelStartsOn?: string | null;
14
18
  travelEndsOn?: string | null;
15
19
  } & StorefrontRequestContext) => Promise<StorefrontTransportEligibilityRuleInput[]> | StorefrontTransportEligibilityRuleInput[];
20
+ intake?: StorefrontIntakeOptions;
21
+ bookingSessionBootstrap?: StorefrontBookingSessionBootstrapOptions;
16
22
  }
17
23
  export interface StorefrontRequestContext {
18
24
  db?: PostgresJsDatabase;
25
+ eventBus?: EventBus;
19
26
  env?: unknown;
20
27
  context?: unknown;
21
28
  }
@@ -38,22 +45,36 @@ export interface StorefrontOfferResolvers {
38
45
  } & StorefrontRequestContext) => Promise<StorefrontOfferMutationResult> | StorefrontOfferMutationResult;
39
46
  }
40
47
  export declare function resolveStorefrontSettings(input?: StorefrontSettingsInput): StorefrontSettings;
48
+ export declare function mergeStorefrontSettingsPatch(current: StorefrontSettings, patch: StorefrontSettingsPatchInput): StorefrontSettings;
41
49
  export declare function createStorefrontService(options?: StorefrontServiceOptions): {
42
50
  getSettings(): StorefrontSettings;
43
51
  resolveSettings: (context?: StorefrontRequestContext) => Promise<{
44
52
  branding: {
45
53
  logoUrl: string | null;
54
+ faviconUrl: string | null;
55
+ brandMarkUrl: string | null;
56
+ primaryColor: string | null;
57
+ accentColor: string | null;
46
58
  supportedLanguages: string[];
47
59
  };
48
60
  support: {
49
61
  email: string | null;
50
62
  phone: string | null;
63
+ links: {
64
+ label: string;
65
+ url: string;
66
+ }[];
51
67
  };
52
68
  legal: {
53
69
  termsUrl: string | null;
54
70
  privacyUrl: string | null;
71
+ cancellationUrl: string | null;
55
72
  defaultContractTemplateId: string | null;
56
73
  };
74
+ localization: {
75
+ defaultLocale: string | null;
76
+ currencyDisplay: "symbol" | "name" | "code";
77
+ };
57
78
  forms: {
58
79
  billing: {
59
80
  fields: {
@@ -87,15 +108,108 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
87
108
  };
88
109
  };
89
110
  payment: {
90
- defaultMethod: "voucher" | "card" | "bank_transfer" | "cash" | "invoice" | null;
111
+ defaultMethod: "voucher" | "bank_transfer" | "cash" | "invoice" | "card" | null;
91
112
  methods: {
92
- code: "voucher" | "card" | "bank_transfer" | "cash" | "invoice";
113
+ code: "voucher" | "bank_transfer" | "cash" | "invoice" | "card";
93
114
  label: string;
94
115
  description: string | null;
95
116
  enabled: boolean;
96
117
  }[];
118
+ defaultSchedule: {
119
+ depositPercent: number | null;
120
+ balanceDueDaysBeforeDeparture: number | null;
121
+ } | null;
122
+ bankTransfer: {
123
+ accountHolder: string | null;
124
+ bankName: string | null;
125
+ iban: string | null;
126
+ bic: string | null;
127
+ paymentReference: string | null;
128
+ instructions: string | null;
129
+ } | null;
97
130
  };
98
131
  }>;
132
+ updateSettings: (patch: StorefrontSettingsPatchInput, context?: StorefrontRequestContext) => Promise<{
133
+ branding: {
134
+ logoUrl: string | null;
135
+ faviconUrl: string | null;
136
+ brandMarkUrl: string | null;
137
+ primaryColor: string | null;
138
+ accentColor: string | null;
139
+ supportedLanguages: string[];
140
+ };
141
+ support: {
142
+ email: string | null;
143
+ phone: string | null;
144
+ links: {
145
+ label: string;
146
+ url: string;
147
+ }[];
148
+ };
149
+ legal: {
150
+ termsUrl: string | null;
151
+ privacyUrl: string | null;
152
+ cancellationUrl: string | null;
153
+ defaultContractTemplateId: string | null;
154
+ };
155
+ localization: {
156
+ defaultLocale: string | null;
157
+ currencyDisplay: "symbol" | "name" | "code";
158
+ };
159
+ forms: {
160
+ billing: {
161
+ fields: {
162
+ key: string;
163
+ label: string;
164
+ type: "text" | "date" | "select" | "email" | "country" | "tel" | "textarea" | "checkbox";
165
+ required: boolean;
166
+ placeholder: string | null;
167
+ description: string | null;
168
+ autocomplete: string | null;
169
+ options: {
170
+ value: string;
171
+ label: string;
172
+ }[];
173
+ }[];
174
+ };
175
+ travelers: {
176
+ fields: {
177
+ key: string;
178
+ label: string;
179
+ type: "text" | "date" | "select" | "email" | "country" | "tel" | "textarea" | "checkbox";
180
+ required: boolean;
181
+ placeholder: string | null;
182
+ description: string | null;
183
+ autocomplete: string | null;
184
+ options: {
185
+ value: string;
186
+ label: string;
187
+ }[];
188
+ }[];
189
+ };
190
+ };
191
+ payment: {
192
+ defaultMethod: "voucher" | "bank_transfer" | "cash" | "invoice" | "card" | null;
193
+ methods: {
194
+ code: "voucher" | "bank_transfer" | "cash" | "invoice" | "card";
195
+ label: string;
196
+ description: string | null;
197
+ enabled: boolean;
198
+ }[];
199
+ defaultSchedule: {
200
+ depositPercent: number | null;
201
+ balanceDueDaysBeforeDeparture: number | null;
202
+ } | null;
203
+ bankTransfer: {
204
+ accountHolder: string | null;
205
+ bankName: string | null;
206
+ iban: string | null;
207
+ bic: string | null;
208
+ paymentReference: string | null;
209
+ instructions: string | null;
210
+ } | null;
211
+ };
212
+ } | null>;
99
213
  getDeparture(db: PostgresJsDatabase, departureId: string): Promise<{
100
214
  id: string;
101
215
  productId: string;
@@ -191,7 +305,7 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
191
305
  limit: number;
192
306
  offset: number;
193
307
  }>;
194
- previewDeparturePrice(db: PostgresJsDatabase, departureId: string, input: StorefrontDeparturePricePreviewInput): Promise<{
308
+ previewDeparturePrice(db: PostgresJsDatabase, departureId: string, input: StorefrontDeparturePricePreviewInput, context?: StorefrontRequestContext): Promise<{
195
309
  departureId: string;
196
310
  productId: string;
197
311
  optionId: string | null;
@@ -206,6 +320,272 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
206
320
  quantity: number;
207
321
  unitPrice: number;
208
322
  }[];
323
+ allocation: {
324
+ slot: {
325
+ id: string;
326
+ productId: string;
327
+ optionId: string | null;
328
+ dateLocal: string | null;
329
+ startAt: string | null;
330
+ endAt: string | null;
331
+ timezone: string;
332
+ status: "cancelled" | "open" | "closed" | "sold_out" | "on_request";
333
+ availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "on_request" | "unavailable" | "available";
334
+ capacity: number | null;
335
+ remaining: number | null;
336
+ pastCutoff: boolean;
337
+ tooEarly: boolean;
338
+ };
339
+ pax: {
340
+ adults: number;
341
+ children: number;
342
+ infants: number;
343
+ total: number;
344
+ };
345
+ requestedUnits: {
346
+ unitId: string | null;
347
+ requestRef: string | null;
348
+ name: string;
349
+ unitType: string | null;
350
+ quantity: number;
351
+ pricingMode: string | null;
352
+ unitPrice: number;
353
+ total: number;
354
+ currencyCode: string;
355
+ tierId: string | null;
356
+ }[];
357
+ rooms: {
358
+ unitId: string;
359
+ name: string;
360
+ occupancy: number;
361
+ quantity: number;
362
+ pax: number;
363
+ pricingMode: string | null;
364
+ unitPrice: number;
365
+ total: number;
366
+ currencyCode: string;
367
+ tierId: string | null;
368
+ }[];
369
+ };
370
+ units: {
371
+ unitId: string | null;
372
+ requestRef: string | null;
373
+ name: string;
374
+ unitType: string | null;
375
+ quantity: number;
376
+ pricingMode: string | null;
377
+ unitPrice: number;
378
+ total: number;
379
+ currencyCode: string;
380
+ tierId: string | null;
381
+ }[];
382
+ rooms: {
383
+ unitId: string;
384
+ name: string;
385
+ occupancy: number;
386
+ quantity: number;
387
+ pax: number;
388
+ pricingMode: string | null;
389
+ unitPrice: number;
390
+ total: number;
391
+ currencyCode: string;
392
+ tierId: string | null;
393
+ }[];
394
+ extras: {
395
+ extraId: string;
396
+ name: string;
397
+ required: boolean;
398
+ selectable: boolean;
399
+ selected: boolean;
400
+ pricingMode: string;
401
+ quantity: number;
402
+ unitPrice: number;
403
+ total: number;
404
+ currencyCode: string;
405
+ }[];
406
+ offers: {
407
+ available: {
408
+ offer: {
409
+ id: string;
410
+ name: string;
411
+ slug: string | null;
412
+ description: string | null;
413
+ discountType: "percentage" | "fixed_amount";
414
+ discountValue: string;
415
+ currency: string | null;
416
+ applicableProductIds: string[];
417
+ applicableDepartureIds: string[];
418
+ validFrom: string | null;
419
+ validTo: string | null;
420
+ minTravelers: number | null;
421
+ imageMobileUrl: string | null;
422
+ imageDesktopUrl: string | null;
423
+ stackable: boolean;
424
+ createdAt: string;
425
+ updatedAt: string;
426
+ };
427
+ status: string;
428
+ reason: string | null;
429
+ selected: boolean;
430
+ discountAppliedCents: number;
431
+ discountedPriceCents: number;
432
+ }[];
433
+ requested: ({
434
+ kind: "slug";
435
+ value: string;
436
+ result: {
437
+ status: "applied" | "not_applicable" | "conflict" | "invalid";
438
+ 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;
439
+ offer: {
440
+ id: string;
441
+ name: string;
442
+ slug: string | null;
443
+ description: string | null;
444
+ discountType: "percentage" | "fixed_amount";
445
+ discountValue: string;
446
+ currency: string | null;
447
+ applicableProductIds: string[];
448
+ applicableDepartureIds: string[];
449
+ validFrom: string | null;
450
+ validTo: string | null;
451
+ minTravelers: number | null;
452
+ imageMobileUrl: string | null;
453
+ imageDesktopUrl: string | null;
454
+ stackable: boolean;
455
+ createdAt: string;
456
+ updatedAt: string;
457
+ } | null;
458
+ target: {
459
+ bookingId: string | null;
460
+ sessionId: string | null;
461
+ productId: string;
462
+ departureId: string | null;
463
+ };
464
+ pricing: {
465
+ basePriceCents: number;
466
+ currency: string;
467
+ discountAppliedCents: number;
468
+ discountedPriceCents: number;
469
+ };
470
+ appliedOffers: {
471
+ offerId: string;
472
+ offerName: string;
473
+ discountAppliedCents: number;
474
+ discountedPriceCents: number;
475
+ currency: string;
476
+ discountKind: "percentage" | "fixed_amount";
477
+ discountPercent: number | null;
478
+ discountAmountCents: number | null;
479
+ appliedCode: string | null;
480
+ stackable: boolean;
481
+ }[];
482
+ conflict: {
483
+ policy: "best_discount_wins" | "stackable_compose";
484
+ autoAppliedOfferIds: string[];
485
+ manualOfferId: string | null;
486
+ selectedOfferIds: string[];
487
+ message: string;
488
+ } | null;
489
+ } | null;
490
+ } | {
491
+ kind: "code";
492
+ value: string;
493
+ result: {
494
+ status: "applied" | "not_applicable" | "conflict" | "invalid";
495
+ 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;
496
+ offer: {
497
+ id: string;
498
+ name: string;
499
+ slug: string | null;
500
+ description: string | null;
501
+ discountType: "percentage" | "fixed_amount";
502
+ discountValue: string;
503
+ currency: string | null;
504
+ applicableProductIds: string[];
505
+ applicableDepartureIds: string[];
506
+ validFrom: string | null;
507
+ validTo: string | null;
508
+ minTravelers: number | null;
509
+ imageMobileUrl: string | null;
510
+ imageDesktopUrl: string | null;
511
+ stackable: boolean;
512
+ createdAt: string;
513
+ updatedAt: string;
514
+ } | null;
515
+ target: {
516
+ bookingId: string | null;
517
+ sessionId: string | null;
518
+ productId: string;
519
+ departureId: string | null;
520
+ };
521
+ pricing: {
522
+ basePriceCents: number;
523
+ currency: string;
524
+ discountAppliedCents: number;
525
+ discountedPriceCents: number;
526
+ };
527
+ appliedOffers: {
528
+ offerId: string;
529
+ offerName: string;
530
+ discountAppliedCents: number;
531
+ discountedPriceCents: number;
532
+ currency: string;
533
+ discountKind: "percentage" | "fixed_amount";
534
+ discountPercent: number | null;
535
+ discountAmountCents: number | null;
536
+ appliedCode: string | null;
537
+ stackable: boolean;
538
+ }[];
539
+ conflict: {
540
+ policy: "best_discount_wins" | "stackable_compose";
541
+ autoAppliedOfferIds: string[];
542
+ manualOfferId: string | null;
543
+ selectedOfferIds: string[];
544
+ message: string;
545
+ } | null;
546
+ } | null;
547
+ })[];
548
+ applied: {
549
+ offerId: string;
550
+ offerName: string;
551
+ discountAppliedCents: number;
552
+ discountedPriceCents: number;
553
+ currency: string;
554
+ discountKind: "percentage" | "fixed_amount";
555
+ discountPercent: number | null;
556
+ discountAmountCents: number | null;
557
+ appliedCode: string | null;
558
+ stackable: boolean;
559
+ }[];
560
+ conflict: {
561
+ policy: "best_discount_wins" | "stackable_compose";
562
+ autoAppliedOfferIds: string[];
563
+ manualOfferId: string | null;
564
+ selectedOfferIds: string[];
565
+ message: string;
566
+ } | {
567
+ policy: string;
568
+ autoAppliedOfferIds: string[];
569
+ manualOfferId: null;
570
+ selectedOfferIds: string[];
571
+ message: string;
572
+ } | null;
573
+ discountTotal: number;
574
+ discountTotalCents: number;
575
+ totalAfterDiscount: number;
576
+ currencyCode: string;
577
+ };
578
+ totals: {
579
+ currencyCode: string;
580
+ base: number;
581
+ extras: number;
582
+ subtotal: number;
583
+ discount: number;
584
+ tax: number;
585
+ total: number;
586
+ perPerson: number;
587
+ perBooking: number;
588
+ };
209
589
  } | null>;
210
590
  getProductExtensions(db: PostgresJsDatabase, productId: string, optionId?: string): Promise<{
211
591
  extensions: {
@@ -253,7 +633,7 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
253
633
  }>;
254
634
  getProductAvailabilitySummary(db: PostgresJsDatabase, productId: string, query: StorefrontProductAvailabilitySummaryQuery): Promise<{
255
635
  productId: string;
256
- availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "unavailable" | "on_request" | "available";
636
+ availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "on_request" | "unavailable" | "available";
257
637
  counts: {
258
638
  total: number;
259
639
  open: number;
@@ -274,7 +654,7 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
274
654
  endAt: string | null;
275
655
  timezone: string;
276
656
  status: "cancelled" | "open" | "closed" | "sold_out" | "on_request";
277
- availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "unavailable" | "on_request" | "available";
657
+ availabilityState: "cancelled" | "closed" | "sold_out" | "past_cutoff" | "too_early" | "on_request" | "unavailable" | "available";
278
658
  capacity: number | null;
279
659
  remaining: number | null;
280
660
  pastCutoff: boolean;
@@ -310,6 +690,221 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
310
690
  body: StorefrontTransportEligibilityInput;
311
691
  context?: StorefrontRequestContext;
312
692
  }): Promise<StorefrontTransportEligibilityResult>;
693
+ bootstrapBookingSession(context: StorefrontRequestContext & {
694
+ db: PostgresJsDatabase;
695
+ }, input: StorefrontBookingSessionBootstrapInput, userId?: string): Promise<{
696
+ status: Exclude<string, "ok">;
697
+ } | {
698
+ status: "stale_quote";
699
+ repricing: {
700
+ originalQuote: {
701
+ currencyCode: string;
702
+ totalSellAmountCents: number;
703
+ quotedAt?: string | null | undefined;
704
+ expiresAt?: string | null | undefined;
705
+ };
706
+ current: {
707
+ sessionId: string;
708
+ catalogId: string | null;
709
+ currencyCode: string;
710
+ totalSellAmountCents: number;
711
+ items: {
712
+ inputIndex: number;
713
+ itemId: string;
714
+ title: string;
715
+ productId: string | null;
716
+ optionId: string | null;
717
+ optionUnitId: string | null;
718
+ optionUnitName: string | null;
719
+ optionUnitType: string | null;
720
+ pricingCategoryId: string | null;
721
+ quantity: number;
722
+ pricingMode: string;
723
+ unitSellAmountCents: number | null;
724
+ totalSellAmountCents: number | null;
725
+ warnings: string[];
726
+ }[];
727
+ warnings: never[];
728
+ appliedToSession: boolean;
729
+ };
730
+ deltaAmountCents: number;
731
+ staleQuote: boolean;
732
+ };
733
+ bootstrap?: undefined;
734
+ } | {
735
+ status: "ok";
736
+ bootstrap: {
737
+ session: {
738
+ sessionId: string;
739
+ bookingNumber: string;
740
+ status: "completed" | "cancelled" | "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "expired";
741
+ externalBookingRef: string | null;
742
+ communicationLanguage: string | null;
743
+ sellCurrency: string;
744
+ sellAmountCents: number | null;
745
+ startDate: string | null;
746
+ endDate: string | null;
747
+ pax: number | null;
748
+ holdExpiresAt: string | null;
749
+ confirmedAt: string | null;
750
+ expiredAt: string | null;
751
+ cancelledAt: string | null;
752
+ completedAt: string | null;
753
+ travelers: {
754
+ id: string;
755
+ participantType: "other" | "traveler" | "occupant";
756
+ travelerCategory: "child" | "other" | "adult" | "infant" | "senior" | null;
757
+ firstName: string;
758
+ lastName: string;
759
+ email: string | null;
760
+ phone: string | null;
761
+ preferredLanguage: string | null;
762
+ specialRequests: string | null;
763
+ isPrimary: boolean;
764
+ notes: string | null;
765
+ }[];
766
+ items: {
767
+ id: string;
768
+ title: string;
769
+ description: string | null;
770
+ itemType: "service" | "other" | "unit" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
771
+ status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
772
+ serviceDate: string | null;
773
+ startsAt: string | null;
774
+ endsAt: string | null;
775
+ quantity: number;
776
+ sellCurrency: string;
777
+ unitSellAmountCents: number | null;
778
+ totalSellAmountCents: number | null;
779
+ costCurrency: string | null;
780
+ unitCostAmountCents: number | null;
781
+ totalCostAmountCents: number | null;
782
+ notes: string | null;
783
+ productId: string | null;
784
+ optionId: string | null;
785
+ optionUnitId: string | null;
786
+ pricingCategoryId: string | null;
787
+ travelerLinks: {
788
+ id: string;
789
+ travelerId: string;
790
+ role: string;
791
+ isPrimary: boolean;
792
+ }[];
793
+ }[];
794
+ allocations: {
795
+ id: string;
796
+ bookingItemId: string;
797
+ productId: string | null;
798
+ optionId: string | null;
799
+ optionUnitId: string | null;
800
+ pricingCategoryId: string | null;
801
+ availabilitySlotId: string | null;
802
+ quantity: number;
803
+ allocationType: "resource" | "pickup" | "unit";
804
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
805
+ holdExpiresAt: string | null;
806
+ confirmedAt: string | null;
807
+ releasedAt: string | null;
808
+ }[];
809
+ checklist: {
810
+ hasTravelers: boolean;
811
+ hasPrimaryTraveler: boolean;
812
+ hasItems: boolean;
813
+ hasAllocations: boolean;
814
+ readyForConfirmation: boolean;
815
+ };
816
+ state: {
817
+ sessionId: string;
818
+ stateKey: "wizard";
819
+ currentStep: string | null;
820
+ completedSteps: string[];
821
+ payload: Record<string, unknown>;
822
+ version: number;
823
+ createdAt: string;
824
+ updatedAt: string;
825
+ } | null;
826
+ };
827
+ paymentPlan: {
828
+ source: "storefront_default";
829
+ depositKind: import("@voyantjs/finance").DepositKind;
830
+ depositPercent: number | null;
831
+ depositAmountCents: number | null;
832
+ requiresFullPayment: boolean;
833
+ };
834
+ paymentSchedule: {
835
+ id: string;
836
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
837
+ status: "pending" | "cancelled" | "expired" | "paid" | "due" | "waived";
838
+ dueDate: string;
839
+ currency: string;
840
+ amountCents: number;
841
+ notes: string | null;
842
+ }[];
843
+ repricing: {
844
+ originalQuote: {
845
+ currencyCode: string;
846
+ totalSellAmountCents: number;
847
+ quotedAt?: string | null | undefined;
848
+ expiresAt?: string | null | undefined;
849
+ };
850
+ current: {
851
+ sessionId: string;
852
+ items: {
853
+ itemId: string;
854
+ title: string;
855
+ productId: string | null;
856
+ optionId: string | null;
857
+ optionUnitId: string | null;
858
+ optionUnitName: string | null;
859
+ optionUnitType: string | null;
860
+ pricingCategoryId: string | null;
861
+ quantity: number;
862
+ pricingMode: string;
863
+ unitSellAmountCents: number | null;
864
+ totalSellAmountCents: number | null;
865
+ warnings: string[];
866
+ }[];
867
+ catalogId: string | null;
868
+ currencyCode: string;
869
+ totalSellAmountCents: number;
870
+ warnings: never[];
871
+ appliedToSession: boolean;
872
+ };
873
+ deltaAmountCents: number;
874
+ staleQuote: boolean;
875
+ };
876
+ availability: {
877
+ departureId: string;
878
+ slotId: string;
879
+ productId: string;
880
+ optionId: string | null;
881
+ dateLocal: string;
882
+ startsAt: string | null;
883
+ endsAt: string | null;
884
+ timezone: string;
885
+ status: "cancelled" | "open" | "closed" | "sold_out";
886
+ capacity: number | null;
887
+ remaining: number | null;
888
+ };
889
+ allocation: {
890
+ id: string;
891
+ bookingItemId: string;
892
+ productId: string | null;
893
+ optionId: string | null;
894
+ optionUnitId: string | null;
895
+ pricingCategoryId: string | null;
896
+ availabilitySlotId: string | null;
897
+ quantity: number;
898
+ allocationType: "resource" | "pickup" | "unit";
899
+ status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
900
+ holdExpiresAt: string | null;
901
+ confirmedAt: string | null;
902
+ releasedAt: string | null;
903
+ }[];
904
+ currency: string;
905
+ };
906
+ repricing?: undefined;
907
+ }>;
313
908
  listApplicableOffers(input: {
314
909
  productId: string;
315
910
  departureId?: string;
@@ -330,5 +925,38 @@ export declare function createStorefrontService(options?: StorefrontServiceOptio
330
925
  body: StorefrontOfferRedeemInput;
331
926
  context?: StorefrontRequestContext;
332
927
  }): Promise<StorefrontOfferMutationResult | null>;
928
+ checkIntakeGuard: (input: {
929
+ kind: "lead";
930
+ body: StorefrontLeadIntakeInput;
931
+ context: StorefrontRequestContext;
932
+ } | {
933
+ kind: "newsletter";
934
+ body: StorefrontNewsletterSubscribeInput;
935
+ context: StorefrontRequestContext;
936
+ }) => Promise<import("./service-intake.js").StorefrontIntakeGuardDecision | undefined>;
937
+ createLead(input: {
938
+ body: StorefrontLeadIntakeInput;
939
+ context: StorefrontRequestContext;
940
+ }): Promise<{
941
+ id: string;
942
+ personId: string;
943
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
944
+ source: "admin" | "form" | "phone" | "booking" | "website" | "abandoned_cart";
945
+ status: "expired" | "converted" | "lost" | "new" | "contacted" | "qualified";
946
+ duplicate: boolean;
947
+ }>;
948
+ subscribeNewsletter(input: {
949
+ body: StorefrontNewsletterSubscribeInput;
950
+ context: StorefrontRequestContext;
951
+ }): Promise<{
952
+ id: string;
953
+ personId: string;
954
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
955
+ source: "admin" | "form" | "phone" | "booking" | "website" | "abandoned_cart";
956
+ status: "expired" | "converted" | "lost" | "new" | "contacted" | "qualified";
957
+ duplicate: boolean;
958
+ doubleOptIn: "requested" | "not_configured";
959
+ }>;
333
960
  };
961
+ export type { StorefrontIntakeGuard, StorefrontIntakeOptions };
334
962
  //# sourceMappingURL=service.d.ts.map