@ticketboothapp/booking 1.2.132 → 1.2.133

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.132",
3
+ "version": "1.2.133",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -171,6 +171,10 @@ export function useAdminChangePriceSummary({
171
171
  addOns,
172
172
  adminCustomReceiptLines,
173
173
  });
174
+ const promoEligibleSubtotalForCheckoutExcludingCancellation = Math.max(
175
+ 0,
176
+ promoEligibleSubtotalForCheckout - cancellationPolicyFee,
177
+ );
174
178
 
175
179
  const providerPricingUi = flowUi?.providerDashboardChangePricingUi;
176
180
  const providerQuotedLines = useMemo(
@@ -315,7 +319,7 @@ export function useAdminChangePriceSummary({
315
319
  ticketLineItemsForChangeFlowDisplay,
316
320
  feeLineItemsWithAddOns,
317
321
  effectiveSubtotalForCheckout,
318
- promoEligibleSubtotalForCheckout,
322
+ promoEligibleSubtotalForCheckout: promoEligibleSubtotalForCheckoutExcludingCancellation,
319
323
  addOnTotal,
320
324
  originalAddOnSubtotal,
321
325
  originalProductOptionId,
@@ -37,7 +37,7 @@ interface UseAdminChangePromoDiscountParams {
37
37
  function originalReceiptGrossSubtotalBeforePromo(
38
38
  originalReceipt: ChangeBookingFlowProps['originalReceipt'],
39
39
  ): number {
40
- const chargeTypes = new Set(['TICKET', 'FEE', 'RETURN_OPTION', 'CANCELLATION_UPGRADE']);
40
+ const chargeTypes = new Set(['TICKET', 'FEE', 'RETURN_OPTION']);
41
41
  return (originalReceipt?.lineItems ?? []).reduce((sum, line) => {
42
42
  const amount = Number(line.amount) || 0;
43
43
  if (amount <= 0) return sum;
@@ -142,6 +142,10 @@ export function useChangeBookingPriceSummary({
142
142
  originalAddOnSelections,
143
143
  addOns,
144
144
  });
145
+ const promoEligibleSubtotalExcludingCancellation = Math.max(
146
+ 0,
147
+ promoEligibleSubtotal - cancellationPolicyFee,
148
+ );
145
149
 
146
150
  const {
147
151
  effectivePromoDiscountAmount,
@@ -159,7 +163,7 @@ export function useChangeBookingPriceSummary({
159
163
  ticketLineItemsForChangeFlowDisplay,
160
164
  feeLineItems,
161
165
  effectiveSubtotal,
162
- promoEligibleSubtotal,
166
+ promoEligibleSubtotal: promoEligibleSubtotalExcludingCancellation,
163
167
  addOnTotal,
164
168
  originalAddOnSubtotal,
165
169
  originalProductOptionId,
@@ -34,7 +34,7 @@ interface UseChangeBookingPromoDiscountParams {
34
34
  function originalReceiptGrossSubtotalBeforePromo(
35
35
  originalReceipt: ChangeBookingFlowProps['originalReceipt'],
36
36
  ): number {
37
- const chargeTypes = new Set(['TICKET', 'FEE', 'RETURN_OPTION', 'CANCELLATION_UPGRADE']);
37
+ const chargeTypes = new Set(['TICKET', 'FEE', 'RETURN_OPTION']);
38
38
  return (originalReceipt?.lineItems ?? []).reduce((sum, line) => {
39
39
  const amount = Number(line.amount) || 0;
40
40
  if (amount <= 0) return sum;
@@ -246,7 +246,7 @@ export function useStandardBookingPriceSummary({
246
246
  const checkoutReturnLineAmount = returnPriceAdjustment;
247
247
  const effectiveSubtotalBeforeAddOns = subtotal;
248
248
  const effectiveSubtotal = effectiveSubtotalBeforeAddOns + addOnTotal;
249
- const promoEligibleSubtotal = effectiveSubtotalBeforeAddOns;
249
+ const promoEligibleSubtotal = Math.max(0, effectiveSubtotalBeforeAddOns - cancellationPolicyFee);
250
250
 
251
251
  const feeLineItemsWithAddOns = useMemo(() => {
252
252
  const addOnLines = addOnSelections