@ticketboothapp/booking 1.2.92 → 1.2.93

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticketboothapp/booking",
3
- "version": "1.2.92",
3
+ "version": "1.2.93",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -5047,6 +5047,48 @@ export function AdminChangeBookingFlow({
5047
5047
  if (!quote.changeIntentId) {
5048
5048
  throw new Error('Missing change intent for booking change confirmation.');
5049
5049
  }
5050
+ if (onChangeBooking) {
5051
+ const pickupForChange = pickupLocationId
5052
+ ? product.pickupLocations?.find((loc) => loc.id === pickupLocationId)
5053
+ : null;
5054
+ await onChangeBooking({
5055
+ productId: availabilityProductOptionId,
5056
+ dateTime: selectedAvailability.dateTime,
5057
+ bookingItems,
5058
+ returnAvailabilityId: selectedReturnOption?.returnAvailabilityId ?? null,
5059
+ pickupLocationId: pickupLocationId ?? null,
5060
+ travelerHotel: pickupForChange?.name ?? null,
5061
+ startTime: selectedAvailability.dateTime ?? null,
5062
+ passengerCount: null,
5063
+ childSafetySeatsCount: null,
5064
+ foodRestrictions: null,
5065
+ addOnSelections: addOnSelections.length > 0 ? addOnSelections : null,
5066
+ cancellationPolicyId: cancellationPolicyId ?? initialValues?.cancellationPolicyId ?? null,
5067
+ promoCode: appliedPromoCode ?? null,
5068
+ newTotalAmount: displayChangeFlowProposedTotalWithEditableLines,
5069
+ additionalHoursCount: null,
5070
+ pricingAdjustment:
5071
+ providerPricingOverrides.length > 0 || mergedProviderAdditionalAdjustments.length > 0
5072
+ ? {
5073
+ mode: 'MANUAL_LINES',
5074
+ ...(providerPricingOverrides.length > 0 ? { lineOverrides: providerPricingOverrides } : {}),
5075
+ ...(mergedProviderAdditionalAdjustments.length > 0
5076
+ ? { additionalAdjustments: mergedProviderAdditionalAdjustments }
5077
+ : {}),
5078
+ }
5079
+ : undefined,
5080
+ capacitySeatCredit: {
5081
+ enabled: true,
5082
+ previousPassengerCount: changeFlowInitialTicketCount,
5083
+ previousAvailabilityId: initialValues?.availabilityId ?? null,
5084
+ previousReturnAvailabilityId: initialValues?.returnAvailabilityId ?? null,
5085
+ },
5086
+ deferPaymentToBalance: true,
5087
+ });
5088
+ onSuccess?.({ reservationReference: changeBookingReference });
5089
+ setLoading(false);
5090
+ return;
5091
+ }
5050
5092
  const freeConfirm = await confirmFreeChangeBooking(quote.changeIntentId);
5051
5093
  if (freeConfirm.status && freeConfirm.status !== 'APPLIED') {
5052
5094
  throw new Error('We could not apply this booking change yet. Please try again.');