@ticketboothapp/booking 1.2.145 → 1.2.147

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.145",
3
+ "version": "1.2.147",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -969,18 +969,12 @@ export function AdminChangeBookingFlow({
969
969
  receiptTax: adminFeAuthoritativeReceipt.tax,
970
970
  receiptTotal: adminFeAuthoritativeReceipt.total,
971
971
  originalReceipt,
972
- serverAmendmentLines:
973
- latestChangeQuote?.pricingVersion === 'booking-amendment-v1'
974
- ? latestChangeQuote.serverPreview?.priceSummaryLines ?? []
975
- : null,
976
- serverAmountDue:
977
- latestChangeQuote?.pricingVersion === 'booking-amendment-v1'
978
- ? latestChangeQuote.serverPreview?.amountDue ?? null
979
- : null,
980
- serverUpdatedTotal:
981
- latestChangeQuote?.pricingVersion === 'booking-amendment-v1'
982
- ? latestChangeQuote.serverPreview?.totalNewBooking ?? null
983
- : null,
972
+ // This flow is fed by the dedicated admin V2 quote endpoint. If it produced a
973
+ // normalized server preview, render it; do not discard valid data because an
974
+ // optional/versioned metadata string is missing or renamed.
975
+ serverAmendmentLines: latestChangeQuote?.serverPreview?.priceSummaryLines ?? null,
976
+ serverAmountDue: latestChangeQuote?.serverPreview?.amountDue ?? null,
977
+ serverUpdatedTotal: latestChangeQuote?.serverPreview?.totalNewBooking ?? null,
984
978
  serverQuoteError: changeQuoteFetchError,
985
979
  ...{ priceSummaryLinesIncludeTaxRow, isTaxIncludedInPrice, showProviderPricingInlineEditor },
986
980
  taxRate: pricingConfig?.taxRate,
@@ -423,14 +423,15 @@ export function useAdminChangeQuotePreview({
423
423
  })
424
424
  : await quoteChangeBooking(quoteRequestBase);
425
425
  if (seq !== changeQuoteRequestSeq.current) return;
426
- setLatestChangeQuote(
427
- sliceAndMergeChangeQuoteForUi(quote, {
426
+ const mergedQuote = sliceAndMergeChangeQuoteForUi(quote, {
428
427
  total: changeFlowNewBookingTotal,
429
428
  subtotal: effectiveSubtotalForCheckout,
430
429
  tax: effectiveTax,
431
- }, currency).mergedQuote,
432
- );
430
+ }, currency).mergedQuote;
431
+ // Commit the completed identity before publishing its result. This keeps a
432
+ // render caused by setLatestChangeQuote from being interpreted as a new request.
433
433
  lastCompletedQuoteInputsKeyRef.current = changeQuoteInputsKey;
434
+ setLatestChangeQuote(mergedQuote);
434
435
  } catch (e) {
435
436
  if (seq !== changeQuoteRequestSeq.current) return;
436
437
  setLatestChangeQuote(null);
@@ -451,34 +452,12 @@ export function useAdminChangeQuotePreview({
451
452
  window.clearTimeout(timer);
452
453
  };
453
454
  }, [
455
+ // Fetching is controlled by the canonical user-input identity. Do not add quote-derived
456
+ // totals, receipt objects, or display lines here: a response must not trigger another quote.
454
457
  isCustomerSelfServeChange,
455
458
  hasChangeSelection,
456
- selectedAvailability,
457
- initialValues,
458
- lastName,
459
459
  missingRequiredReturnSelection,
460
- pickupLocationId,
461
- selectedReturnOption?.returnAvailabilityId,
462
- quantities,
463
- addOnSelections,
464
- changeFlowInitialTicketCount,
465
- changeFlowNewBookingTotal,
466
- changeFlowClientEstimateDue,
467
- effectiveSubtotalForCheckout,
468
- effectiveTax,
469
- currency,
470
- adminCustomLinesAsAdditionalAdjustments,
471
- adminFeAuthoritativeReceipt,
472
- useAdminFeAuthoritativeQuote,
473
460
  changeQuoteInputsKey,
474
- originalReceipt,
475
- product.productId,
476
- setChangeQuoteLoading,
477
- setChangeQuoteFetchError,
478
- setLatestChangeQuote,
479
- lastCompletedQuoteInputsKeyRef,
480
- inFlightQuoteInputsKeyRef,
481
- changeQuoteRequestSeq,
482
461
  ]);
483
462
 
484
463
  return {