feat(automation): implement scheduled opening alerts and automated roster generation (US-10, US-11) #17

Open
gabogg wants to merge 1 commit from feat/us-10-us-11-scheduled-alerts-and-auto-roster into main
Owner

Summary

Addresses #10 and #11.

graph TD
    A[NotificationOverlay] -->|Every 5s| B[checkMallOpeningSchedule]
    B -->|Mon-Sat 9:50 AM / Sun 11:50 AM| C[Animated Modal + Web Audio 3-Tone Alarm]
    D[Sidebar: Auto Roster] -->|Confirmation Dialog| E[generateAutoRoster]
    E -->|Weighted Score Formula| F[calculateOfficerScore]
    F -->|Zone match +3, Fair shifts, Rotation +2, Senior Red +2| G[Assign 24 Distinct Posts]
    G --> H[Map Pins & Distribution Cards Review]
  • US-10 (Scheduled Alerts):
    • Top-level pure schedule evaluation function checkMallOpeningSchedule checking Mon-Sat 9:50 AM and Sun 11:50 AM.
    • Animated modal overlay with acknowledgment and dismissal action.
    • Acoustic synthesis using Web Audio API 3-tone pattern (880Hz, 880Hz, 1100Hz) and manual top-bar test button.
  • US-11 (Automated Roster Generation):
    • Extracted pure scoring module calculateOfficerScore and roster generator generateAutoRoster in src/lib/autoRoster.js.
    • Added security_officers view alias in Supabase migration.
    • Guarantees 24 distinct security officers assigned across all Gamas (9), Red Points (5), and Parking (10) zones.

Evidence

  • Before: Component-embedded schedule checks and roster logic lacking isolated unit test suites.
  • After: 89/89 tests passing across 10 test files (including 10 tests in NotificationOverlay.test.jsx and 9 tests in autoRoster.test.js). Clean Vite production build with 0 errors.

Merge Danger

Door: two-way

Pure calculation utilities and client-side notification overlays with clean rollbacks.

Blast Radius: low

Isolated client-side automation features.

## Summary Addresses #10 and #11. ```mermaid graph TD A[NotificationOverlay] -->|Every 5s| B[checkMallOpeningSchedule] B -->|Mon-Sat 9:50 AM / Sun 11:50 AM| C[Animated Modal + Web Audio 3-Tone Alarm] D[Sidebar: Auto Roster] -->|Confirmation Dialog| E[generateAutoRoster] E -->|Weighted Score Formula| F[calculateOfficerScore] F -->|Zone match +3, Fair shifts, Rotation +2, Senior Red +2| G[Assign 24 Distinct Posts] G --> H[Map Pins & Distribution Cards Review] ``` - **US-10 (Scheduled Alerts)**: - Top-level pure schedule evaluation function `checkMallOpeningSchedule` checking Mon-Sat 9:50 AM and Sun 11:50 AM. - Animated modal overlay with acknowledgment and dismissal action. - Acoustic synthesis using Web Audio API 3-tone pattern (880Hz, 880Hz, 1100Hz) and manual top-bar test button. - **US-11 (Automated Roster Generation)**: - Extracted pure scoring module `calculateOfficerScore` and roster generator `generateAutoRoster` in `src/lib/autoRoster.js`. - Added `security_officers` view alias in Supabase migration. - Guarantees 24 distinct security officers assigned across all Gamas (9), Red Points (5), and Parking (10) zones. ## Evidence - **Before:** Component-embedded schedule checks and roster logic lacking isolated unit test suites. - **After:** 89/89 tests passing across 10 test files (including 10 tests in `NotificationOverlay.test.jsx` and 9 tests in `autoRoster.test.js`). Clean Vite production build with 0 errors. ## Merge Danger **Door:** two-way Pure calculation utilities and client-side notification overlays with clean rollbacks. **Blast Radius:** low Isolated client-side automation features.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/us-10-us-11-scheduled-alerts-and-auto-roster:feat/us-10-us-11-scheduled-alerts-and-auto-roster
git switch feat/us-10-us-11-scheduled-alerts-and-auto-roster

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/us-10-us-11-scheduled-alerts-and-auto-roster
git switch feat/us-10-us-11-scheduled-alerts-and-auto-roster
git rebase main
git switch main
git merge --ff-only feat/us-10-us-11-scheduled-alerts-and-auto-roster
git switch feat/us-10-us-11-scheduled-alerts-and-auto-roster
git rebase main
git switch main
git merge --no-ff feat/us-10-us-11-scheduled-alerts-and-auto-roster
git switch main
git merge --squash feat/us-10-us-11-scheduled-alerts-and-auto-roster
git switch main
git merge --ff-only feat/us-10-us-11-scheduled-alerts-and-auto-roster
git switch main
git merge feat/us-10-us-11-scheduled-alerts-and-auto-roster
git push origin main
Sign in to join this conversation.
No description provided.