@ticketboothapp/booking 1.2.158 → 1.2.159
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/package.json
CHANGED
|
@@ -40,6 +40,7 @@ export interface BuildAdminChangeProviderPayloadParams {
|
|
|
40
40
|
previousPassengerCount: number;
|
|
41
41
|
previousAvailabilityId?: string | null;
|
|
42
42
|
previousReturnAvailabilityId?: string | null;
|
|
43
|
+
itineraryDisplay?: ProviderDashboardChangeBookingPayload['itineraryDisplay'];
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export function buildAdminChangeProviderPayload({
|
|
@@ -62,6 +63,7 @@ export function buildAdminChangeProviderPayload({
|
|
|
62
63
|
previousPassengerCount,
|
|
63
64
|
previousAvailabilityId,
|
|
64
65
|
previousReturnAvailabilityId,
|
|
66
|
+
itineraryDisplay,
|
|
65
67
|
}: BuildAdminChangeProviderPayloadParams): ProviderDashboardChangeBookingPayload | null {
|
|
66
68
|
if (!selectedAvailability) return null;
|
|
67
69
|
const pickupForChange = pickupLocationId
|
|
@@ -77,6 +79,7 @@ export function buildAdminChangeProviderPayload({
|
|
|
77
79
|
pickupLocationId: pickupLocationId ?? null,
|
|
78
80
|
travelerHotel: pickupForChange?.name ?? null,
|
|
79
81
|
startTime: selectedAvailability.dateTime ?? null,
|
|
82
|
+
itineraryDisplay: itineraryDisplay ?? null,
|
|
80
83
|
passengerCount: null,
|
|
81
84
|
childSafetySeatsCount: null,
|
|
82
85
|
foodRestrictions: null,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Currency } from './CurrencySwitcher';
|
|
2
|
+
import type { ItineraryDisplayStep } from '../../lib/booking-api';
|
|
2
3
|
|
|
3
4
|
export type AdminAmendmentAdjustmentMode =
|
|
4
5
|
| 'FIXED_AMOUNT'
|
|
@@ -42,6 +43,7 @@ export type ProviderDashboardChangeBookingPayload = {
|
|
|
42
43
|
pickupLocationId?: string | null;
|
|
43
44
|
travelerHotel?: string | null;
|
|
44
45
|
startTime?: string | null;
|
|
46
|
+
itineraryDisplay?: ItineraryDisplayStep[] | null;
|
|
45
47
|
passengerCount?: number | null;
|
|
46
48
|
childSafetySeatsCount?: number | null;
|
|
47
49
|
foodRestrictions?: string | null;
|
|
@@ -342,6 +342,7 @@ export function useAdminChangeCheckoutController({
|
|
|
342
342
|
previousPassengerCount: changeFlowInitialTicketCount,
|
|
343
343
|
previousAvailabilityId: initialValues?.availabilityId ?? null,
|
|
344
344
|
previousReturnAvailabilityId: initialValues?.returnAvailabilityId ?? null,
|
|
345
|
+
itineraryDisplay: computeItineraryDisplayForStorage() ?? computeItineraryDisplay(),
|
|
345
346
|
});
|
|
346
347
|
};
|
|
347
348
|
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
reservationHoldHasExpired,
|
|
33
33
|
reservationHoldSecondsRemaining,
|
|
34
34
|
} from '../src/components/booking/reservation-hold';
|
|
35
|
+
import { buildAdminChangeProviderPayload } from '../src/components/booking/admin-change-provider-payload';
|
|
35
36
|
|
|
36
37
|
function quote(overrides: Partial<ChangeBookingQuoteResponse>): ChangeBookingQuoteResponse {
|
|
37
38
|
return {
|
|
@@ -140,6 +141,51 @@ test('admin quote response display state cannot invalidate its request identity'
|
|
|
140
141
|
assert.equal(keyAfterResponse, keyBeforeResponse);
|
|
141
142
|
});
|
|
142
143
|
|
|
144
|
+
test('admin no-charge provider payload carries the selected pickup itinerary', () => {
|
|
145
|
+
const itineraryDisplay: NonNullable<
|
|
146
|
+
Parameters<typeof buildAdminChangeProviderPayload>[0]['itineraryDisplay']
|
|
147
|
+
> = [
|
|
148
|
+
{ stepType: 'pickup', time: '3:00 AM', place: 'A Bear and Bison Inn' },
|
|
149
|
+
{ stepType: 'arrive', time: '4:45 AM', place: 'Moraine Lake' },
|
|
150
|
+
{ stepType: 'depart', time: '1:00 PM', place: 'Moraine Lake' },
|
|
151
|
+
{ stepType: 'drop_off', time: '3:00 PM', place: 'A Bear and Bison Inn' },
|
|
152
|
+
];
|
|
153
|
+
const payload = buildAdminChangeProviderPayload({
|
|
154
|
+
selectedAvailability: {
|
|
155
|
+
availabilityId: 'availability_1',
|
|
156
|
+
productId: 'option_1',
|
|
157
|
+
dateTime: '2026-07-27T03:00:00-06:00',
|
|
158
|
+
vacancies: 10,
|
|
159
|
+
} as Parameters<typeof buildAdminChangeProviderPayload>[0]['selectedAvailability'],
|
|
160
|
+
availabilityProductOptionId: 'option_1',
|
|
161
|
+
bookingItems: [{ category: 'ADULT', count: 1 }],
|
|
162
|
+
product: {
|
|
163
|
+
productId: 'product_1',
|
|
164
|
+
name: 'Moraine Lake Sunrise Experience',
|
|
165
|
+
pickupLocations: [{ id: 'pickup_new', name: 'A Bear and Bison Inn' }],
|
|
166
|
+
} as Parameters<typeof buildAdminChangeProviderPayload>[0]['product'],
|
|
167
|
+
pickupLocationId: 'pickup_new',
|
|
168
|
+
selectedReturnOption: null,
|
|
169
|
+
addOnSelections: [],
|
|
170
|
+
cancellationPolicyId: 'standard',
|
|
171
|
+
initialCancellationPolicyId: 'standard',
|
|
172
|
+
appliedPromoCode: null,
|
|
173
|
+
newTotalAmount: 202.87,
|
|
174
|
+
providerPricingOverrides: [],
|
|
175
|
+
mergedProviderAdditionalAdjustments: [],
|
|
176
|
+
adminStructuredAdjustments: [],
|
|
177
|
+
refundDispositionsByOperationId: {},
|
|
178
|
+
previousPassengerCount: 1,
|
|
179
|
+
previousAvailabilityId: 'availability_1',
|
|
180
|
+
previousReturnAvailabilityId: 'return_1',
|
|
181
|
+
itineraryDisplay,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
assert.deepEqual(payload?.itineraryDisplay, itineraryDisplay);
|
|
185
|
+
assert.equal(payload?.pickupLocationId, 'pickup_new');
|
|
186
|
+
assert.equal(payload?.travelerHotel, 'A Bear and Bison Inn');
|
|
187
|
+
});
|
|
188
|
+
|
|
143
189
|
test('admin removal quote preserves explicit release refund decisions for the preview', () => {
|
|
144
190
|
const operation = {
|
|
145
191
|
operationId: 'op_remove_adult',
|