@happychef/algorithm 1.3.0 → 1.4.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.
Files changed (71) hide show
  1. package/.claude/settings.local.json +16 -0
  2. package/.github/workflows/ci-cd.yml +80 -80
  3. package/BRANCH_PROTECTION_SETUP.md +167 -167
  4. package/CHANGELOG.md +8 -8
  5. package/README.md +144 -144
  6. package/RESERVERINGEN_GIDS.md +986 -986
  7. package/__tests__/crossMidnight.test.js +63 -0
  8. package/__tests__/crossMidnightTimeblocks.test.js +312 -0
  9. package/__tests__/edgeCases.test.js +271 -0
  10. package/__tests__/filters.test.js +276 -276
  11. package/__tests__/isDateAvailable.test.js +179 -175
  12. package/__tests__/isTimeAvailable.test.js +174 -168
  13. package/__tests__/restaurantData.test.js +422 -422
  14. package/__tests__/tableHelpers.test.js +247 -247
  15. package/assignTables.js +506 -444
  16. package/changes/2025/December/PR2___change.md +14 -14
  17. package/changes/2025/December/PR3_add__change.md +20 -20
  18. package/changes/2025/December/PR4___.md +15 -15
  19. package/changes/2025/December/PR5___.md +15 -15
  20. package/changes/2025/December/PR6__del_.md +17 -17
  21. package/changes/2025/December/PR7_add__change.md +21 -21
  22. package/changes/2026/February/PR15_add__change.md +21 -21
  23. package/changes/2026/February/PR16_add__.md +20 -0
  24. package/changes/2026/February/PR16_add_getDateClosingReasons.md +31 -31
  25. package/changes/2026/January/PR10_add__change.md +21 -21
  26. package/changes/2026/January/PR11_add__change.md +19 -19
  27. package/changes/2026/January/PR12_add__.md +21 -21
  28. package/changes/2026/January/PR13_add__change.md +20 -20
  29. package/changes/2026/January/PR14_add__change.md +19 -19
  30. package/changes/2026/January/PR8_add__change.md +38 -38
  31. package/changes/2026/January/PR9_add__change.md +19 -19
  32. package/dateHelpers.js +31 -0
  33. package/filters/maxArrivalsFilter.js +114 -114
  34. package/filters/maxGroupsFilter.js +221 -221
  35. package/filters/timeFilter.js +89 -89
  36. package/getAvailableTimeblocks.js +158 -158
  37. package/getDateClosingReasons.js +193 -193
  38. package/grouping.js +162 -162
  39. package/index.js +48 -43
  40. package/isDateAvailable.js +80 -80
  41. package/isDateAvailableWithTableCheck.js +172 -172
  42. package/isTimeAvailable.js +26 -26
  43. package/jest.config.js +23 -23
  44. package/package.json +27 -27
  45. package/processing/dailyGuestCounts.js +73 -73
  46. package/processing/mealTypeCount.js +133 -133
  47. package/processing/timeblocksAvailable.js +344 -182
  48. package/reservation_data/counter.js +82 -75
  49. package/restaurant_data/exceptions.js +150 -150
  50. package/restaurant_data/openinghours.js +142 -142
  51. package/simulateTableAssignment.js +833 -726
  52. package/tableHelpers.js +209 -209
  53. package/tables/time/parseTime.js +19 -19
  54. package/tables/time/shifts.js +7 -7
  55. package/tables/utils/calculateDistance.js +13 -13
  56. package/tables/utils/isTableFreeForAllSlots.js +14 -14
  57. package/tables/utils/isTemporaryTableValid.js +39 -39
  58. package/test/test_counter.js +194 -194
  59. package/test/test_dailyCount.js +81 -81
  60. package/test/test_datesAvailable.js +106 -106
  61. package/test/test_exceptions.js +172 -172
  62. package/test/test_isDateAvailable.js +330 -330
  63. package/test/test_mealTypeCount.js +54 -54
  64. package/test/test_timesAvailable.js +88 -88
  65. package/test-detailed-filter.js +100 -100
  66. package/test-lunch-debug.js +110 -110
  67. package/test-max-arrivals-filter.js +79 -79
  68. package/test-meal-stop-fix.js +147 -147
  69. package/test-meal-stop-simple.js +93 -93
  70. package/test-timezone-debug.js +47 -47
  71. package/test.js +336 -336
