@voyant-travel/storefront 0.120.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/LICENSE +201 -0
- package/README.md +231 -0
- package/dist/booking-intents.d.ts +42 -0
- package/dist/booking-intents.d.ts.map +1 -0
- package/dist/booking-intents.js +83 -0
- package/dist/customer-portal/index.d.ts +16 -0
- package/dist/customer-portal/index.d.ts.map +1 -0
- package/dist/customer-portal/index.js +23 -0
- package/dist/customer-portal/route-runtime.d.ts +16 -0
- package/dist/customer-portal/route-runtime.d.ts.map +1 -0
- package/dist/customer-portal/route-runtime.js +27 -0
- package/dist/customer-portal/routes-public.d.ts +1936 -0
- package/dist/customer-portal/routes-public.d.ts.map +1 -0
- package/dist/customer-portal/routes-public.js +165 -0
- package/dist/customer-portal/routes.d.ts +43 -0
- package/dist/customer-portal/routes.d.ts.map +1 -0
- package/dist/customer-portal/routes.js +17 -0
- package/dist/customer-portal/service-public-impl.d.ts +138 -0
- package/dist/customer-portal/service-public-impl.d.ts.map +1 -0
- package/dist/customer-portal/service-public-impl.js +1808 -0
- package/dist/customer-portal/service-public.d.ts +2 -0
- package/dist/customer-portal/service-public.d.ts.map +1 -0
- package/dist/customer-portal/service-public.js +1 -0
- package/dist/customer-portal/validation-public/bookings.d.ts +551 -0
- package/dist/customer-portal/validation-public/bookings.d.ts.map +1 -0
- package/dist/customer-portal/validation-public/bookings.js +132 -0
- package/dist/customer-portal/validation-public/common.d.ts +162 -0
- package/dist/customer-portal/validation-public/common.d.ts.map +1 -0
- package/dist/customer-portal/validation-public/common.js +139 -0
- package/dist/customer-portal/validation-public/profile.d.ts +749 -0
- package/dist/customer-portal/validation-public/profile.d.ts.map +1 -0
- package/dist/customer-portal/validation-public/profile.js +308 -0
- package/dist/customer-portal/validation-public.d.ts +3 -0
- package/dist/customer-portal/validation-public.d.ts.map +1 -0
- package/dist/customer-portal/validation-public.js +2 -0
- package/dist/guest-booking-guard.d.ts +24 -0
- package/dist/guest-booking-guard.d.ts.map +1 -0
- package/dist/guest-booking-guard.js +55 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/product-extra-ref.d.ts +238 -0
- package/dist/product-extra-ref.d.ts.map +1 -0
- package/dist/product-extra-ref.js +22 -0
- package/dist/routes-admin.d.ts +220 -0
- package/dist/routes-admin.d.ts.map +1 -0
- package/dist/routes-admin.js +28 -0
- package/dist/routes-public.d.ts +1475 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +362 -0
- package/dist/service-booking-session-bootstrap.d.ts +227 -0
- package/dist/service-booking-session-bootstrap.d.ts.map +1 -0
- package/dist/service-booking-session-bootstrap.js +287 -0
- package/dist/service-boundary-resource-sql.d.ts +18 -0
- package/dist/service-boundary-resource-sql.d.ts.map +1 -0
- package/dist/service-boundary-resource-sql.js +73 -0
- package/dist/service-boundary-sql.d.ts +103 -0
- package/dist/service-boundary-sql.d.ts.map +1 -0
- package/dist/service-boundary-sql.js +307 -0
- package/dist/service-departures-core.d.ts +41 -0
- package/dist/service-departures-core.d.ts.map +1 -0
- package/dist/service-departures-core.js +92 -0
- package/dist/service-departures-extensions.d.ts +46 -0
- package/dist/service-departures-extensions.d.ts.map +1 -0
- package/dist/service-departures-extensions.js +81 -0
- package/dist/service-departures-offers.d.ts +220 -0
- package/dist/service-departures-offers.d.ts.map +1 -0
- package/dist/service-departures-offers.js +177 -0
- package/dist/service-departures-price-preview.d.ts +306 -0
- package/dist/service-departures-price-preview.d.ts.map +1 -0
- package/dist/service-departures-price-preview.js +383 -0
- package/dist/service-departures-pricing-context.d.ts +115 -0
- package/dist/service-departures-pricing-context.d.ts.map +1 -0
- package/dist/service-departures-pricing-context.js +237 -0
- package/dist/service-departures-pricing.d.ts +5 -0
- package/dist/service-departures-pricing.d.ts.map +1 -0
- package/dist/service-departures-pricing.js +4 -0
- package/dist/service-departures.d.ts +192 -0
- package/dist/service-departures.d.ts.map +1 -0
- package/dist/service-departures.js +213 -0
- package/dist/service-intake.d.ts +130 -0
- package/dist/service-intake.d.ts.map +1 -0
- package/dist/service-intake.js +274 -0
- package/dist/service-transport-eligibility.d.ts +10 -0
- package/dist/service-transport-eligibility.d.ts.map +1 -0
- package/dist/service-transport-eligibility.js +198 -0
- package/dist/service.d.ts +1062 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +332 -0
- package/dist/transport-eligibility.d.ts +4 -0
- package/dist/transport-eligibility.d.ts.map +1 -0
- package/dist/transport-eligibility.js +2 -0
- package/dist/validation/departures.d.ts +1669 -0
- package/dist/validation/departures.d.ts.map +1 -0
- package/dist/validation/departures.js +397 -0
- package/dist/validation/intake.d.ts +147 -0
- package/dist/validation/intake.d.ts.map +1 -0
- package/dist/validation/intake.js +69 -0
- package/dist/validation/offers.d.ts +340 -0
- package/dist/validation/offers.d.ts.map +1 -0
- package/dist/validation/offers.js +117 -0
- package/dist/validation-settings.d.ts +609 -0
- package/dist/validation-settings.d.ts.map +1 -0
- package/dist/validation-settings.js +235 -0
- package/dist/validation-transport-eligibility.d.ts +314 -0
- package/dist/validation-transport-eligibility.d.ts.map +1 -0
- package/dist/validation-transport-eligibility.js +97 -0
- package/dist/validation.d.ts +6 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +4 -0
- package/dist/verification/index.d.ts +12 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +18 -0
- package/dist/verification/routes-public.d.ts +121 -0
- package/dist/verification/routes-public.d.ts.map +1 -0
- package/dist/verification/routes-public.js +125 -0
- package/dist/verification/schema.d.ts +273 -0
- package/dist/verification/schema.d.ts.map +1 -0
- package/dist/verification/schema.js +50 -0
- package/dist/verification/service.d.ts +114 -0
- package/dist/verification/service.d.ts.map +1 -0
- package/dist/verification/service.js +283 -0
- package/dist/verification/validation.d.ts +98 -0
- package/dist/verification/validation.d.ts.map +1 -0
- package/dist/verification/validation.js +54 -0
- package/package.json +148 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const storefrontPromotionalOfferSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
6
|
+
description: z.ZodNullable<z.ZodString>;
|
|
7
|
+
discountType: z.ZodEnum<{
|
|
8
|
+
percentage: "percentage";
|
|
9
|
+
fixed_amount: "fixed_amount";
|
|
10
|
+
}>;
|
|
11
|
+
discountValue: z.ZodString;
|
|
12
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
13
|
+
applicableProductIds: z.ZodArray<z.ZodString>;
|
|
14
|
+
applicableDepartureIds: z.ZodArray<z.ZodString>;
|
|
15
|
+
validFrom: z.ZodNullable<z.ZodString>;
|
|
16
|
+
validTo: z.ZodNullable<z.ZodString>;
|
|
17
|
+
minTravelers: z.ZodNullable<z.ZodNumber>;
|
|
18
|
+
imageMobileUrl: z.ZodNullable<z.ZodString>;
|
|
19
|
+
imageDesktopUrl: z.ZodNullable<z.ZodString>;
|
|
20
|
+
stackable: z.ZodBoolean;
|
|
21
|
+
createdAt: z.ZodString;
|
|
22
|
+
updatedAt: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const storefrontPromotionalOfferListQuerySchema: z.ZodObject<{
|
|
25
|
+
departureId: z.ZodOptional<z.ZodString>;
|
|
26
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const storefrontPromotionalOfferListResponseSchema: z.ZodObject<{
|
|
29
|
+
data: z.ZodArray<z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
33
|
+
description: z.ZodNullable<z.ZodString>;
|
|
34
|
+
discountType: z.ZodEnum<{
|
|
35
|
+
percentage: "percentage";
|
|
36
|
+
fixed_amount: "fixed_amount";
|
|
37
|
+
}>;
|
|
38
|
+
discountValue: z.ZodString;
|
|
39
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
40
|
+
applicableProductIds: z.ZodArray<z.ZodString>;
|
|
41
|
+
applicableDepartureIds: z.ZodArray<z.ZodString>;
|
|
42
|
+
validFrom: z.ZodNullable<z.ZodString>;
|
|
43
|
+
validTo: z.ZodNullable<z.ZodString>;
|
|
44
|
+
minTravelers: z.ZodNullable<z.ZodNumber>;
|
|
45
|
+
imageMobileUrl: z.ZodNullable<z.ZodString>;
|
|
46
|
+
imageDesktopUrl: z.ZodNullable<z.ZodString>;
|
|
47
|
+
stackable: z.ZodBoolean;
|
|
48
|
+
createdAt: z.ZodString;
|
|
49
|
+
updatedAt: z.ZodString;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export declare const storefrontPromotionalOfferResponseSchema: z.ZodObject<{
|
|
53
|
+
data: z.ZodObject<{
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
57
|
+
description: z.ZodNullable<z.ZodString>;
|
|
58
|
+
discountType: z.ZodEnum<{
|
|
59
|
+
percentage: "percentage";
|
|
60
|
+
fixed_amount: "fixed_amount";
|
|
61
|
+
}>;
|
|
62
|
+
discountValue: z.ZodString;
|
|
63
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
64
|
+
applicableProductIds: z.ZodArray<z.ZodString>;
|
|
65
|
+
applicableDepartureIds: z.ZodArray<z.ZodString>;
|
|
66
|
+
validFrom: z.ZodNullable<z.ZodString>;
|
|
67
|
+
validTo: z.ZodNullable<z.ZodString>;
|
|
68
|
+
minTravelers: z.ZodNullable<z.ZodNumber>;
|
|
69
|
+
imageMobileUrl: z.ZodNullable<z.ZodString>;
|
|
70
|
+
imageDesktopUrl: z.ZodNullable<z.ZodString>;
|
|
71
|
+
stackable: z.ZodBoolean;
|
|
72
|
+
createdAt: z.ZodString;
|
|
73
|
+
updatedAt: z.ZodString;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const storefrontOfferAudienceSchema: z.ZodEnum<{
|
|
77
|
+
staff: "staff";
|
|
78
|
+
customer: "customer";
|
|
79
|
+
partner: "partner";
|
|
80
|
+
supplier: "supplier";
|
|
81
|
+
}>;
|
|
82
|
+
export declare const storefrontOfferApplyInputSchema: z.ZodObject<{
|
|
83
|
+
productId: z.ZodString;
|
|
84
|
+
departureId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
85
|
+
bookingId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
86
|
+
sessionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
87
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
88
|
+
pax: z.ZodCoercedNumber<unknown>;
|
|
89
|
+
audience: z.ZodDefault<z.ZodEnum<{
|
|
90
|
+
staff: "staff";
|
|
91
|
+
customer: "customer";
|
|
92
|
+
partner: "partner";
|
|
93
|
+
supplier: "supplier";
|
|
94
|
+
}>>;
|
|
95
|
+
market: z.ZodDefault<z.ZodString>;
|
|
96
|
+
basePriceCents: z.ZodCoercedNumber<unknown>;
|
|
97
|
+
currency: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export declare const storefrontOfferRedeemInputSchema: z.ZodObject<{
|
|
100
|
+
productId: z.ZodString;
|
|
101
|
+
departureId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
102
|
+
bookingId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
103
|
+
sessionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
104
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
105
|
+
pax: z.ZodCoercedNumber<unknown>;
|
|
106
|
+
audience: z.ZodDefault<z.ZodEnum<{
|
|
107
|
+
staff: "staff";
|
|
108
|
+
customer: "customer";
|
|
109
|
+
partner: "partner";
|
|
110
|
+
supplier: "supplier";
|
|
111
|
+
}>>;
|
|
112
|
+
market: z.ZodDefault<z.ZodString>;
|
|
113
|
+
basePriceCents: z.ZodCoercedNumber<unknown>;
|
|
114
|
+
currency: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
115
|
+
code: z.ZodString;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
export declare const storefrontAppliedOfferSchema: z.ZodObject<{
|
|
118
|
+
offerId: z.ZodString;
|
|
119
|
+
offerName: z.ZodString;
|
|
120
|
+
discountAppliedCents: z.ZodNumber;
|
|
121
|
+
discountedPriceCents: z.ZodNumber;
|
|
122
|
+
currency: z.ZodString;
|
|
123
|
+
discountKind: z.ZodEnum<{
|
|
124
|
+
percentage: "percentage";
|
|
125
|
+
fixed_amount: "fixed_amount";
|
|
126
|
+
}>;
|
|
127
|
+
discountPercent: z.ZodNullable<z.ZodNumber>;
|
|
128
|
+
discountAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
129
|
+
appliedCode: z.ZodNullable<z.ZodString>;
|
|
130
|
+
stackable: z.ZodBoolean;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
export declare const storefrontOfferMutationStatusSchema: z.ZodEnum<{
|
|
133
|
+
applied: "applied";
|
|
134
|
+
not_applicable: "not_applicable";
|
|
135
|
+
invalid: "invalid";
|
|
136
|
+
conflict: "conflict";
|
|
137
|
+
}>;
|
|
138
|
+
export declare const storefrontOfferMutationReasonSchema: z.ZodNullable<z.ZodEnum<{
|
|
139
|
+
currency: "currency";
|
|
140
|
+
scope: "scope";
|
|
141
|
+
booking_mismatch: "booking_mismatch";
|
|
142
|
+
conflict: "conflict";
|
|
143
|
+
offer_not_found: "offer_not_found";
|
|
144
|
+
offer_expired: "offer_expired";
|
|
145
|
+
offer_not_yet_valid: "offer_not_yet_valid";
|
|
146
|
+
code_not_found: "code_not_found";
|
|
147
|
+
code_required: "code_required";
|
|
148
|
+
code_expired: "code_expired";
|
|
149
|
+
code_not_yet_valid: "code_not_yet_valid";
|
|
150
|
+
min_pax: "min_pax";
|
|
151
|
+
eligibility: "eligibility";
|
|
152
|
+
no_discount: "no_discount";
|
|
153
|
+
session_mismatch: "session_mismatch";
|
|
154
|
+
}>>;
|
|
155
|
+
export declare const storefrontOfferConflictSchema: z.ZodObject<{
|
|
156
|
+
policy: z.ZodEnum<{
|
|
157
|
+
best_discount_wins: "best_discount_wins";
|
|
158
|
+
stackable_compose: "stackable_compose";
|
|
159
|
+
}>;
|
|
160
|
+
autoAppliedOfferIds: z.ZodArray<z.ZodString>;
|
|
161
|
+
manualOfferId: z.ZodNullable<z.ZodString>;
|
|
162
|
+
selectedOfferIds: z.ZodArray<z.ZodString>;
|
|
163
|
+
message: z.ZodString;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
export declare const storefrontOfferMutationResultSchema: z.ZodObject<{
|
|
166
|
+
status: z.ZodEnum<{
|
|
167
|
+
applied: "applied";
|
|
168
|
+
not_applicable: "not_applicable";
|
|
169
|
+
invalid: "invalid";
|
|
170
|
+
conflict: "conflict";
|
|
171
|
+
}>;
|
|
172
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
173
|
+
currency: "currency";
|
|
174
|
+
scope: "scope";
|
|
175
|
+
booking_mismatch: "booking_mismatch";
|
|
176
|
+
conflict: "conflict";
|
|
177
|
+
offer_not_found: "offer_not_found";
|
|
178
|
+
offer_expired: "offer_expired";
|
|
179
|
+
offer_not_yet_valid: "offer_not_yet_valid";
|
|
180
|
+
code_not_found: "code_not_found";
|
|
181
|
+
code_required: "code_required";
|
|
182
|
+
code_expired: "code_expired";
|
|
183
|
+
code_not_yet_valid: "code_not_yet_valid";
|
|
184
|
+
min_pax: "min_pax";
|
|
185
|
+
eligibility: "eligibility";
|
|
186
|
+
no_discount: "no_discount";
|
|
187
|
+
session_mismatch: "session_mismatch";
|
|
188
|
+
}>>;
|
|
189
|
+
offer: z.ZodNullable<z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
name: z.ZodString;
|
|
192
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
193
|
+
description: z.ZodNullable<z.ZodString>;
|
|
194
|
+
discountType: z.ZodEnum<{
|
|
195
|
+
percentage: "percentage";
|
|
196
|
+
fixed_amount: "fixed_amount";
|
|
197
|
+
}>;
|
|
198
|
+
discountValue: z.ZodString;
|
|
199
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
200
|
+
applicableProductIds: z.ZodArray<z.ZodString>;
|
|
201
|
+
applicableDepartureIds: z.ZodArray<z.ZodString>;
|
|
202
|
+
validFrom: z.ZodNullable<z.ZodString>;
|
|
203
|
+
validTo: z.ZodNullable<z.ZodString>;
|
|
204
|
+
minTravelers: z.ZodNullable<z.ZodNumber>;
|
|
205
|
+
imageMobileUrl: z.ZodNullable<z.ZodString>;
|
|
206
|
+
imageDesktopUrl: z.ZodNullable<z.ZodString>;
|
|
207
|
+
stackable: z.ZodBoolean;
|
|
208
|
+
createdAt: z.ZodString;
|
|
209
|
+
updatedAt: z.ZodString;
|
|
210
|
+
}, z.core.$strip>>;
|
|
211
|
+
target: z.ZodObject<{
|
|
212
|
+
bookingId: z.ZodNullable<z.ZodString>;
|
|
213
|
+
sessionId: z.ZodNullable<z.ZodString>;
|
|
214
|
+
productId: z.ZodString;
|
|
215
|
+
departureId: z.ZodNullable<z.ZodString>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
pricing: z.ZodObject<{
|
|
218
|
+
basePriceCents: z.ZodNumber;
|
|
219
|
+
currency: z.ZodString;
|
|
220
|
+
discountAppliedCents: z.ZodNumber;
|
|
221
|
+
discountedPriceCents: z.ZodNumber;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
appliedOffers: z.ZodArray<z.ZodObject<{
|
|
224
|
+
offerId: z.ZodString;
|
|
225
|
+
offerName: z.ZodString;
|
|
226
|
+
discountAppliedCents: z.ZodNumber;
|
|
227
|
+
discountedPriceCents: z.ZodNumber;
|
|
228
|
+
currency: z.ZodString;
|
|
229
|
+
discountKind: z.ZodEnum<{
|
|
230
|
+
percentage: "percentage";
|
|
231
|
+
fixed_amount: "fixed_amount";
|
|
232
|
+
}>;
|
|
233
|
+
discountPercent: z.ZodNullable<z.ZodNumber>;
|
|
234
|
+
discountAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
235
|
+
appliedCode: z.ZodNullable<z.ZodString>;
|
|
236
|
+
stackable: z.ZodBoolean;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
conflict: z.ZodNullable<z.ZodObject<{
|
|
239
|
+
policy: z.ZodEnum<{
|
|
240
|
+
best_discount_wins: "best_discount_wins";
|
|
241
|
+
stackable_compose: "stackable_compose";
|
|
242
|
+
}>;
|
|
243
|
+
autoAppliedOfferIds: z.ZodArray<z.ZodString>;
|
|
244
|
+
manualOfferId: z.ZodNullable<z.ZodString>;
|
|
245
|
+
selectedOfferIds: z.ZodArray<z.ZodString>;
|
|
246
|
+
message: z.ZodString;
|
|
247
|
+
}, z.core.$strip>>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
export declare const storefrontOfferMutationResponseSchema: z.ZodObject<{
|
|
250
|
+
data: z.ZodObject<{
|
|
251
|
+
status: z.ZodEnum<{
|
|
252
|
+
applied: "applied";
|
|
253
|
+
not_applicable: "not_applicable";
|
|
254
|
+
invalid: "invalid";
|
|
255
|
+
conflict: "conflict";
|
|
256
|
+
}>;
|
|
257
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
258
|
+
currency: "currency";
|
|
259
|
+
scope: "scope";
|
|
260
|
+
booking_mismatch: "booking_mismatch";
|
|
261
|
+
conflict: "conflict";
|
|
262
|
+
offer_not_found: "offer_not_found";
|
|
263
|
+
offer_expired: "offer_expired";
|
|
264
|
+
offer_not_yet_valid: "offer_not_yet_valid";
|
|
265
|
+
code_not_found: "code_not_found";
|
|
266
|
+
code_required: "code_required";
|
|
267
|
+
code_expired: "code_expired";
|
|
268
|
+
code_not_yet_valid: "code_not_yet_valid";
|
|
269
|
+
min_pax: "min_pax";
|
|
270
|
+
eligibility: "eligibility";
|
|
271
|
+
no_discount: "no_discount";
|
|
272
|
+
session_mismatch: "session_mismatch";
|
|
273
|
+
}>>;
|
|
274
|
+
offer: z.ZodNullable<z.ZodObject<{
|
|
275
|
+
id: z.ZodString;
|
|
276
|
+
name: z.ZodString;
|
|
277
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
278
|
+
description: z.ZodNullable<z.ZodString>;
|
|
279
|
+
discountType: z.ZodEnum<{
|
|
280
|
+
percentage: "percentage";
|
|
281
|
+
fixed_amount: "fixed_amount";
|
|
282
|
+
}>;
|
|
283
|
+
discountValue: z.ZodString;
|
|
284
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
285
|
+
applicableProductIds: z.ZodArray<z.ZodString>;
|
|
286
|
+
applicableDepartureIds: z.ZodArray<z.ZodString>;
|
|
287
|
+
validFrom: z.ZodNullable<z.ZodString>;
|
|
288
|
+
validTo: z.ZodNullable<z.ZodString>;
|
|
289
|
+
minTravelers: z.ZodNullable<z.ZodNumber>;
|
|
290
|
+
imageMobileUrl: z.ZodNullable<z.ZodString>;
|
|
291
|
+
imageDesktopUrl: z.ZodNullable<z.ZodString>;
|
|
292
|
+
stackable: z.ZodBoolean;
|
|
293
|
+
createdAt: z.ZodString;
|
|
294
|
+
updatedAt: z.ZodString;
|
|
295
|
+
}, z.core.$strip>>;
|
|
296
|
+
target: z.ZodObject<{
|
|
297
|
+
bookingId: z.ZodNullable<z.ZodString>;
|
|
298
|
+
sessionId: z.ZodNullable<z.ZodString>;
|
|
299
|
+
productId: z.ZodString;
|
|
300
|
+
departureId: z.ZodNullable<z.ZodString>;
|
|
301
|
+
}, z.core.$strip>;
|
|
302
|
+
pricing: z.ZodObject<{
|
|
303
|
+
basePriceCents: z.ZodNumber;
|
|
304
|
+
currency: z.ZodString;
|
|
305
|
+
discountAppliedCents: z.ZodNumber;
|
|
306
|
+
discountedPriceCents: z.ZodNumber;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
appliedOffers: z.ZodArray<z.ZodObject<{
|
|
309
|
+
offerId: z.ZodString;
|
|
310
|
+
offerName: z.ZodString;
|
|
311
|
+
discountAppliedCents: z.ZodNumber;
|
|
312
|
+
discountedPriceCents: z.ZodNumber;
|
|
313
|
+
currency: z.ZodString;
|
|
314
|
+
discountKind: z.ZodEnum<{
|
|
315
|
+
percentage: "percentage";
|
|
316
|
+
fixed_amount: "fixed_amount";
|
|
317
|
+
}>;
|
|
318
|
+
discountPercent: z.ZodNullable<z.ZodNumber>;
|
|
319
|
+
discountAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
320
|
+
appliedCode: z.ZodNullable<z.ZodString>;
|
|
321
|
+
stackable: z.ZodBoolean;
|
|
322
|
+
}, z.core.$strip>>;
|
|
323
|
+
conflict: z.ZodNullable<z.ZodObject<{
|
|
324
|
+
policy: z.ZodEnum<{
|
|
325
|
+
best_discount_wins: "best_discount_wins";
|
|
326
|
+
stackable_compose: "stackable_compose";
|
|
327
|
+
}>;
|
|
328
|
+
autoAppliedOfferIds: z.ZodArray<z.ZodString>;
|
|
329
|
+
manualOfferId: z.ZodNullable<z.ZodString>;
|
|
330
|
+
selectedOfferIds: z.ZodArray<z.ZodString>;
|
|
331
|
+
message: z.ZodString;
|
|
332
|
+
}, z.core.$strip>>;
|
|
333
|
+
}, z.core.$strip>;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
export type StorefrontPromotionalOffer = z.infer<typeof storefrontPromotionalOfferSchema>;
|
|
336
|
+
export type StorefrontOfferApplyInput = z.infer<typeof storefrontOfferApplyInputSchema>;
|
|
337
|
+
export type StorefrontOfferRedeemInput = z.infer<typeof storefrontOfferRedeemInputSchema>;
|
|
338
|
+
export type StorefrontAppliedOffer = z.infer<typeof storefrontAppliedOfferSchema>;
|
|
339
|
+
export type StorefrontOfferMutationResult = z.infer<typeof storefrontOfferMutationResultSchema>;
|
|
340
|
+
//# sourceMappingURL=offers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["../../src/validation/offers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;iBAkB3C,CAAA;AAEF,eAAO,MAAM,yCAAyC;;;iBAGpD,CAAA;AAEF,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;iBAEvD,CAAA;AAEF,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;iBAEnD,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;EAAuD,CAAA;AAmBjG,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;iBAAmC,CAAA;AAE/E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;iBAE3C,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;iBAWvC,CAAA;AAEF,eAAO,MAAM,mCAAmC;;;;;EAK9C,CAAA;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;GAkBnC,CAAA;AAEb,eAAO,MAAM,6BAA6B;;;;;;;;;iBAMxC,CAAA;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkB9C,CAAA;AAEF,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEhD,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AACzF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AACvF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AACzF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACjF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAA"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const storefrontPromotionalOfferSchema = z.object({
|
|
3
|
+
id: z.string(),
|
|
4
|
+
name: z.string(),
|
|
5
|
+
slug: z.string().nullable(),
|
|
6
|
+
description: z.string().nullable(),
|
|
7
|
+
discountType: z.enum(["percentage", "fixed_amount"]),
|
|
8
|
+
discountValue: z.string(),
|
|
9
|
+
currency: z.string().nullable(),
|
|
10
|
+
applicableProductIds: z.array(z.string()),
|
|
11
|
+
applicableDepartureIds: z.array(z.string()),
|
|
12
|
+
validFrom: z.string().nullable(),
|
|
13
|
+
validTo: z.string().nullable(),
|
|
14
|
+
minTravelers: z.number().int().nullable(),
|
|
15
|
+
imageMobileUrl: z.string().nullable(),
|
|
16
|
+
imageDesktopUrl: z.string().nullable(),
|
|
17
|
+
stackable: z.boolean(),
|
|
18
|
+
createdAt: z.string(),
|
|
19
|
+
updatedAt: z.string(),
|
|
20
|
+
});
|
|
21
|
+
export const storefrontPromotionalOfferListQuerySchema = z.object({
|
|
22
|
+
departureId: z.string().optional(),
|
|
23
|
+
locale: z.string().trim().min(2).optional(),
|
|
24
|
+
});
|
|
25
|
+
export const storefrontPromotionalOfferListResponseSchema = z.object({
|
|
26
|
+
data: z.array(storefrontPromotionalOfferSchema),
|
|
27
|
+
});
|
|
28
|
+
export const storefrontPromotionalOfferResponseSchema = z.object({
|
|
29
|
+
data: storefrontPromotionalOfferSchema,
|
|
30
|
+
});
|
|
31
|
+
export const storefrontOfferAudienceSchema = z.enum(["staff", "customer", "partner", "supplier"]);
|
|
32
|
+
const storefrontOfferTargetInputSchema = z.object({
|
|
33
|
+
productId: z.string().trim().min(1),
|
|
34
|
+
departureId: z.string().trim().min(1).optional().nullable(),
|
|
35
|
+
bookingId: z.string().trim().min(1).optional().nullable(),
|
|
36
|
+
sessionId: z.string().trim().min(1).optional().nullable(),
|
|
37
|
+
locale: z.string().trim().min(2).optional(),
|
|
38
|
+
pax: z.coerce.number().int().min(1),
|
|
39
|
+
audience: storefrontOfferAudienceSchema.default("customer"),
|
|
40
|
+
market: z.string().trim().min(1).default("default"),
|
|
41
|
+
basePriceCents: z.coerce.number().int().min(0),
|
|
42
|
+
currency: z
|
|
43
|
+
.string()
|
|
44
|
+
.trim()
|
|
45
|
+
.length(3)
|
|
46
|
+
.transform((value) => value.toUpperCase()),
|
|
47
|
+
});
|
|
48
|
+
export const storefrontOfferApplyInputSchema = storefrontOfferTargetInputSchema;
|
|
49
|
+
export const storefrontOfferRedeemInputSchema = storefrontOfferTargetInputSchema.extend({
|
|
50
|
+
code: z.string().trim().min(1).max(80),
|
|
51
|
+
});
|
|
52
|
+
export const storefrontAppliedOfferSchema = z.object({
|
|
53
|
+
offerId: z.string(),
|
|
54
|
+
offerName: z.string(),
|
|
55
|
+
discountAppliedCents: z.number().int(),
|
|
56
|
+
discountedPriceCents: z.number().int(),
|
|
57
|
+
currency: z.string(),
|
|
58
|
+
discountKind: z.enum(["percentage", "fixed_amount"]),
|
|
59
|
+
discountPercent: z.number().nullable(),
|
|
60
|
+
discountAmountCents: z.number().int().nullable(),
|
|
61
|
+
appliedCode: z.string().nullable(),
|
|
62
|
+
stackable: z.boolean(),
|
|
63
|
+
});
|
|
64
|
+
export const storefrontOfferMutationStatusSchema = z.enum([
|
|
65
|
+
"applied",
|
|
66
|
+
"not_applicable",
|
|
67
|
+
"invalid",
|
|
68
|
+
"conflict",
|
|
69
|
+
]);
|
|
70
|
+
export const storefrontOfferMutationReasonSchema = z
|
|
71
|
+
.enum([
|
|
72
|
+
"offer_not_found",
|
|
73
|
+
"offer_expired",
|
|
74
|
+
"offer_not_yet_valid",
|
|
75
|
+
"code_not_found",
|
|
76
|
+
"code_required",
|
|
77
|
+
"code_expired",
|
|
78
|
+
"code_not_yet_valid",
|
|
79
|
+
"scope",
|
|
80
|
+
"min_pax",
|
|
81
|
+
"eligibility",
|
|
82
|
+
"currency",
|
|
83
|
+
"no_discount",
|
|
84
|
+
"booking_mismatch",
|
|
85
|
+
"session_mismatch",
|
|
86
|
+
"conflict",
|
|
87
|
+
])
|
|
88
|
+
.nullable();
|
|
89
|
+
export const storefrontOfferConflictSchema = z.object({
|
|
90
|
+
policy: z.enum(["best_discount_wins", "stackable_compose"]),
|
|
91
|
+
autoAppliedOfferIds: z.array(z.string()),
|
|
92
|
+
manualOfferId: z.string().nullable(),
|
|
93
|
+
selectedOfferIds: z.array(z.string()),
|
|
94
|
+
message: z.string(),
|
|
95
|
+
});
|
|
96
|
+
export const storefrontOfferMutationResultSchema = z.object({
|
|
97
|
+
status: storefrontOfferMutationStatusSchema,
|
|
98
|
+
reason: storefrontOfferMutationReasonSchema,
|
|
99
|
+
offer: storefrontPromotionalOfferSchema.nullable(),
|
|
100
|
+
target: z.object({
|
|
101
|
+
bookingId: z.string().nullable(),
|
|
102
|
+
sessionId: z.string().nullable(),
|
|
103
|
+
productId: z.string(),
|
|
104
|
+
departureId: z.string().nullable(),
|
|
105
|
+
}),
|
|
106
|
+
pricing: z.object({
|
|
107
|
+
basePriceCents: z.number().int(),
|
|
108
|
+
currency: z.string(),
|
|
109
|
+
discountAppliedCents: z.number().int(),
|
|
110
|
+
discountedPriceCents: z.number().int(),
|
|
111
|
+
}),
|
|
112
|
+
appliedOffers: z.array(storefrontAppliedOfferSchema),
|
|
113
|
+
conflict: storefrontOfferConflictSchema.nullable(),
|
|
114
|
+
});
|
|
115
|
+
export const storefrontOfferMutationResponseSchema = z.object({
|
|
116
|
+
data: storefrontOfferMutationResultSchema,
|
|
117
|
+
});
|