@ticketboothapp/booking 1.2.124 → 1.2.126

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.124",
3
+ "version": "1.2.126",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -12,6 +12,8 @@ interface AdminPaymentChoiceModalProps {
12
12
  onPayNow: () => void;
13
13
  onConfirmWithoutPayment: () => void;
14
14
  onCancel: () => void;
15
+ description?: string;
16
+ payNowLabel?: string;
15
17
  }
16
18
 
17
19
  /**
@@ -28,6 +30,8 @@ export function AdminPaymentChoiceModal({
28
30
  onPayNow,
29
31
  onConfirmWithoutPayment,
30
32
  onCancel,
33
+ description,
34
+ payNowLabel,
31
35
  }: AdminPaymentChoiceModalProps) {
32
36
  if (!open) return null;
33
37
 
@@ -59,7 +63,7 @@ export function AdminPaymentChoiceModal({
59
63
  </button>
60
64
  </div>
61
65
  <p className="mt-3 text-sm text-stone-600 leading-relaxed">
62
- Pay now, or confirm without payment. The customer can pay the full balance from the Manage Booking page.
66
+ {description ?? 'Pay now, or confirm without payment. The customer can pay the full balance from the Manage Booking page.'}
63
67
  </p>
64
68
  </div>
65
69
 
@@ -76,7 +80,7 @@ export function AdminPaymentChoiceModal({
76
80
  disabled={loading}
77
81
  className="w-full py-3 px-4 bg-emerald-600 text-white font-semibold rounded-lg hover:bg-emerald-700 disabled:opacity-50 disabled:cursor-not-allowed"
78
82
  >
79
- {loading ? 'Loading...' : `Pay now (${formatCurrencyAmount(totalAmount, currency)})`}
83
+ {loading ? 'Loading...' : `${payNowLabel ?? 'Pay now'} (${formatCurrencyAmount(totalAmount, currency)})`}
80
84
  </button>
81
85
  <button
82
86
  type="button"
@@ -57,6 +57,12 @@ export function PrivateShuttleCheckoutDialogs({
57
57
  currency={currency}
58
58
  loading={loading}
59
59
  error={error}
60
+ description={
61
+ adminChoiceData?.isDepositPayment
62
+ ? 'Pay the deposit now, or confirm without payment. The customer can pay the deposit or remaining balance from the Manage Booking page.'
63
+ : undefined
64
+ }
65
+ payNowLabel={adminChoiceData?.isDepositPayment ? 'Pay deposit' : undefined}
60
66
  onPayNow={onPayNow}
61
67
  onConfirmWithoutPayment={onConfirmWithoutPayment}
62
68
  onCancel={onAdminPaymentChoiceCancel}
@@ -487,7 +487,12 @@ export function usePrivateShuttleCheckoutController({
487
487
  setAdminChoiceData(buildPrivateShuttleAdminChoiceData({
488
488
  reservation,
489
489
  checkoutBreakdown,
490
- totalAmount: checkoutDepositInfo.totalPrice,
490
+ totalAmount: checkoutDepositInfo.depositAmount,
491
+ fullTotalAmount: checkoutDepositInfo.totalPrice,
492
+ depositAmount: checkoutDepositInfo.depositAmount,
493
+ balanceAmount: checkoutDepositInfo.balanceAmount,
494
+ balanceChargeDaysBefore: balanceChargeDaysBefore ?? 7,
495
+ isDepositPayment: true,
491
496
  datePart: selectedDate,
492
497
  timePart: selectedStartTime,
493
498
  availabilityProductOptionId: selectedOption,
@@ -42,6 +42,11 @@ export interface PrivateShuttleAdminChoiceData {
42
42
  reservationExpiration?: string;
43
43
  checkoutBreakdown: CheckoutBreakdown;
44
44
  totalAmount: number;
45
+ fullTotalAmount?: number;
46
+ depositAmount?: number;
47
+ balanceAmount?: number;
48
+ balanceChargeDaysBefore?: number;
49
+ isDepositPayment?: boolean;
45
50
  datePart: string;
46
51
  timePart: string;
47
52
  availabilityProductOptionId: string;
@@ -67,6 +72,11 @@ export interface BuildPrivateShuttleAdminChoiceDataParams {
67
72
  reservation: { reservationReference: string; expiresAt?: string };
68
73
  checkoutBreakdown: CheckoutBreakdown;
69
74
  totalAmount: number;
75
+ fullTotalAmount?: number;
76
+ depositAmount?: number;
77
+ balanceAmount?: number;
78
+ balanceChargeDaysBefore?: number;
79
+ isDepositPayment?: boolean;
70
80
  datePart: string;
71
81
  timePart: string;
72
82
  availabilityProductOptionId: string;
@@ -176,7 +186,7 @@ export function buildPrivateShuttlePayNowCheckoutModalData(
176
186
  ticketLines: adminChoiceData.ticketLinesForModal,
177
187
  feeLineItems: adminChoiceData.feeLineItems,
178
188
  returnPriceAdjustment: 0,
179
- subtotal: adminChoiceData.subtotal,
189
+ subtotal: adminChoiceData.fullTotalAmount ?? adminChoiceData.subtotal,
180
190
  tax: adminChoiceData.tax,
181
191
  total: adminChoiceData.totalAmount,
182
192
  totalQuantity: adminChoiceData.totalQuantity,
@@ -186,7 +196,17 @@ export function buildPrivateShuttlePayNowCheckoutModalData(
186
196
  cancellationPolicyLabel: adminChoiceData.cancellationPolicyLabel,
187
197
  promoDiscountAmount: adminChoiceData.promoDiscountAmount,
188
198
  discountLabel: adminChoiceData.discountLabel,
189
- summaryOverride: adminChoiceData.summaryOverride,
199
+ summaryOverride: adminChoiceData.summaryOverride
200
+ ? {
201
+ ...adminChoiceData.summaryOverride,
202
+ fullTotalAmount:
203
+ adminChoiceData.summaryOverride.fullTotalAmount ??
204
+ adminChoiceData.fullTotalAmount ??
205
+ adminChoiceData.totalAmount,
206
+ }
207
+ : undefined,
208
+ isDepositPayment: adminChoiceData.isDepositPayment,
209
+ balanceChargeDaysBefore: adminChoiceData.balanceChargeDaysBefore,
190
210
  };
191
211
  }
192
212
 
@@ -255,9 +275,10 @@ export async function confirmPrivateShuttleAdminBookingWithoutPayment({
255
275
  skipConfirmationCommunications: skipConfirmationCommunications ? true : undefined,
256
276
  disableAutoCommunications: disableAutoCommunications ? true : undefined,
257
277
  checkoutBreakdown: adminChoiceData.checkoutBreakdown,
258
- depositAmount: 0,
259
- balanceAmount: adminChoiceData.totalAmount,
260
- totalAmount: adminChoiceData.totalAmount,
278
+ depositAmount: adminChoiceData.depositAmount ?? 0,
279
+ balanceAmount: adminChoiceData.balanceAmount ?? adminChoiceData.totalAmount,
280
+ totalAmount: adminChoiceData.fullTotalAmount ?? adminChoiceData.totalAmount,
281
+ balanceChargeDaysBefore: adminChoiceData.balanceChargeDaysBefore,
261
282
  pricingQuoteId: adminChoiceData.pricingQuoteId,
262
283
  pricingQuoteInputsHash: adminChoiceData.pricingQuoteInputsHash,
263
284
  ...bookingSourceContext,
@@ -199,7 +199,7 @@ export async function reservePrivateShuttleForCheckout({
199
199
  productId,
200
200
  optionId: selectedOption,
201
201
  availabilityId: selectedAvailabilityId,
202
- dateTime: selectedAvailability?.dateTime || selectedDate,
202
+ dateTime: selectedAvailability?.canonicalDateTime || selectedAvailability?.dateTime || selectedDate,
203
203
  bookingItems,
204
204
  currency,
205
205
  promoCode: activePromoCode || null,
@@ -1675,6 +1675,7 @@ export interface ReturnOption {
1675
1675
 
1676
1676
  export interface Availability {
1677
1677
  dateTime: string;
1678
+ canonicalDateTime?: string | null;
1678
1679
  productId?: string;
1679
1680
  vacancies: number;
1680
1681
  totalCapacity?: number;