Skip to content

Decouple clocking from teams and streamline timesheet rows#231

Draft
mfisher31 wants to merge 5 commits into
mieweb:mainfrom
mfisher31:clock-no-team
Draft

Decouple clocking from teams and streamline timesheet rows#231
mfisher31 wants to merge 5 commits into
mieweb:mainfrom
mfisher31:clock-no-team

Conversation

@mfisher31

Copy link
Copy Markdown
Collaborator

Closes #214 by removing direct team association on ClockEvent. e.g. Agnostic clock in/out.

  • 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .attic/OzwellWidget.tsx
Comment thread backend/tests/clock.test.ts Outdated
mfisher31 and others added 4 commits June 2, 2026 13:28
- 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.
@mfisher31 mfisher31 marked this pull request as draft June 2, 2026 20:29
@mfisher31 mfisher31 moved this from In Progress to Ready in Scrum Team Jerry Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

ClockEvent Should Not Directly Be Associated With a Team

3 participants