simpo-component-library 3.6.961 → 3.6.962

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.
@@ -25989,14 +25989,20 @@ class AppointmentBookingComponent extends BaseSection {
25989
25989
  state: this.defaultAddress.stateName,
25990
25990
  zipCode: this.defaultAddress.zipCode,
25991
25991
  instructions: this.instructions
25992
- } : undefined
25992
+ } : undefined,
25993
+ // Skips online deposit collection server-side (see BookingGroupService#buildGroup) - a
25994
+ // staff-created booking can't complete a Cashfree checkout inline the way the live site
25995
+ // does, so it must never be routed through the payment gateway; any balance is collected
25996
+ // in person / recorded later via the invoice instead.
25997
+ adminBooking: this.isAdminBooking || this.isAdminContext,
25993
25998
  };
25999
+ const isAdmin = this.isAdminBooking || this.isAdminContext;
25994
26000
  this.restService.holdBooking(holdPayload).subscribe((group) => {
25995
26001
  this.bookingGroup = group;
25996
26002
  if (this.selectedMode !== 'STORE_VISIT' && this.productCartItems.length > 0) {
25997
26003
  this.bookingProductCartService.clear(this.selectedMode);
25998
26004
  }
25999
- if (group.status === 'HOLD' && group.totalCollectedAtBooking > 0) {
26005
+ if (!isAdmin && group.status === 'HOLD' && group.totalCollectedAtBooking > 0) {
26000
26006
  // Must act on this immediately - the hold expires in 10 minutes.
26001
26007
  this.restService.generatePaymentToken(group.groupId).subscribe((order) => {
26002
26008
  localStorage.setItem('appointmentPaymentId', order.pgOrderId);
@@ -26007,6 +26013,13 @@ class AppointmentBookingComponent extends BaseSection {
26007
26013
  this.messageService.add({ severity: 'error', summary: 'Payment Failed', detail: error.error?.message });
26008
26014
  });
26009
26015
  }
26016
+ else if (isAdmin && group.status === 'HOLD') {
26017
+ // Unexpected: the backend should have auto-confirmed this admin booking with zero
26018
+ // deposit. Surface an error rather than silently showing success for a booking that's
26019
+ // still expiring unconfirmed.
26020
+ this.isProcessing = false;
26021
+ this.messageService.add({ severity: 'error', summary: 'Booking Failed', detail: 'This booking requires a deposit and could not be auto-confirmed. Please try again or contact support.' });
26022
+ }
26010
26023
  else {
26011
26024
  this.apiStatus = true;
26012
26025
  this.selectedTab = 'statusTemplate';