@ticketboothapp/booking 1.2.90 → 1.2.92
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
|
@@ -880,10 +880,7 @@ export function AdminChangeBookingFlow({
|
|
|
880
880
|
}
|
|
881
881
|
}, [initialValues?.dateTime, companyTimezone]);
|
|
882
882
|
const isProviderDashboardChange = Boolean(onChangeBooking);
|
|
883
|
-
const useAdminFeAuthoritativeQuote =
|
|
884
|
-
isAdmin &&
|
|
885
|
-
isProviderDashboardChange &&
|
|
886
|
-
Boolean(flowUi?.adminFeAuthoritativeQuoteEnabled);
|
|
883
|
+
const useAdminFeAuthoritativeQuote = isAdmin && isProviderDashboardChange;
|
|
887
884
|
/** Any change from an existing booking (public or provider). */
|
|
888
885
|
const isChangeBookingContext = Boolean(initialValues?.bookingReference?.trim());
|
|
889
886
|
/**
|
|
@@ -3995,7 +3992,7 @@ export function AdminChangeBookingFlow({
|
|
|
3995
3992
|
<pre className="mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-stone-800">
|
|
3996
3993
|
{[
|
|
3997
3994
|
`Amount-due path: ${path}`,
|
|
3998
|
-
`
|
|
3995
|
+
`adminFeAuthoritativeQuote: ${String(useAdminFeAuthoritativeQuote)}`,
|
|
3999
3996
|
`displayLayerUsesExternalPricing: ${String(displayLayerUsesExternalPricing)} (server/provider totals omit FE admin lines until overlaid)`,
|
|
4000
3997
|
`selfServePricingConfirmed: ${String(selfServePricingConfirmed)} · changeQuoteLoading: ${String(changeQuoteLoading)}`,
|
|
4001
3998
|
`Cart subtotal (excl. admin custom lines): ${fmt(effectiveSubtotal)}`,
|
|
@@ -65,11 +65,6 @@ export interface BookingFlowUiOptions {
|
|
|
65
65
|
itineraryStickyTopOffsetPx?: number;
|
|
66
66
|
/** Provider dashboard change flow: quote/override panel shown immediately before confirm CTA. */
|
|
67
67
|
providerDashboardChangePricingUi?: ProviderDashboardChangePricingUi;
|
|
68
|
-
/**
|
|
69
|
-
* Admin/provider-dashboard change flow: when true, use the admin FE-authoritative quote API.
|
|
70
|
-
* This is a rollout flag; public self-serve must stay on the existing public quote endpoint.
|
|
71
|
-
*/
|
|
72
|
-
adminFeAuthoritativeQuoteEnabled?: boolean;
|
|
73
68
|
}
|
|
74
69
|
|
|
75
70
|
/**
|
|
@@ -33,19 +33,28 @@ export function useEditableSummaryLines(
|
|
|
33
33
|
|
|
34
34
|
const editableSummaryLineAmountInputs = useMemo(() => {
|
|
35
35
|
const out: Record<string, string> = {};
|
|
36
|
-
for (
|
|
37
|
-
|
|
36
|
+
for (let i = 0; i < checkoutPriceSummaryLinesForCheckout.length; i += 1) {
|
|
37
|
+
const line = checkoutPriceSummaryLinesForCheckout[i];
|
|
38
|
+
const lineKey = getEditableSummaryLineKey(line, i);
|
|
39
|
+
const state = editableSummaryInputsByKey[lineKey];
|
|
40
|
+
const baselineAmount =
|
|
41
|
+
line.kind === 'ticket' ? String(roundMoney(line.itemTotal)) : String(roundMoney(line.amount));
|
|
42
|
+
out[lineKey] = state?.amountDirty ? state.amountInput : baselineAmount;
|
|
38
43
|
}
|
|
39
44
|
return out;
|
|
40
|
-
}, [editableSummaryInputsByKey]);
|
|
45
|
+
}, [checkoutPriceSummaryLinesForCheckout, editableSummaryInputsByKey]);
|
|
41
46
|
|
|
42
47
|
const editableSummaryLineLabelInputs = useMemo(() => {
|
|
43
48
|
const out: Record<string, string> = {};
|
|
44
|
-
for (
|
|
45
|
-
|
|
49
|
+
for (let i = 0; i < checkoutPriceSummaryLinesForCheckout.length; i += 1) {
|
|
50
|
+
const line = checkoutPriceSummaryLinesForCheckout[i];
|
|
51
|
+
const lineKey = getEditableSummaryLineKey(line, i);
|
|
52
|
+
const state = editableSummaryInputsByKey[lineKey];
|
|
53
|
+
const baselineLabel = line.kind === 'ticket' ? line.category : line.label;
|
|
54
|
+
out[lineKey] = state?.labelDirty ? state.labelInput : baselineLabel;
|
|
46
55
|
}
|
|
47
56
|
return out;
|
|
48
|
-
}, [editableSummaryInputsByKey]);
|
|
57
|
+
}, [checkoutPriceSummaryLinesForCheckout, editableSummaryInputsByKey]);
|
|
49
58
|
|
|
50
59
|
const editableCheckoutPriceSummaryLines = useMemo((): PriceSummaryLine[] => {
|
|
51
60
|
const firstTaxLineIndex = checkoutPriceSummaryLinesForCheckout.findIndex(
|
|
@@ -56,23 +65,23 @@ export function useEditableSummaryLines(
|
|
|
56
65
|
const lineKey = getEditableSummaryLineKey(line, index);
|
|
57
66
|
const lineInputState = editableSummaryInputsByKey[lineKey];
|
|
58
67
|
if (line.kind === 'ticket') {
|
|
59
|
-
const amountInput = lineInputState?.amountInput;
|
|
68
|
+
const amountInput = lineInputState?.amountDirty ? lineInputState.amountInput : undefined;
|
|
60
69
|
const parsedAmount = amountInput == null || amountInput.trim() === '' ? line.itemTotal : Number(amountInput);
|
|
61
70
|
return {
|
|
62
71
|
...line,
|
|
63
72
|
lineKey,
|
|
64
73
|
editable: isBeforeSubtotal,
|
|
65
|
-
category: lineInputState?.labelInput
|
|
74
|
+
category: lineInputState?.labelDirty ? lineInputState.labelInput : line.category,
|
|
66
75
|
itemTotal: Number.isFinite(parsedAmount) ? roundMoney(parsedAmount) : line.itemTotal,
|
|
67
76
|
};
|
|
68
77
|
}
|
|
69
|
-
const amountInput = lineInputState?.amountInput;
|
|
78
|
+
const amountInput = lineInputState?.amountDirty ? lineInputState.amountInput : undefined;
|
|
70
79
|
const parsedAmount = amountInput == null || amountInput.trim() === '' ? line.amount : Number(amountInput);
|
|
71
80
|
return {
|
|
72
81
|
...line,
|
|
73
82
|
lineKey,
|
|
74
83
|
editable: isBeforeSubtotal,
|
|
75
|
-
label: lineInputState?.labelInput
|
|
84
|
+
label: lineInputState?.labelDirty ? lineInputState.labelInput : line.label,
|
|
76
85
|
amount: Number.isFinite(parsedAmount) ? roundMoney(parsedAmount) : line.amount,
|
|
77
86
|
};
|
|
78
87
|
});
|