@ticketboothapp/booking 1.2.173 → 1.2.175

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.173",
3
+ "version": "1.2.175",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -833,12 +833,6 @@ export function AdminChangeBookingFlow({
833
833
  latestChangeQuote?.allowedRefundDispositionsByOperationId,
834
834
  latestChangeQuote?.removedValueByOperationId,
835
835
  ]);
836
- useEffect(() => {
837
- if (!isProviderDashboardChange || responseRefundDecisionOperations.length === 0) return;
838
- setRefundDispositionsByOperationId((current) =>
839
- defaultPendingRefundDispositions(responseRefundDecisionOperations, current),
840
- );
841
- }, [isProviderDashboardChange, responseRefundDecisionOperations]);
842
836
  const activeRefundDecisionContext = useMemo(() => mergeAdminRefundDecisionContext({
843
837
  current: refundDecisionContext,
844
838
  selectionKey: refundDecisionSelectionKey,
@@ -857,9 +851,19 @@ export function AdminChangeBookingFlow({
857
851
  ? responseReturnPriceTreatmentOperations
858
852
  : [];
859
853
  const activeRefundDispositionsByOperationId = useMemo(() => {
854
+ // Provider changes default discovered refund operations to pending at
855
+ // settlement time. Do not write those response-derived defaults into the
856
+ // explicit input state: doing so changes the request key after the first
857
+ // quote and immediately triggers an identical second quote.
858
+ const dispositionsWithPendingRefundDefaults = isProviderDashboardChange
859
+ ? defaultPendingRefundDispositions(
860
+ activeRefundDecisionContext?.operations ?? [],
861
+ refundDispositionsByOperationId,
862
+ )
863
+ : refundDispositionsByOperationId;
860
864
  const dispositionsWithReturnPriceDefaults = defaultKeepOriginalReturnPriceDispositions(
861
865
  activeReturnPriceTreatmentOperations,
862
- refundDispositionsByOperationId,
866
+ dispositionsWithPendingRefundDefaults,
863
867
  );
864
868
  return selectRefundDispositionsForOperations(
865
869
  activeRefundDecisionContext,
@@ -869,6 +873,7 @@ export function AdminChangeBookingFlow({
869
873
  }, [
870
874
  activeRefundDecisionContext?.operations,
871
875
  activeReturnPriceTreatmentOperations,
876
+ isProviderDashboardChange,
872
877
  refundDispositionsByOperationId,
873
878
  ]);
874
879
  const handleRefundDispositionChange = useCallback((
@@ -910,7 +915,9 @@ export function AdminChangeBookingFlow({
910
915
  adminReverseAdjustmentIds,
911
916
  needsAdjustmentDiscovery:
912
917
  isProviderDashboardChange && !hasHydratedExistingAdjustments,
913
- refundDispositionsByOperationId: activeRefundDispositionsByOperationId,
918
+ // Only explicit user inputs belong to quote identity. Automatic provider
919
+ // defaults are derived separately for settlement/submission below.
920
+ refundDispositionsByOperationId,
914
921
  useAdminFeAuthoritativeQuote,
915
922
  latestChangeQuote,
916
923
  setLatestChangeQuote,
@@ -298,7 +298,7 @@ export function AdminChangeReceiptComparison({
298
298
  {formatCurrencyAmount(removedWithoutRefund, currency, displayLocale)} of booking value will be removed without customer credit.
299
299
  </p>
300
300
  </div>
301
- ) : summaryDisplayLines.length === 0 && Math.abs(amountDue) < 0.005 ? (
301
+ ) : summaryDisplayLines.length === 0 && Math.abs(bookingTotalChange ?? 0) < 0.005 ? (
302
302
  <div className="rounded-md border border-dashed border-stone-300 bg-white/70 px-3 py-4 text-center">
303
303
  <p className="text-sm font-medium text-stone-700">No pricing changes</p>
304
304
  </div>