@ticketboothapp/booking 1.2.190 → 1.2.193

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.
Files changed (32) hide show
  1. package/package.json +3 -1
  2. package/src/components/BackgroundVideo.tsx +6 -3
  3. package/src/components/booking/AddOnsSection.module.css +6 -2
  4. package/src/components/booking/AddOnsSection.tsx +4 -4
  5. package/src/components/booking/AdminChangeReceiptComparison.module.css +16 -0
  6. package/src/components/booking/AdminChangeReceiptComparison.tsx +14 -4
  7. package/src/components/booking/BookingDialog.module.css +43 -0
  8. package/src/components/booking/BookingFlowCollage.tsx +43 -16
  9. package/src/components/booking/Calendar.module.css +8 -3
  10. package/src/components/booking/ChangeBookingDialog.tsx +116 -55
  11. package/src/components/booking/ChangeBookingFlow.tsx +1 -0
  12. package/src/components/booking/CheckoutForm.module.css +7 -0
  13. package/src/components/booking/CollapsibleAddOnItem.module.css +3 -2
  14. package/src/components/booking/MealDrinkAddOnSelector.tsx +4 -4
  15. package/src/components/booking/PickupLocationDialog.tsx +63 -59
  16. package/src/components/booking/PickupLocationSelector.tsx +20 -25
  17. package/src/components/booking/PriceSummary.module.css +19 -0
  18. package/src/components/booking/PriceSummary.tsx +10 -7
  19. package/src/components/booking/TourDescription.module.css +6 -1
  20. package/src/components/booking/TourDescription.tsx +25 -16
  21. package/src/components/booking/change-booking-compare.module.css +154 -0
  22. package/src/components/booking/change-booking-compare.tsx +141 -1
  23. package/src/components/booking/pickup-location-product.ts +24 -0
  24. package/src/constants/images.ts +1 -1
  25. package/src/index.ts +11 -0
  26. package/src/lib/booking/pickup-location-disclaimer.ts +69 -0
  27. package/src/lib/booking-api.ts +1 -0
  28. package/src/strings/en.json +140 -68
  29. package/src/strings/es.json +181 -68
  30. package/src/strings/fr.json +181 -68
  31. package/test/change-booking-helpers.test.ts +38 -0
  32. package/test/pickup-location-disclaimer.test.ts +44 -0
@@ -94,6 +94,7 @@ import {
94
94
  resolveInitialAvailabilityFromBooking,
95
95
  } from '../src/components/booking/change-booking-flow-helpers';
96
96
  import { collapseAdminPromoLines } from '../src/components/booking/admin-change-receipt-lines';
97
+ import { resolvePickupLocationProduct } from '../src/components/booking/pickup-location-product';
97
98
  import {
98
99
  buildAdminChangePaymentChoiceData,
99
100
  buildAdminChangePayNowCheckoutModalData,
@@ -168,6 +169,43 @@ function test(name: string, fn: () => void | Promise<void>): void {
168
169
  }
169
170
  }
170
171
 
172
+ test('manage-booking pickup locations prefer the normal booking static product', () => {
173
+ const staticProduct = {
174
+ productId: 'product_1',
175
+ name: 'Static product',
176
+ description: null,
177
+ status: 'ACTIVE',
178
+ options: [{ optionId: 'option_1' }],
179
+ pickupLocations: [{ id: 'pickup_kept', name: 'Kept pickup' }],
180
+ } as NonNullable<Parameters<typeof resolvePickupLocationProduct>[0]>;
181
+ const liveProduct = {
182
+ ...staticProduct,
183
+ name: 'Live product',
184
+ pickupLocations: [
185
+ { id: 'pickup_kept', name: 'Kept pickup' },
186
+ { id: 'pickup_removed', name: 'Removed pickup' },
187
+ ],
188
+ };
189
+
190
+ const resolved = resolvePickupLocationProduct(staticProduct, [liveProduct], 'option_1');
191
+
192
+ assert.equal(resolved, staticProduct);
193
+ assert.deepEqual(resolved?.pickupLocations?.map((location) => location.id), ['pickup_kept']);
194
+ });
195
+
196
+ test('manage-booking pickup locations fall back to a live product matched by option id', () => {
197
+ const liveProduct = {
198
+ productId: 'product_1',
199
+ name: 'Live product',
200
+ description: null,
201
+ status: 'ACTIVE',
202
+ options: [{ optionId: 'option_1' }],
203
+ pickupLocations: [{ id: 'pickup_1', name: 'Pickup one' }],
204
+ } as NonNullable<Parameters<typeof resolvePickupLocationProduct>[0]>;
205
+
206
+ assert.equal(resolvePickupLocationProduct(null, [liveProduct], 'option_1'), liveProduct);
207
+ });
208
+
171
209
  test('availability cache revalidates only when a covered range is stale', () => {
172
210
  assert.equal(shouldRevalidateAvailabilityCache(true, false), false);
173
211
  assert.equal(shouldRevalidateAvailabilityCache(true, true), true);
@@ -0,0 +1,44 @@
1
+ import assert from 'node:assert/strict';
2
+
3
+ import { getPickupLocationDisclaimer } from '../src/lib/booking/pickup-location-disclaimer';
4
+
5
+ const hotelPickups = [
6
+ ['loc_bXsdBbEzD5cP', 'Baker Creek by Basecamp'],
7
+ ['loc_arPLLVG1xKxw', 'Mountaineer Lodge'],
8
+ ['loc_9ObwCZ7MxfjC', 'Paradise Lodge and Bungalows'],
9
+ ['loc_ieW6EfdVeYd4', 'Post Hotel'],
10
+ ];
11
+
12
+ for (const [id, name] of hotelPickups) {
13
+ assert.deepEqual(getPickupLocationDisclaimer({ id, name }), {
14
+ title: 'Hotel guests only',
15
+ message: `This pickup location is only available to guests staying at ${name}. There is no public parking for shuttle guests.`,
16
+ });
17
+ }
18
+
19
+ assert.match(
20
+ getPickupLocationDisclaimer({ id: 'loc_afkvmlNRwRqZ', name: 'Samson Mall' })
21
+ ?.message ?? '',
22
+ /^No public parking/,
23
+ );
24
+ assert.equal(
25
+ getPickupLocationDisclaimer({
26
+ id: 'loc_elsewhere',
27
+ name: 'Banff Train Station',
28
+ }),
29
+ null,
30
+ );
31
+
32
+ assert.deepEqual(
33
+ getPickupLocationDisclaimer({
34
+ id: 'loc_anywhere',
35
+ name: 'Any pickup location',
36
+ disclaimer: 'Please meet your driver at the main entrance.',
37
+ }),
38
+ {
39
+ title: 'Pickup location note',
40
+ message: 'Please meet your driver at the main entrance.',
41
+ },
42
+ );
43
+
44
+ console.log('pickup location disclaimer tests passed');