@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
@@ -0,0 +1,16 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(cd \"H:\\\\UpWork\\\\Thaibault\\\\15-happy-algorithm\" && npx jest __tests__/verify2400.test.js --verbose 2>&1)",
5
+ "Bash(tail:*)",
6
+ "Bash(cd \"H:\\\\UpWork\\\\Thaibault\\\\15-happy-algorithm\" && npx jest __tests__/edgeCases.test.js --verbose 2>&1)",
7
+ "Bash(cd \"H:\\\\UpWork\\\\Thaibault\\\\15-happy-algorithm\" && node test/test_counter.js 2>&1)",
8
+ "Bash(cd \"H:\\\\UpWork\\\\Thaibault\\\\15-happy-algorithm\" && node test/test_dailyCount.js 2>&1)",
9
+ "Bash(cd \"H:\\\\UpWork\\\\Thaibault\\\\15-happy-algorithm\" && node test/test_exceptions.js 2>&1)",
10
+ "Bash(cd \"H:\\\\UpWork\\\\Thaibault\\\\15-happy-algorithm\" && node test/test_datesAvailable.js 2>&1)",
11
+ "Bash(cd \"H:\\\\UpWork\\\\Thaibault\\\\15-happy-algorithm\" && node test/test_mealTypeCount.js 2>&1)",
12
+ "Bash(cd \"H:\\\\UpWork\\\\Thaibault\\\\15-happy-algorithm\" && node test/test_isDateAvailable.js 2>&1)",
13
+ "Bash(grep:*)"
14
+ ]
15
+ }
16
+ }
@@ -1,80 +1,80 @@
1
- name: CI/CD Pipeline
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- pull_request:
8
- branches:
9
- - main
10
- types: [opened, synchronize, reopened]
11
-
12
- jobs:
13
- publish:
14
- name: Publish to NPM
15
- runs-on: ubuntu-latest
16
- if: github.ref == 'refs/heads/main' && github.event_name == 'push'
17
-
18
- steps:
19
- - name: Checkout code
20
- uses: actions/checkout@v4
21
-
22
- - name: Setup Node.js
23
- uses: actions/setup-node@v4
24
- with:
25
- node-version: '20.x'
26
- registry-url: 'https://registry.npmjs.org'
27
- cache: 'npm'
28
-
29
- - name: Install dependencies
30
- run: npm ci
31
-
32
- - name: Check if version changed
33
- id: version-check
34
- run: |
35
- PACKAGE_VERSION=$(node -p "require('./package.json').version")
36
- NPM_VERSION=$(npm view @happychef/algorithm version 2>/dev/null || echo "0.0.0")
37
- echo "Package version: $PACKAGE_VERSION"
38
- echo "NPM version: $NPM_VERSION"
39
- if [ "$PACKAGE_VERSION" != "$NPM_VERSION" ]; then
40
- echo "version_changed=true" >> $GITHUB_OUTPUT
41
- echo "Version changed from $NPM_VERSION to $PACKAGE_VERSION"
42
- else
43
- echo "version_changed=false" >> $GITHUB_OUTPUT
44
- echo "Version unchanged: $PACKAGE_VERSION"
45
- fi
46
-
47
- - name: Publish to NPM
48
- if: steps.version-check.outputs.version_changed == 'true'
49
- run: |
50
- npm publish --access public
51
- echo "## 📦 NPM Package Published" >> $GITHUB_STEP_SUMMARY
52
- echo "" >> $GITHUB_STEP_SUMMARY
53
- echo "✅ Successfully published @happychef/algorithm@$(node -p "require('./package.json').version")" >> $GITHUB_STEP_SUMMARY
54
- echo "" >> $GITHUB_STEP_SUMMARY
55
- echo "🔗 [View on NPM](https://www.npmjs.com/package/@happychef/algorithm)" >> $GITHUB_STEP_SUMMARY
56
- env:
57
- NODE_AUTH_TOKEN: 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
58
-
59
- - name: Skip publishing (version unchanged)
60
- if: steps.version-check.outputs.version_changed == 'false'
61
- run: |
62
- echo "## ⏭️ Publishing Skipped" >> $GITHUB_STEP_SUMMARY
63
- echo "" >> $GITHUB_STEP_SUMMARY
64
- echo "Version $(node -p "require('./package.json').version") is already published" >> $GITHUB_STEP_SUMMARY
65
- echo "" >> $GITHUB_STEP_SUMMARY
66
- echo "💡 Bump the version in package.json to trigger publishing" >> $GITHUB_STEP_SUMMARY
67
-
68
- - name: Create Git Tag
69
- if: steps.version-check.outputs.version_changed == 'true'
70
- run: |
71
- PACKAGE_VERSION=$(node -p "require('./package.json').version")
72
- git config user.name "github-actions[bot]"
73
- git config user.email "github-actions[bot]@users.noreply.github.com"
74
- git tag -a "v$PACKAGE_VERSION" -m "Release v$PACKAGE_VERSION"
75
- git push origin "v$PACKAGE_VERSION"
76
- echo "## 🏷️ Git Tag Created" >> $GITHUB_STEP_SUMMARY
77
- echo "" >> $GITHUB_STEP_SUMMARY
78
- echo "Created and pushed tag: v$PACKAGE_VERSION" >> $GITHUB_STEP_SUMMARY
79
- env:
80
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1
+ name: CI/CD Pipeline
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+ types: [opened, synchronize, reopened]
11
+
12
+ jobs:
13
+ publish:
14
+ name: Publish to NPM
15
+ runs-on: ubuntu-latest
16
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
17
+
18
+ steps:
19
+ - name: Checkout code
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Setup Node.js
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: '20.x'
26
+ registry-url: 'https://registry.npmjs.org'
27
+ cache: 'npm'
28
+
29
+ - name: Install dependencies
30
+ run: npm ci
31
+
32
+ - name: Check if version changed
33
+ id: version-check
34
+ run: |
35
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
36
+ NPM_VERSION=$(npm view @happychef/algorithm version 2>/dev/null || echo "0.0.0")
37
+ echo "Package version: $PACKAGE_VERSION"
38
+ echo "NPM version: $NPM_VERSION"
39
+ if [ "$PACKAGE_VERSION" != "$NPM_VERSION" ]; then
40
+ echo "version_changed=true" >> $GITHUB_OUTPUT
41
+ echo "Version changed from $NPM_VERSION to $PACKAGE_VERSION"
42
+ else
43
+ echo "version_changed=false" >> $GITHUB_OUTPUT
44
+ echo "Version unchanged: $PACKAGE_VERSION"
45
+ fi
46
+
47
+ - name: Publish to NPM
48
+ if: steps.version-check.outputs.version_changed == 'true'
49
+ run: |
50
+ npm publish --access public
51
+ echo "## 📦 NPM Package Published" >> $GITHUB_STEP_SUMMARY
52
+ echo "" >> $GITHUB_STEP_SUMMARY
53
+ echo "✅ Successfully published @happychef/algorithm@$(node -p "require('./package.json').version")" >> $GITHUB_STEP_SUMMARY
54
+ echo "" >> $GITHUB_STEP_SUMMARY
55
+ echo "🔗 [View on NPM](https://www.npmjs.com/package/@happychef/algorithm)" >> $GITHUB_STEP_SUMMARY
56
+ env:
57
+ NODE_AUTH_TOKEN: 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
58
+
59
+ - name: Skip publishing (version unchanged)
60
+ if: steps.version-check.outputs.version_changed == 'false'
61
+ run: |
62
+ echo "## ⏭️ Publishing Skipped" >> $GITHUB_STEP_SUMMARY
63
+ echo "" >> $GITHUB_STEP_SUMMARY
64
+ echo "Version $(node -p "require('./package.json').version") is already published" >> $GITHUB_STEP_SUMMARY
65
+ echo "" >> $GITHUB_STEP_SUMMARY
66
+ echo "💡 Bump the version in package.json to trigger publishing" >> $GITHUB_STEP_SUMMARY
67
+
68
+ - name: Create Git Tag
69
+ if: steps.version-check.outputs.version_changed == 'true'
70
+ run: |
71
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
72
+ git config user.name "github-actions[bot]"
73
+ git config user.email "github-actions[bot]@users.noreply.github.com"
74
+ git tag -a "v$PACKAGE_VERSION" -m "Release v$PACKAGE_VERSION"
75
+ git push origin "v$PACKAGE_VERSION"
76
+ echo "## 🏷️ Git Tag Created" >> $GITHUB_STEP_SUMMARY
77
+ echo "" >> $GITHUB_STEP_SUMMARY
78
+ echo "Created and pushed tag: v$PACKAGE_VERSION" >> $GITHUB_STEP_SUMMARY
79
+ env:
80
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,167 +1,167 @@
1
- # Branch Protection Setup Guide
2
-
3
- This guide explains how to configure GitHub branch protection rules to require all tests to pass before merging pull requests.
4
-
5
- ## Why Branch Protection?
6
-
7
- Branch protection ensures:
8
- - ✅ All tests must pass before merging PRs
9
- - ✅ No direct pushes to main without review (optional)
10
- - ✅ Code quality is maintained
11
- - ✅ Broken code never reaches production
12
-
13
- ## Setup Instructions
14
-
15
- ### Step 1: Go to Branch Protection Settings
16
-
17
- 1. Navigate to your GitHub repository: `https://github.com/thibaultvandesompele2/15-happy-algorithm`
18
- 2. Click on **Settings** (tab at the top)
19
- 3. In the left sidebar, click **Branches** (under "Code and automation")
20
- 4. Click **Add branch protection rule** (or **Add rule**)
21
-
22
- ### Step 2: Configure the Rule
23
-
24
- #### Basic Settings:
25
- 1. **Branch name pattern**: Enter `main`
26
-
27
- #### Required Settings:
28
-
29
- ✅ **Check these boxes:**
30
-
31
- 1. ☑️ **Require a pull request before merging**
32
- - This prevents direct pushes to main
33
- - Optional: Set "Required number of approvals" to 1 or more
34
-
35
- 2. ☑️ **Require status checks to pass before merging**
36
- - This is the CRITICAL setting for test enforcement
37
- - Check: **Require branches to be up to date before merging**
38
-
39
- 3. In the **Status checks** search box, you'll see:
40
- - `Run Tests` (your test job)
41
-
42
- ☑️ **Select both Node.js test jobs:**
43
- - `Run Tests (18.x)`
44
- - `Run Tests (20.x)`
45
-
46
- *Note: These will appear after the first workflow run completes*
47
-
48
- 4. ☑️ **Do not allow bypassing the above settings** (recommended)
49
- - Even admins must follow these rules
50
-
51
- #### Optional but Recommended:
52
-
53
- 5. ☑️ **Require conversation resolution before merging**
54
- - All PR comments must be resolved
55
-
56
- 6. ☑️ **Require linear history**
57
- - Prevents messy merge commits
58
-
59
- ### Step 3: Save
60
-
61
- 1. Scroll to the bottom
62
- 2. Click **Create** or **Save changes**
63
-
64
- ## What Happens After Setup
65
-
66
- ### On Pull Requests:
67
- - GitHub automatically runs the CI/CD tests
68
- - You'll see status checks at the bottom of the PR
69
- - **Merge button will be DISABLED** until all tests pass
70
- - If tests fail, you must fix them before merging
71
-
72
- ### Visual Indicators:
73
-
74
- **Tests Running:**
75
- ```
76
- ⏳ Run Tests (18.x) — In progress
77
- ⏳ Run Tests (20.x) — In progress
78
- ```
79
-
80
- **Tests Passed:**
81
- ```
82
- ✅ Run Tests (18.x) — Passed
83
- ✅ Run Tests (20.x) — Passed
84
- 🟢 Merge pull request button is ENABLED
85
- ```
86
-
87
- **Tests Failed:**
88
- ```
89
- ❌ Run Tests (18.x) — Failed
90
- ❌ Run Tests (20.x) — Failed
91
- 🔴 Merge pull request button is DISABLED
92
- ```
93
-
94
- ## Testing the Protection
95
-
96
- ### Create a Test PR:
97
-
98
- 1. Create a new branch:
99
- ```bash
100
- git checkout -b test-branch-protection
101
- ```
102
-
103
- 2. Make a small change:
104
- ```bash
105
- echo "# Test" >> test-file.txt
106
- git add test-file.txt
107
- git commit -m "Test branch protection"
108
- git push origin test-branch-protection
109
- ```
110
-
111
- 3. Go to GitHub and create a pull request
112
-
113
- 4. Observe:
114
- - Tests run automatically
115
- - Merge button is disabled until tests complete
116
- - After tests pass, merge button becomes available
117
-
118
- ## Workflow Behavior
119
-
120
- ### For Pull Requests:
121
- - ✅ Runs all 70 tests on Node.js 18.x and 20.x
122
- - ✅ Must pass before merge is allowed
123
- - ✅ Shows test summary in PR
124
- - ❌ Does NOT publish to npm (only tests)
125
-
126
- ### For Pushes to Main:
127
- - ✅ Runs all tests
128
- - ✅ If version changed AND tests pass → publishes to npm
129
- - ✅ Creates git tag
130
- - ✅ Shows summary of all actions
131
-
132
- ## Troubleshooting
133
-
134
- ### "Status checks not found"
135
- - The status checks only appear after the first workflow run completes
136
- - Push this branch protection setup, wait for workflow to run, then configure protection
137
-
138
- ### "Can't find Run Tests in status checks"
139
- - Make sure the workflow has run at least once
140
- - Check the Actions tab to see workflow runs
141
- - The job name must match exactly: `Run Tests`
142
-
143
- ### "Tests are running but merge button isn't disabled"
144
- - You need to enable "Require status checks to pass before merging"
145
- - Make sure you selected the specific test jobs (18.x and 20.x)
146
-
147
- ## Quick Setup Checklist
148
-
149
- - [ ] Go to Settings → Branches
150
- - [ ] Add branch protection rule for `main`
151
- - [ ] Enable "Require status checks to pass before merging"
152
- - [ ] Select `Run Tests (18.x)` and `Run Tests (20.x)`
153
- - [ ] Enable "Do not allow bypassing"
154
- - [ ] Save the rule
155
- - [ ] Test with a PR
156
-
157
- ## Additional Security (Optional)
158
-
159
- For additional security, you can also enable:
160
-
161
- - **Require deployments to succeed** - Wait for tests before deploying
162
- - **Lock branch** - Temporarily prevent all changes
163
- - **Restrict who can push** - Only specific users/teams can push
164
-
165
- ---
166
-
167
- **Result:** After setup, no code can be merged to `main` without passing all 70 tests! 🎉
1
+ # Branch Protection Setup Guide
2
+
3
+ This guide explains how to configure GitHub branch protection rules to require all tests to pass before merging pull requests.
4
+
5
+ ## Why Branch Protection?
6
+
7
+ Branch protection ensures:
8
+ - ✅ All tests must pass before merging PRs
9
+ - ✅ No direct pushes to main without review (optional)
10
+ - ✅ Code quality is maintained
11
+ - ✅ Broken code never reaches production
12
+
13
+ ## Setup Instructions
14
+
15
+ ### Step 1: Go to Branch Protection Settings
16
+
17
+ 1. Navigate to your GitHub repository: `https://github.com/thibaultvandesompele2/15-happy-algorithm`
18
+ 2. Click on **Settings** (tab at the top)
19
+ 3. In the left sidebar, click **Branches** (under "Code and automation")
20
+ 4. Click **Add branch protection rule** (or **Add rule**)
21
+
22
+ ### Step 2: Configure the Rule
23
+
24
+ #### Basic Settings:
25
+ 1. **Branch name pattern**: Enter `main`
26
+
27
+ #### Required Settings:
28
+
29
+ ✅ **Check these boxes:**
30
+
31
+ 1. ☑️ **Require a pull request before merging**
32
+ - This prevents direct pushes to main
33
+ - Optional: Set "Required number of approvals" to 1 or more
34
+
35
+ 2. ☑️ **Require status checks to pass before merging**
36
+ - This is the CRITICAL setting for test enforcement
37
+ - Check: **Require branches to be up to date before merging**
38
+
39
+ 3. In the **Status checks** search box, you'll see:
40
+ - `Run Tests` (your test job)
41
+
42
+ ☑️ **Select both Node.js test jobs:**
43
+ - `Run Tests (18.x)`
44
+ - `Run Tests (20.x)`
45
+
46
+ *Note: These will appear after the first workflow run completes*
47
+
48
+ 4. ☑️ **Do not allow bypassing the above settings** (recommended)
49
+ - Even admins must follow these rules
50
+
51
+ #### Optional but Recommended:
52
+
53
+ 5. ☑️ **Require conversation resolution before merging**
54
+ - All PR comments must be resolved
55
+
56
+ 6. ☑️ **Require linear history**
57
+ - Prevents messy merge commits
58
+
59
+ ### Step 3: Save
60
+
61
+ 1. Scroll to the bottom
62
+ 2. Click **Create** or **Save changes**
63
+
64
+ ## What Happens After Setup
65
+
66
+ ### On Pull Requests:
67
+ - GitHub automatically runs the CI/CD tests
68
+ - You'll see status checks at the bottom of the PR
69
+ - **Merge button will be DISABLED** until all tests pass
70
+ - If tests fail, you must fix them before merging
71
+
72
+ ### Visual Indicators:
73
+
74
+ **Tests Running:**
75
+ ```
76
+ ⏳ Run Tests (18.x) — In progress
77
+ ⏳ Run Tests (20.x) — In progress
78
+ ```
79
+
80
+ **Tests Passed:**
81
+ ```
82
+ ✅ Run Tests (18.x) — Passed
83
+ ✅ Run Tests (20.x) — Passed
84
+ 🟢 Merge pull request button is ENABLED
85
+ ```
86
+
87
+ **Tests Failed:**
88
+ ```
89
+ ❌ Run Tests (18.x) — Failed
90
+ ❌ Run Tests (20.x) — Failed
91
+ 🔴 Merge pull request button is DISABLED
92
+ ```
93
+
94
+ ## Testing the Protection
95
+
96
+ ### Create a Test PR:
97
+
98
+ 1. Create a new branch:
99
+ ```bash
100
+ git checkout -b test-branch-protection
101
+ ```
102
+
103
+ 2. Make a small change:
104
+ ```bash
105
+ echo "# Test" >> test-file.txt
106
+ git add test-file.txt
107
+ git commit -m "Test branch protection"
108
+ git push origin test-branch-protection
109
+ ```
110
+
111
+ 3. Go to GitHub and create a pull request
112
+
113
+ 4. Observe:
114
+ - Tests run automatically
115
+ - Merge button is disabled until tests complete
116
+ - After tests pass, merge button becomes available
117
+
118
+ ## Workflow Behavior
119
+
120
+ ### For Pull Requests:
121
+ - ✅ Runs all 70 tests on Node.js 18.x and 20.x
122
+ - ✅ Must pass before merge is allowed
123
+ - ✅ Shows test summary in PR
124
+ - ❌ Does NOT publish to npm (only tests)
125
+
126
+ ### For Pushes to Main:
127
+ - ✅ Runs all tests
128
+ - ✅ If version changed AND tests pass → publishes to npm
129
+ - ✅ Creates git tag
130
+ - ✅ Shows summary of all actions
131
+
132
+ ## Troubleshooting
133
+
134
+ ### "Status checks not found"
135
+ - The status checks only appear after the first workflow run completes
136
+ - Push this branch protection setup, wait for workflow to run, then configure protection
137
+
138
+ ### "Can't find Run Tests in status checks"
139
+ - Make sure the workflow has run at least once
140
+ - Check the Actions tab to see workflow runs
141
+ - The job name must match exactly: `Run Tests`
142
+
143
+ ### "Tests are running but merge button isn't disabled"
144
+ - You need to enable "Require status checks to pass before merging"
145
+ - Make sure you selected the specific test jobs (18.x and 20.x)
146
+
147
+ ## Quick Setup Checklist
148
+
149
+ - [ ] Go to Settings → Branches
150
+ - [ ] Add branch protection rule for `main`
151
+ - [ ] Enable "Require status checks to pass before merging"
152
+ - [ ] Select `Run Tests (18.x)` and `Run Tests (20.x)`
153
+ - [ ] Enable "Do not allow bypassing"
154
+ - [ ] Save the rule
155
+ - [ ] Test with a PR
156
+
157
+ ## Additional Security (Optional)
158
+
159
+ For additional security, you can also enable:
160
+
161
+ - **Require deployments to succeed** - Wait for tests before deploying
162
+ - **Lock branch** - Temporarily prevent all changes
163
+ - **Restrict who can push** - Only specific users/teams can push
164
+
165
+ ---
166
+
167
+ **Result:** After setup, no code can be merged to `main` without passing all 70 tests! 🎉
package/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
- PR 2:
2
- ADDED:
3
- - Modified the `getAvailableTimeblocks.js` file to change the default value of `uurOpVoorhand` from 4 hours to 0 hours, enabling immediate bookings when the field is not explicitly set in general settings.
4
-
5
- REMOVED:
6
- - No functions, features, or code were removed; only a configuration default value was updated.
7
-
8
- ---
1
+ PR 2:
2
+ ADDED:
3
+ - Modified the `getAvailableTimeblocks.js` file to change the default value of `uurOpVoorhand` from 4 hours to 0 hours, enabling immediate bookings when the field is not explicitly set in general settings.
4
+
5
+ REMOVED:
6
+ - No functions, features, or code were removed; only a configuration default value was updated.
7
+
8
+ ---