@happychef/algorithm 1.2.31 → 1.2.32

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": "@happychef/algorithm",
3
- "version": "1.2.31",
3
+ "version": "1.2.32",
4
4
  "description": "Restaurant and reservation algorithm utilities",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -38,6 +38,11 @@ function getMealTypeByTime(timeStr) {
38
38
  return mealType;
39
39
  }
40
40
  }
41
+ // Times at or past dinner end are considered dinner (cross-midnight support for bowling)
42
+ const dinnerEnd = parseTime(shifts.dinner.end);
43
+ if (time >= dinnerEnd) {
44
+ return 'dinner';
45
+ }
41
46
  return null;
42
47
  }
43
48
 
@@ -104,6 +109,15 @@ function getDataByDateAndMeal(data, dateStr, mealType) {
104
109
 
105
110
  adjustMealData(mealData, data['general-settings']);
106
111
 
112
+ // Extend dinner end time past midnight for bowling venues
113
+ const hoursOpenedPastMidnight = Number(mealData.hoursOpenedPastMidnight) || 0;
114
+ if (hoursOpenedPastMidnight > 0 && mealType === 'dinner') {
115
+ const newEndMinutes = 1440 + (hoursOpenedPastMidnight * 60); // midnight + hours
116
+ const hours = String(Math.floor(newEndMinutes / 60)).padStart(2, '0');
117
+ const minutes = String(newEndMinutes % 60).padStart(2, '0');
118
+ mealData.endTime = `${hours}:${minutes}`;
119
+ }
120
+
107
121
  // Add duurReservatie to endTime
108
122
  addDuurReservatieToEndTime(mealData, data);
109
123