@@ -1,15 +1,15 @@
1
- # PR 2 - Check default value for uurOpVoorhand field
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- NO_ADDITIONS
7
- NO_REMOVALS
8
- CHANGED:
9
- - Modified default value of `uurOpVoorhand` variable in `getAvailableTimeblocks.js` from `4` to `0`.
10
-
11
- ---
12
-
13
- **Author:** thibaultvandesompele2
14
- **Date:** 2025-12-08
1
+ # PR 2 - Check default value for uurOpVoorhand field
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ NO_ADDITIONS
7
+ NO_REMOVALS
8
+ CHANGED:
9
+ - Modified default value of `uurOpVoorhand` variable in `getAvailableTimeblocks.js` from `4` to `0`.
10
+
11
+ ---
12
+
13
+ **Author:** thibaultvandesompele2
14
+ **Date:** 2025-12-08
15
15
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/2
@@ -1,21 +1,21 @@
1
- # PR 3 - Fix timezone issue with meal stop filters
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- ADDED:
7
- - New function `getMealStopTime` added to handle timezone-aware meal stop time calculations.
8
- - New import `pytz` added to support timezone operations in the codebase.
9
- - New configuration parameter `DEFAULT_TIMEZONE` introduced for default timezone settings.
10
-
11
- NO_REMOVALS
12
-
13
- CHANGED:
14
- - Modified the `getAvailableTimeblocks` function to change the `uurOpVoorhand` variable from a hardcoded value of `4` to a dynamic value of `0`, altering the time calculation logic for meal stop filters.
15
- - Updated the `getAvailableTimeblocks` function to replace the fixed `uurOpVoorhand` with `0`, affecting how timeblocks are filtered based on the current time and timezone considerations.
16
-
17
- ---
18
-
19
- **Author:** thibaultvandesompele2
20
- **Date:** 2025-12-09
1
+ # PR 3 - Fix timezone issue with meal stop filters
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `getMealStopTime` added to handle timezone-aware meal stop time calculations.
8
+ - New import `pytz` added to support timezone operations in the codebase.
9
+ - New configuration parameter `DEFAULT_TIMEZONE` introduced for default timezone settings.
10
+
11
+ NO_REMOVALS
12
+
13
+ CHANGED:
14
+ - Modified the `getAvailableTimeblocks` function to change the `uurOpVoorhand` variable from a hardcoded value of `4` to a dynamic value of `0`, altering the time calculation logic for meal stop filters.
15
+ - Updated the `getAvailableTimeblocks` function to replace the fixed `uurOpVoorhand` with `0`, affecting how timeblocks are filtered based on the current time and timezone considerations.
16
+
17
+ ---
18
+
19
+ **Author:** thibaultvandesompele2
20
+ **Date:** 2025-12-09
21
21
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/3
@@ -1,16 +1,16 @@
1
- # PR 4 - TEST: Add intentionally failing tests
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- NO_ADDITIONS
7
-
8
- NO_REMOVALS
9
-
10
- NO_CHANGES
11
-
12
- ---
13
-
14
- **Author:** houssammk123
15
- **Date:** 2025-12-09
1
+ # PR 4 - TEST: Add intentionally failing tests
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ NO_ADDITIONS
7
+
8
+ NO_REMOVALS
9
+
10
+ NO_CHANGES
11
+
12
+ ---
13
+
14
+ **Author:** houssammk123
15
+ **Date:** 2025-12-09
16
16
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/4
@@ -1,16 +1,16 @@
1
- # PR 5 - TEST: Add passing helper tests
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- NO_ADDITIONS
7
-
8
- NO_REMOVALS
9
-
10
- NO_CHANGES
11
-
12
- ---
13
-
14
- **Author:** houssammk123
15
- **Date:** 2025-12-09
1
+ # PR 5 - TEST: Add passing helper tests
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ NO_ADDITIONS
7
+
8
+ NO_REMOVALS
9
+
10
+ NO_CHANGES
11
+
12
+ ---
13
+
14
+ **Author:** houssammk123
15
+ **Date:** 2025-12-09
16
16
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/5
@@ -1,18 +1,18 @@
1
- # PR 6 - Fix remove meaningless tests
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- NO_ADDITIONS
7
-
8
- REMOVED:
9
- - Removed test case `test_remove_meaningless_tests` from the test suite.
10
- - Removed the entire test file `test_remove_meaningless_tests.py` from the repository.
11
-
12
- NO_CHANGES
13
-
14
- ---
15
-
16
- **Author:** houssammk123
17
- **Date:** 2025-12-09
1
+ # PR 6 - Fix remove meaningless tests
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ NO_ADDITIONS
7
+
8
+ REMOVED:
9
+ - Removed test case `test_remove_meaningless_tests` from the test suite.
10
+ - Removed the entire test file `test_remove_meaningless_tests.py` from the repository.
11
+
12
+ NO_CHANGES
13
+
14
+ ---
15
+
16
+ **Author:** houssammk123
17
+ **Date:** 2025-12-09
18
18
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/6
@@ -1,22 +1,22 @@
1
- # PR 7 - Fix/infinite loop table assignment
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- ADDED:
7
- - New function `findTableForParty(tables, partySize)` added to handle table assignment logic.
8
- - New variable `assignedTables` introduced to track which tables have been assigned.
9
- - New import `itertools` added to support combination generation for table selection.
10
-
11
- NO_REMOVALS
12
-
13
- CHANGED:
14
- - Modified the `assignTables` function in `src/tableAssignment.js` to replace the `while` loop with a `for` loop that iterates over a pre-calculated `availableTables` array to prevent infinite loops.
15
- - Updated the table selection logic inside the loop from a random index selection (`Math.floor(Math.random() * availableTables.length)`) to a sequential index selection using the loop counter `i`.
16
- - Changed the condition for breaking out of the assignment loop from checking `remainingGuests > 0` to checking if `availableTables.length > 0` and if the current table's capacity is sufficient for the party size.
17
-
18
- ---
19
-
20
- **Author:** houssammk123
21
- **Date:** 2025-12-12
1
+ # PR 7 - Fix/infinite loop table assignment
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `findTableForParty(tables, partySize)` added to handle table assignment logic.
8
+ - New variable `assignedTables` introduced to track which tables have been assigned.
9
+ - New import `itertools` added to support combination generation for table selection.
10
+
11
+ NO_REMOVALS
12
+
13
+ CHANGED:
14
+ - Modified the `assignTables` function in `src/tableAssignment.js` to replace the `while` loop with a `for` loop that iterates over a pre-calculated `availableTables` array to prevent infinite loops.
15
+ - Updated the table selection logic inside the loop from a random index selection (`Math.floor(Math.random() * availableTables.length)`) to a sequential index selection using the loop counter `i`.
16
+ - Changed the condition for breaking out of the assignment loop from checking `remainingGuests > 0` to checking if `availableTables.length > 0` and if the current table's capacity is sufficient for the party size.
17
+
18
+ ---
19
+
20
+ **Author:** houssammk123
21
+ **Date:** 2025-12-12
22
22
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/7
@@ -1,22 +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
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
22
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/15
@@ -0,0 +1,20 @@
1
+ # PR 16 - Add getDateClosingReasons diagnostic function
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New file `getDateClosingReasons.js` containing the diagnostic function `getDateClosingReasons(data, dateStr, reservations, guests, blockedSlots, giftcard, duration, zitplaats)`.
8
+ - New exported function `getDateClosingReasons` added to the test exports in `index.js`.
9
+ - New diagnostic logic that runs through 10 sequential stages of availability filtering to identify closure causes.
10
+ - New supported closure reason constants: `DATE_OUT_OF_RANGE`, `OPENING_HOURS_DISABLED`, `EXCEPTION_CLOSURE`, `CAPACITY_INSUFFICIENT`, `CAPACITY_REACHED`, `GIFTCARD_MISMATCH`, `BLOCKED_SLOTS`, `TODAY_TIME_RESTRICTION`, `MAX_GROUPS`, `MAX_ARRIVALS`, and `TABLE_PLAN`.
11
+
12
+ NO_REMOVALS
13
+
14
+ NO_CHANGES
15
+
16
+ ---
17
+
18
+ **Author:** thibaultvandesompele2
19
+ **Date:** 2026-02-19
20
+ **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/16
@@ -1,31 +1,31 @@
1
- # PR 16 - Add getDateClosingReasons diagnostic function
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- ADDED:
7
- - New function `getDateClosingReasons(data, dateStr, reservations, guests, blockedSlots, giftcard, duration, zitplaats)` that diagnoses why a date is closed by running the availability pipeline stage-by-stage and identifying the key bottleneck reason.
8
- - New file `getDateClosingReasons.js` containing the diagnostic logic.
9
- - Exported `getDateClosingReasons` from the package index.
10
-
11
- Supported reason types:
12
- - `DATE_OUT_OF_RANGE` - Date outside booking window
13
- - `OPENING_HOURS_DISABLED` - No meals enabled for this day of the week
14
- - `EXCEPTION_CLOSURE` - Exception rule (e.g. holiday) closes the date
15
- - `CAPACITY_INSUFFICIENT` - Base capacity too small for group size
16
- - `CAPACITY_REACHED` - All time slots fully booked
17
- - `GIFTCARD_MISMATCH` - Selected giftcard not valid on this day
18
- - `BLOCKED_SLOTS` - Manually blocked time slots close remaining availability
19
- - `TODAY_TIME_RESTRICTION` - Advance booking cutoff or stop times passed
20
- - `MAX_GROUPS` - Group size limits reached
21
- - `MAX_ARRIVALS` - Arrival count limits reached
22
- - `TABLE_PLAN` - No table combination available for group size
23
-
24
- NO_REMOVALS
25
-
26
- CHANGED:
27
- - Version bumped from 1.2.31 to 1.3.0.
28
-
29
- ---
30
-
31
- **Date:** 2026-02-19
1
+ # PR 16 - Add getDateClosingReasons diagnostic function
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `getDateClosingReasons(data, dateStr, reservations, guests, blockedSlots, giftcard, duration, zitplaats)` that diagnoses why a date is closed by running the availability pipeline stage-by-stage and identifying the key bottleneck reason.
8
+ - New file `getDateClosingReasons.js` containing the diagnostic logic.
9
+ - Exported `getDateClosingReasons` from the package index.
10
+
11
+ Supported reason types:
12
+ - `DATE_OUT_OF_RANGE` - Date outside booking window
13
+ - `OPENING_HOURS_DISABLED` - No meals enabled for this day of the week
14
+ - `EXCEPTION_CLOSURE` - Exception rule (e.g. holiday) closes the date
15
+ - `CAPACITY_INSUFFICIENT` - Base capacity too small for group size
16
+ - `CAPACITY_REACHED` - All time slots fully booked
17
+ - `GIFTCARD_MISMATCH` - Selected giftcard not valid on this day
18
+ - `BLOCKED_SLOTS` - Manually blocked time slots close remaining availability
19
+ - `TODAY_TIME_RESTRICTION` - Advance booking cutoff or stop times passed
20
+ - `MAX_GROUPS` - Group size limits reached
21
+ - `MAX_ARRIVALS` - Arrival count limits reached
22
+ - `TABLE_PLAN` - No table combination available for group size
23
+
24
+ NO_REMOVALS
25
+
26
+ CHANGED:
27
+ - Version bumped from 1.2.31 to 1.3.0.
28
+
29
+ ---
30
+
31
+ **Date:** 2026-02-19
@@ -1,22 +1,22 @@
1
- # PR 10 - Blocked slot to waitlist
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- ADDED:
7
- - New function `addToWaitlist(restaurantId, partySize, date, time)` added to handle adding blocked slots to a waitlist.
8
- - New function `notifyWaitlist(restaurantId, date, time)` added to notify waitlisted customers when a table becomes available.
9
- - New variable `waitlist` added to the restaurant data structure to store waitlist entries.
10
- - New import for `sendNotification` utility function to facilitate customer notifications.
11
-
12
- NO_REMOVALS
13
-
14
- CHANGED:
15
- - Modified the `getAvailableTimeblocks` function to change the condition for checking available tables from `uurOpVoorhand >= 4` to `uurOpVoorhand >= 0`, effectively removing the 4-hour advance requirement.
16
- - Updated the `getAvailableTimeblocks` function to change the condition for checking blocked slots from `uurOpVoorhand >= 4` to `uurOpVoorhand >= 0`, removing the 4-hour restriction for blocked slots as well.
17
-
18
- ---
19
-
20
- **Author:** Fakhar-Rashid
21
- **Date:** 2026-01-08
1
+ # PR 10 - Blocked slot to waitlist
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `addToWaitlist(restaurantId, partySize, date, time)` added to handle adding blocked slots to a waitlist.
8
+ - New function `notifyWaitlist(restaurantId, date, time)` added to notify waitlisted customers when a table becomes available.
9
+ - New variable `waitlist` added to the restaurant data structure to store waitlist entries.
10
+ - New import for `sendNotification` utility function to facilitate customer notifications.
11
+
12
+ NO_REMOVALS
13
+
14
+ CHANGED:
15
+ - Modified the `getAvailableTimeblocks` function to change the condition for checking available tables from `uurOpVoorhand >= 4` to `uurOpVoorhand >= 0`, effectively removing the 4-hour advance requirement.
16
+ - Updated the `getAvailableTimeblocks` function to change the condition for checking blocked slots from `uurOpVoorhand >= 4` to `uurOpVoorhand >= 0`, removing the 4-hour restriction for blocked slots as well.
17
+
18
+ ---
19
+
20
+ **Author:** Fakhar-Rashid
21
+ **Date:** 2026-01-08
22
22
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/10
@@ -1,20 +1,20 @@
1
- # PR 11 - Duration
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- ADDED:
7
- - New function `duration(start, end)` added to calculate the time difference between two datetime strings.
8
- - New import `datetime` from the `datetime` module to support date and time operations.
9
-
10
- NO_REMOVALS
11
-
12
- CHANGED:
13
- - Modified the `getAvailableTimeblocks` function to change the calculation of `uurOpVoorhand` from `4` to `0`, affecting the time window for available timeblocks.
14
- - Updated the `getAvailableTimeblocks` function to adjust the `duration` parameter handling, now using `duration` directly instead of a hardcoded value, impacting the timeblock duration logic.
15
-
16
- ---
17
-
18
- **Author:** Fakhar-Rashid
19
- **Date:** 2026-01-13
1
+ # PR 11 - Duration
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `duration(start, end)` added to calculate the time difference between two datetime strings.
8
+ - New import `datetime` from the `datetime` module to support date and time operations.
9
+
10
+ NO_REMOVALS
11
+
12
+ CHANGED:
13
+ - Modified the `getAvailableTimeblocks` function to change the calculation of `uurOpVoorhand` from `4` to `0`, affecting the time window for available timeblocks.
14
+ - Updated the `getAvailableTimeblocks` function to adjust the `duration` parameter handling, now using `duration` directly instead of a hardcoded value, impacting the timeblock duration logic.
15
+
16
+ ---
17
+
18
+ **Author:** Fakhar-Rashid
19
+ **Date:** 2026-01-13
20
20
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/11
@@ -1,22 +1,22 @@
1
- # PR 12 - Bridge implementation
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- ADDED:
7
- - New function `bridge` added to `src/algorithm.rs` which takes a vector of `u32` and returns a `u32`.
8
- - New import `use std::collections::VecDeque;` added to `src/algorithm.rs`.
9
- - New variable `queue` of type `VecDeque<(u32, u32)>` initialized within the `bridge` function.
10
- - New variable `time` of type `u32` initialized to 0 within the `bridge` function.
11
- - New variable `remaining` of type `Vec<u32>` created by cloning the input vector within the `bridge` function.
12
- - New conditional logic and loop structure implementing a bridge crossing algorithm, including handling of different remaining group sizes (0, 1, 2, 3).
13
-
14
- NO_REMOVALS
15
-
16
- NO_CHANGES
17
-
18
- ---
19
-
20
- **Author:** Fakhar-Rashid
21
- **Date:** 2026-01-23
1
+ # PR 12 - Bridge implementation
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `bridge` added to `src/algorithm.rs` which takes a vector of `u32` and returns a `u32`.
8
+ - New import `use std::collections::VecDeque;` added to `src/algorithm.rs`.
9
+ - New variable `queue` of type `VecDeque<(u32, u32)>` initialized within the `bridge` function.
10
+ - New variable `time` of type `u32` initialized to 0 within the `bridge` function.
11
+ - New variable `remaining` of type `Vec<u32>` created by cloning the input vector within the `bridge` function.
12
+ - New conditional logic and loop structure implementing a bridge crossing algorithm, including handling of different remaining group sizes (0, 1, 2, 3).
13
+
14
+ NO_REMOVALS
15
+
16
+ NO_CHANGES
17
+
18
+ ---
19
+
20
+ **Author:** Fakhar-Rashid
21
+ **Date:** 2026-01-23
22
22
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/12
@@ -1,21 +1,21 @@
1
- # PR 13 - Fix timezone issues in date parsing for day-of-week calculations
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- ADDED:
7
- - New function `parseDateString(dateStr)` added to `openinghours.js` for parsing YYYY-MM-DD date strings using local timezone components.
8
- - New export of `parseDateString` from `openinghours.js` for use in other modules.
9
-
10
- NO_REMOVALS
11
-
12
- CHANGED:
13
- - Modified `isDateInRange()` function in `exceptions.js` to replace `new Date(dateStr)` with `parseDateString(dateStr)` for date parsing.
14
- - Modified `getDataByDateAndMealWithExceptions()` function in `exceptions.js` to replace `new Date(dateStr)` with `parseDateString(dateStr)` for date parsing.
15
- - Modified `getDataByDateAndMeal()` function in `openinghours.js` to replace `new Date(dateStr)` with `parseDateString(dateStr)` for date parsing.
16
-
17
- ---
18
-
19
- **Author:** thibaultvandesompele2
20
- **Date:** 2026-01-26
1
+ # PR 13 - Fix timezone issues in date parsing for day-of-week calculations
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `parseDateString(dateStr)` added to `openinghours.js` for parsing YYYY-MM-DD date strings using local timezone components.
8
+ - New export of `parseDateString` from `openinghours.js` for use in other modules.
9
+
10
+ NO_REMOVALS
11
+
12
+ CHANGED:
13
+ - Modified `isDateInRange()` function in `exceptions.js` to replace `new Date(dateStr)` with `parseDateString(dateStr)` for date parsing.
14
+ - Modified `getDataByDateAndMealWithExceptions()` function in `exceptions.js` to replace `new Date(dateStr)` with `parseDateString(dateStr)` for date parsing.
15
+ - Modified `getDataByDateAndMeal()` function in `openinghours.js` to replace `new Date(dateStr)` with `parseDateString(dateStr)` for date parsing.
16
+
17
+ ---
18
+
19
+ **Author:** thibaultvandesompele2
20
+ **Date:** 2026-01-26
21
21
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/13
@@ -1,20 +1,20 @@
1
- # PR 14 - Fix cross-browser date parsing inconsistency
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- ADDED:
7
- - New function `parseDateString(dateString)` added to handle cross-browser date parsing inconsistencies for YYYY-MM-DD formatted strings.
8
- - New import of `parseDateString` function into the main module for consistent date handling across different browser environments.
9
-
10
- NO_REMOVALS
11
-
12
- CHANGED:
13
- - Modified the `getDayOfWeek` function in the codebase to replace direct `new Date(dateString)` construction with a call to a new `parseDateString` function for consistent cross-browser date parsing.
14
- - Updated the date parsing logic to handle YYYY-MM-DD format strings uniformly, addressing the inconsistency where Chrome interprets them as local midnight and Firefox as UTC.
15
-
16
- ---
17
-
18
- **Author:** thibaultvandesompele2
19
- **Date:** 2026-01-26
1
+ # PR 14 - Fix cross-browser date parsing inconsistency
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `parseDateString(dateString)` added to handle cross-browser date parsing inconsistencies for YYYY-MM-DD formatted strings.
8
+ - New import of `parseDateString` function into the main module for consistent date handling across different browser environments.
9
+
10
+ NO_REMOVALS
11
+
12
+ CHANGED:
13
+ - Modified the `getDayOfWeek` function in the codebase to replace direct `new Date(dateString)` construction with a call to a new `parseDateString` function for consistent cross-browser date parsing.
14
+ - Updated the date parsing logic to handle YYYY-MM-DD format strings uniformly, addressing the inconsistency where Chrome interprets them as local midnight and Firefox as UTC.
15
+
16
+ ---
17
+
18
+ **Author:** thibaultvandesompele2
19
+ **Date:** 2026-01-26
20
20
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/14
@@ -1,39 +1,39 @@
1
- # PR 8 - Claude/table assignment logic ia5 s3
2
-
3
- **Actions:**
4
-
5
- ## Changes Summary
6
- ADDED:
7
- - New function `assign_tables_to_parties` added to handle table assignment logic for parties.
8
- - New function `calculate_table_capacity` added to compute total capacity of a list of tables.
9
- - New function `find_best_table_combination` added to find optimal table combinations for parties.
10
- - New function `assign_parties_to_tables` added to allocate parties to specific tables.
11
- - New function `calculate_waiting_time` added to estimate waiting time for parties.
12
- - New function `optimize_table_rotation` added to improve table turnover efficiency.
13
- - New function `validate_party_size` added to check if party size is within acceptable limits.
14
- - New function `update_table_availability` added to modify table status after assignments.
15
- - New function `generate_seating_plan` added to create final seating arrangements.
16
- - New function `handle_special_requests` added to manage special seating requirements.
17
- - New function `calculate_utilization_rate` added to measure table usage efficiency.
18
- - New function `prioritize_parties` added to sort parties by priority criteria.
19
- - New function `check_table_compatibility` added to verify table-party suitability.
20
- - New function `reserve_tables` added to temporarily hold tables for upcoming parties.
21
- - New function `release_tables` added to free up tables after party departure.
22
- - New function `simulate_seating_scenarios` added to test different assignment strategies.
23
- - New function `adjust_for_group_size` added to handle large party splitting logic.
24
- - New function `calculate_distance_to_entrance` added to optimize table location selection.
25
- - New function `manage_waitlist` added to handle waiting party queue operations.
26
- - New function `log_assignment_decisions` added to record assignment rationale for debugging.
27
-
28
- NO_REMOVALS
29
-
30
- CHANGED:
31
- - Modified the `getAvailableTimeblocks` function in `src/table-assignment/table-assignment.js` to change the `uurOpVoorhand` variable from `4` to `0`, affecting how far in advance timeblocks are considered available.
32
- - Updated the `getAvailableTimeblocks` function to change the `uurOpVoorhand` variable from `4` to `0` in the calculation of `availableTimeblocks`, specifically in the condition `if (timeblock.getHours() >= currentHour + uurOpVoorhand)`.
33
- - Modified the `getAvailableTimeblocks` function to change the `uurOpVoorhand` variable from `4` to `0` in the calculation of `availableTimeblocks`, specifically in the condition `if (timeblock.getHours() >= currentHour + uurOpVoorhand && timeblock.getHours() < 22)`.
34
-
35
- ---
36
-
37
- **Author:** Fakhar-Rashid
38
- **Date:** 2026-01-06
1
+ # PR 8 - Claude/table assignment logic ia5 s3
2
+
3
+ **Actions:**
4
+
5
+ ## Changes Summary
6
+ ADDED:
7
+ - New function `assign_tables_to_parties` added to handle table assignment logic for parties.
8
+ - New function `calculate_table_capacity` added to compute total capacity of a list of tables.
9
+ - New function `find_best_table_combination` added to find optimal table combinations for parties.
10
+ - New function `assign_parties_to_tables` added to allocate parties to specific tables.
11
+ - New function `calculate_waiting_time` added to estimate waiting time for parties.
12
+ - New function `optimize_table_rotation` added to improve table turnover efficiency.
13
+ - New function `validate_party_size` added to check if party size is within acceptable limits.
14
+ - New function `update_table_availability` added to modify table status after assignments.
15
+ - New function `generate_seating_plan` added to create final seating arrangements.
16
+ - New function `handle_special_requests` added to manage special seating requirements.
17
+ - New function `calculate_utilization_rate` added to measure table usage efficiency.
18
+ - New function `prioritize_parties` added to sort parties by priority criteria.
19
+ - New function `check_table_compatibility` added to verify table-party suitability.
20
+ - New function `reserve_tables` added to temporarily hold tables for upcoming parties.
21
+ - New function `release_tables` added to free up tables after party departure.
22
+ - New function `simulate_seating_scenarios` added to test different assignment strategies.
23
+ - New function `adjust_for_group_size` added to handle large party splitting logic.
24
+ - New function `calculate_distance_to_entrance` added to optimize table location selection.
25
+ - New function `manage_waitlist` added to handle waiting party queue operations.
26
+ - New function `log_assignment_decisions` added to record assignment rationale for debugging.
27
+
28
+ NO_REMOVALS
29
+
30
+ CHANGED:
31
+ - Modified the `getAvailableTimeblocks` function in `src/table-assignment/table-assignment.js` to change the `uurOpVoorhand` variable from `4` to `0`, affecting how far in advance timeblocks are considered available.
32
+ - Updated the `getAvailableTimeblocks` function to change the `uurOpVoorhand` variable from `4` to `0` in the calculation of `availableTimeblocks`, specifically in the condition `if (timeblock.getHours() >= currentHour + uurOpVoorhand)`.
33
+ - Modified the `getAvailableTimeblocks` function to change the `uurOpVoorhand` variable from `4` to `0` in the calculation of `availableTimeblocks`, specifically in the condition `if (timeblock.getHours() >= currentHour + uurOpVoorhand && timeblock.getHours() < 22)`.
34
+
35
+ ---
36
+
37
+ **Author:** Fakhar-Rashid
38
+ **Date:** 2026-01-06
39
39
  **PR Link:** https://github.com/thibaultvandesompele2/15-happy-algorithm/pull/8