Skip to content

Recover automatic timesheet generation#414

Merged
LoopyB merged 3 commits into
mainfrom
louisabest/feature/timesheet-generation-recovery
Jul 14, 2026
Merged

Recover automatic timesheet generation#414
LoopyB merged 3 commits into
mainfrom
louisabest/feature/timesheet-generation-recovery

Conversation

@LoopyB

@LoopyB LoopyB commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reimplements the useful automatic timesheet functionality from PR #372 against
the current attendance and payroll architecture.

Changes

  • Added a Timesheet model keyed by shift and guard
  • Added automatic timesheet generation for completed shifts with completed attendance
  • Added idempotent generation to prevent duplicate timesheets
  • Added employer, guard and admin retrieval scoping
  • Reused the existing scheduled-hours and attendance-hours payroll helpers
  • Added focused service tests

Endpoints

  • POST /api/v1/timesheets/generate
  • GET /api/v1/timesheets
  • GET /api/v1/timesheets/:id

Compatibility with the current backend

  • Uses guardId, shiftId, checkInTime and checkOutTime
  • Does not port stale shift-completion hooks
  • Does not store or calculate gross pay
  • Does not introduce hardcoded pay assumptions
  • Does not include frontend, Guard App, notification or socket changes

Validation

  • Targeted ESLint passed
  • Timesheet and payroll isolation tests passed
  • 2 test suites passed
  • 7 tests passed
  • git diff --check passed

Scope

Only timesheet generation, retrieval and the export of existing payroll hour
helpers are included.

Supersedes PR #372.

@LoopyB
LoopyB merged commit 773b7e3 into main Jul 14, 2026
1 check failed
@LoopyB
LoopyB deleted the louisabest/feature/timesheet-generation-recovery branch July 14, 2026 12:52
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.

1 participant