Decouple clocking from teams and streamline timesheet rows#231
Draft
mfisher31 wants to merge 5 commits into
Draft
Decouple clocking from teams and streamline timesheet rows#231mfisher31 wants to merge 5 commits into
mfisher31 wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR decouples clock events from team-scoped behavior so clocking in/out operates at the authenticated-user level, while preserving optional teamId compatibility for legacy data.
Changes:
- Updates clock API, service, controller, route, WebSocket, and tests to use user-scoped clock sessions.
- Removes Team column/selection from personal timesheet row rendering and manual entry creation.
- Updates frontend clock consumers and e2e tests to call clock endpoints without
teamId.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib/useClockToggle.ts |
Removes selected-team guard and calls teamless clock APIs. |
src/lib/useClockToggle.test.ts |
Updates hook tests for no-arg clock API calls. |
src/lib/TeamContext.tsx |
Subscribes to user-scoped clock WebSocket updates. |
src/lib/api.ts |
Makes ClockEvent.teamId optional and removes team IDs from clock API methods. |
src/features/timers/WorkPage.tsx |
Removes team dependency from clock-in/start flow and live stream subscription. |
src/features/teams/AdminDayGroup.tsx |
Stops passing teams into timesheet rows. |
src/features/clock/TimesheetRow.tsx |
Removes team lookup and Team table cell rendering. |
src/features/clock/TimesheetRow.test.tsx |
Updates row tests for removed Team column. |
src/features/clock/TimesheetPage.tsx |
Removes manual-entry team selection and keeps teamless sessions visible. |
src/features/clock/schema.ts |
Makes clock schema teamId fields optional. |
src/features/clock/ClockPage.tsx |
Enables clock-in without a selected team. |
src/features/ai/OzwellWidget.tsx |
Updates Ozwell clock-in/out tool calls to no-arg APIs. |
e2e/work.spec.ts |
Updates clock cleanup to stop without teamId. |
e2e/clock-breaks.spec.ts |
Updates break-flow e2e helpers and requests for teamless clocking. |
backend/tests/timers.test.ts |
Updates timer/clock integration tests for teamless clock endpoints. |
backend/tests/clock.test.ts |
Updates clock route tests for user-scoped sessions. |
backend/src/services/clock.service.ts |
Removes team-scoped active session lookup and broadcasts by user. |
backend/src/services/clock-monitor.service.ts |
Removes team ID from break-reminder notification data. |
backend/src/routes/clock.ts |
Removes team body/query schemas and changes clock WebSocket to user scope. |
backend/src/models/clock.model.ts |
Makes ClockEvent.teamId optional and removes team live-query helpers. |
backend/src/models/activity.model.ts |
Makes clock activity payload teamId optional. |
backend/src/lib/ensure-indexes.ts |
Replaces clock event index with user/endTime index. |
backend/src/controllers/clock.controller.ts |
Calls teamless clock service methods. |
- Remove team-scoped clock API requirements for start/stop/pause/resume/status/manual flows. - Make ClockEvent.teamId optional for legacy compatibility while shifting active-session behavior to user scope. - Simplify clock websocket updates to authenticated user streams and update frontend consumers accordingly. - Drop Team column rendering from timesheet tables and update related row components/tests. - Align backend, frontend, and e2e tests with the new user-scoped clock contract.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #214 by removing direct team association on ClockEvent. e.g. Agnostic clock in/out.