Skip to content

feat: enforce employee availability windows for shifts - #17

Merged
nooby6 merged 3 commits into
mainfrom
feat/employee-availability-windows
Oct 27, 2026
Merged

nooby6 merged 3 commits into
mainfrom
feat/employee-availability-windows

Conversation

@nooby6

@nooby6 nooby6 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add explicit, date/time availability windows per employee with authenticated create/list endpoints.
  • Require new and updated scheduled shifts to fit wholly inside one configured availability window; employees with no configured windows retain existing behaviour during rollout, and existing shifts are grandfathered when availability is first configured.
  • Enforce shift-window checks in PostgreSQL as well as the service layer, using a per-employee transaction advisory lock to serialize availability/shift writes and prevent check-then-write races.
  • Map availability violations to a stable EMPLOYEE_AVAILABILITY_CONFLICT 409 response and add service regression tests for create/update violations.

Validation

  • GitHub Actions passed on the initial implementation. A follow-up migration refinement preserves existing schedules when availability is configured; CI will rerun for the updated commit.

@nooby6
nooby6 merged commit 3312af0 into main Oct 27, 2026
1 check passed
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