Skip to content

Employee Fatigue Dashboard addition - #397

Draft
Cornel-design wants to merge 1 commit into
mainfrom
Cornell/Features/FatigueDashboardFix
Draft

Employee Fatigue Dashboard addition#397
Cornel-design wants to merge 1 commit into
mainfrom
Cornell/Features/FatigueDashboardFix

Conversation

@Cornel-design

Copy link
Copy Markdown
Collaborator

This push introduces a Shift Fatigue Monitoring section to the Employer Dashboard that computes fatigue risk per guard from /shifts/myshifts. It normalizes shift data, parses dates or and times safely including ISO strings, and calculates shift duration. Guards are flagged as overworked when they have shifts ≥12 hours or rest gaps <12 hours between consecutive shifts. A “rest recommendation” score is derived from the shortest rest gap.

image image

@Rovina05

Copy link
Copy Markdown
Collaborator

Tested this locally. Main issue: the fatigue dashboard doesn't actually use the backend's existing fatigue logic (fatigue.service.js / assessGuardFatigue()). Instead it recalculates fatigue itself on the frontend using raw shift data from /shifts/myshifts. This means we now have two separate fatigue calculations that could give different results. Think this should be rebuilt to call a proper endpoint exposing the existing backend logic instead.

@Rovina05 Rovina05 closed this Jul 23, 2026
@Rovina05 Rovina05 reopened this Jul 23, 2026
@LoopyB

LoopyB commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

This PR contains useful Employer Dashboard UI work, but it is not ready to merge because the fatigue calculation duplicates existing Backend logic and a date/time display issue has been identified.

As the original contributor is no longer active on the project, this PR is being retained as a draft reference. A new focused ticket will recreate the feature from current main using one authoritative Backend fatigue calculation.

Please do not merge or extend this branch directly. Relevant UI work may be reused with attribution in the replacement PR.

@LoopyB
LoopyB marked this pull request as draft July 29, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants