Integrate Employer Fatigue Dashboard with Backend Fatigue Logic - #494
Conversation
|
The latest main conflicts have been resolved and all CI checks have passed |
LoopyB
left a comment
There was a problem hiding this comment.
Thanks Alli, this is great work and the overall approach looks solid. Thanks for your amazing effort in getting this done. The Backend is now the source of truth for fatigue calculations and the duplicated Frontend fatigue logic has been removed.
I’ve found one blocking issue before merge:
/shifts/fatigueis currently declared after/:id, so Express may match"fatigue"as the shift ID and never reach the fatigue controller. Please could you move the static/fatigueroute above/:id.
I’d also like a few focused automated tests around the new endpoint, particularly:
- route resolution;
- employer authorization/scoping;
- normal/fatigued/empty scenarios.
There are a couple of smaller non-blocking comments around the modal/date handling and formatting churn, but the core architecture is sound.
Once the route and focused tests are done, I’m happy to review again. Great work!
LoopyB
left a comment
There was a problem hiding this comment.
Thanks Alli - one merge blocker remains. Please register /shifts/fatigue before the dynamic /:id route. At present Express interprets "fatigue" as a shift ID, so the new endpoint is unreachable. A quick fix, and once that route order is corrected, let me know and I'll re-review. Thanks!
LoopyB
left a comment
There was a problem hiding this comment.
Looks good thanks - the /fatigue route-order issue is fixed, CI is green, and the focused fatigue tests pass 6/6. Approved.

Summary
This push builds from the Shift Fatigue Monitoring section from PR #397 and instead integrates the Employer Fatigue Dashboard with the existing backend fatigue logic, replacing the duplicated frontend fatigue calculations identified in PR #397
Changes
Testing