@bash-app/bash-common 30.47.0 → 30.48.0

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/README.md CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "30.47.0",
3
+ "version": "30.48.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -763,7 +763,10 @@ export interface TimeSlots {
763
763
  // } as TimeSlots;
764
764
  // }
765
765
 
766
- export function generateTimeSlots(filteredHours: LuxonDateRange[]): TimeSlots {
766
+ export function generateTimeSlots(
767
+ filteredHours: LuxonDateRange[],
768
+ incMin: number = 15
769
+ ): TimeSlots {
767
770
  const timeSlotsStart: string[] = [];
768
771
  let timeSlotsEnd: string[] = [];
769
772
 
@@ -775,13 +778,13 @@ export function generateTimeSlots(filteredHours: LuxonDateRange[]): TimeSlots {
775
778
 
776
779
  while (currentTime < startEnd) {
777
780
  timeSlotsStart.push(dateTimeFormatTime(currentTime)); // Add the time in "HH:mm" format
778
- currentTime = currentTime.plus({ minutes: 30 }); // Increment by 30 minutes
781
+ currentTime = currentTime.plus({ minutes: incMin }); // Increment by 30 minutes
779
782
  }
780
783
 
781
784
  currentTime = end;
782
785
  while (currentTime < endEnd) {
783
786
  timeSlotsEnd.push(dateTimeFormatTime(currentTime)); // Add the time in "HH:mm" format
784
- currentTime = currentTime.plus({ minutes: 30 }); // Increment by 30 minutes
787
+ currentTime = currentTime.plus({ minutes: incMin }); // Increment by 30 minutes
785
788
  }
786
789
 
787
790
  const finalTime =
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -85,9 +85,6 @@ export function frontendServiceGetBookingDayInfo({
85
85
  }: FrontendServiceGetBookingDayInfoFrontParams): FrontendServiceBookingDayInfo[] {
86
86
  const bookingDayResults: FrontendServiceBookingDayInfo[] =
87
87
  daysToBookParams.map((day) => {
88
- const rates = serviceRatesFilter(filteredRates, [day.dateTimeRange]);
89
- const { generalRate, specialRates, dailyRates } = rates;
90
-
91
88
  let priceBreakdown: ServiceBookingPriceBreakdownBaseT[] = [];
92
89
  const durationHours = dateTimeDiffHours(
93
90
  day.dateTimeRange.start,
@@ -101,6 +98,9 @@ export function frontendServiceGetBookingDayInfo({
101
98
  let hoursRemaining = durationHours;
102
99
  let currentRange = { ...day.dateTimeRange };
103
100
  let baseCostDiscountedCents = 0;
101
+
102
+ const rates = serviceRatesFilter(filteredRates, [day.dateTimeRange]);
103
+ const { generalRate, specialRates, dailyRates } = rates;
104
104
  while (serviceRatesHasRates(rates) && hoursRemaining > 0) {
105
105
  const pricingInfo = getServiceRatePricingInfo(
106
106
  currentRange,
File without changes
@@ -107,20 +107,20 @@ export function serviceBookingCanHaveApprovalDecision(
107
107
  errorMessage: "Approval decisions can only be made on booking requests.",
108
108
  };
109
109
  }
110
- if (serviceBookingIsCanceled(booking)) {
111
- return {
112
- valid: false,
113
- errorMessage:
114
- "Approval decisions can not be made on canceled booking requests.",
115
- };
116
- }
117
- if (serviceBookingIsConfirmed(booking)) {
118
- return {
119
- valid: false,
120
- errorMessage:
121
- "Approval decisions can not be made on confirmed booking requests.",
122
- };
123
- }
110
+ // if (serviceBookingIsCanceled(booking)) {
111
+ // return {
112
+ // valid: false,
113
+ // errorMessage:
114
+ // "Approval decisions can not be made on canceled booking requests.",
115
+ // };
116
+ // }
117
+ // if (serviceBookingIsConfirmed(booking)) {
118
+ // return {
119
+ // valid: false,
120
+ // errorMessage:
121
+ // "Approval decisions can not be made on confirmed booking requests.",
122
+ // };
123
+ // }
124
124
 
125
125
  return { valid: true };
126
126
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes