@happychef/algorithm 1.2.29 → 1.2.31

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/bundle_entry.js CHANGED
@@ -96,5 +96,5 @@ globalThis.HappyAlgorithm = {
96
96
  },
97
97
 
98
98
  // Version info
99
- VERSION: '1.2.28'
99
+ VERSION: '1.2.29'
100
100
  };
@@ -0,0 +1,22 @@
1
+ # PR 15 - Fix/safe table parsing and manual floors
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `parseTableData(data)` added to handle safe parsing of table information, including validation for required fields.
8
+ - New method `addManualFloor(floorData)` introduced to allow manual addition of floor plans with custom table configurations.
9
+ - New configuration parameter `enableManualFloors` added to settings to toggle manual floor management functionality.
10
+
11
+ NO_REMOVALS
12
+
13
+ CHANGED:
14
+ - Modified the `parseTable` function in `src/table/table.service.js` to change the `floor` property assignment from `table.floor` to `table.floor || 0`, adding a default value of 0.
15
+ - Modified the `getAvailableTimeblocks` function in `src/table/table.service.js` to change the `uurOpVoorhand` variable initialization from `const uurOpVoorhand = 4;` to `const uurOpVoorhand = 0;`.
16
+ - Modified the `getAvailableTimeblocks` function in `src/table/table.service.js` to change the `maxAantalPersonen` variable initialization from `const maxAantalPersonen = 8;` to `const maxAantalPersonen = 10;`.
17
+
18
+ ---
19
+
20
+ **Author:** houssammk123
21
+ **Date:** 2026-02-14
22
+ **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happychef/algorithm",
3
- "version": "1.2.29",
3
+ "version": "1.2.31",
4
4
  "description": "Restaurant and reservation algorithm utilities",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -47,6 +47,9 @@ function getDataByDayAndMeal(data, dayOfWeek, mealType) {
47
47
  return null;
48
48
  }
49
49
  const mealData = data[mealKey];
50
+ if (!mealData.schemeSettings) {
51
+ return null;
52
+ }
50
53
  const dayData = mealData.schemeSettings[dayOfWeek];
51
54
  if (!dayData) {
52
55
  return null;