Implement Issue #2: Scheduling & Publishing #10

Merged
thatguygriff merged 10 commits from feature/issue-2-scheduling into main 2026-04-08 23:02:18 +00:00

10 Commits

Author SHA1 Message Date
6575ce8f44 Filter out volunteers with approved time off from shift edit picker
All checks were successful
CI / Go tests & lint (pull_request) Successful in 8s
CI / Frontend tests & type-check (pull_request) Successful in 39s
CI / Go tests & lint (push) Successful in 9s
CI / Frontend tests & type-check (push) Successful in 40s
The edit form now fetches approved time-off requests and excludes
volunteers whose time off overlaps the shift date from the
selectable list. Unavailable volunteers are shown below the picker
in a "On approved time off" note.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 19:59:05 -03:00
07bf4c2112 Replace volunteer ID input with checkbox picker on shift edit
All checks were successful
CI / Go tests & lint (push) Successful in 9s
CI / Frontend tests & type-check (push) Successful in 41s
CI / Go tests & lint (pull_request) Successful in 9s
CI / Frontend tests & type-check (pull_request) Successful in 42s
The edit form now loads the volunteer list and groups them by
operational role. Template role requirements are shown with a
count indicator (selected/required) that turns green when filled.
Volunteers are selected via checkboxes instead of typing IDs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 19:56:20 -03:00
9473ce24bc Persist schedules view and month in the URL
All checks were successful
CI / Go tests & lint (push) Successful in 9s
CI / Frontend tests & type-check (push) Successful in 41s
CI / Go tests & lint (pull_request) Successful in 10s
CI / Frontend tests & type-check (pull_request) Successful in 41s
- /schedules?year=2026&month=4 for the shifts view
- /schedules/templates for the templates view
- Month navigation updates search params via useNavigate
- Reloading or sharing a URL restores the exact view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 19:34:30 -03:00
c78a35377a Fix SPA routing: serve index.html for non-file paths
All checks were successful
CI / Go tests & lint (push) Successful in 8s
CI / Frontend tests & type-check (push) Successful in 39s
CI / Go tests & lint (pull_request) Successful in 9s
CI / Frontend tests & type-check (pull_request) Successful in 40s
Replace bare http.FileServer with an SPA-aware handler that tries to
serve the requested static file and falls back to index.html when
the path doesn't match a real file. This lets React Router handle
client-side routes like /schedules on page reload.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 19:10:07 -03:00
0af53c9b55 Fix null volunteers array in shift instance JSON responses
All checks were successful
CI / Go tests & lint (push) Successful in 9s
CI / Frontend tests & type-check (push) Successful in 44s
CI / Go tests & lint (pull_request) Successful in 9s
CI / Frontend tests & type-check (pull_request) Successful in 44s
Initialize slice helpers with make() instead of var declaration so
empty results serialize as [] instead of null in JSON, fixing the
frontend TypeError on the schedules page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 19:08:37 -03:00
3900dff5a1 Implement Issue #11: Initial admin account setup on first deploy
When the database has no users, the UI redirects to /setup and prompts
for creation of the first admin account. The setup endpoints are
self-disabling — once any user exists, POST /setup/admin returns 403
and the frontend redirects /setup back to /login. The backend uses an
atomic transaction to prevent race conditions on concurrent requests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 19:02:16 -03:00
f29d9669f8 Add a skill for monitoring gitea actions
All checks were successful
CI / Go tests & lint (push) Successful in 8s
CI / Frontend tests & type-check (push) Successful in 42s
CI / Go tests & lint (pull_request) Successful in 8s
CI / Frontend tests & type-check (pull_request) Successful in 38s
2026-04-08 17:32:23 -03:00
e82a39f2e4 Fix build and run issues
All checks were successful
CI / Go tests & lint (push) Successful in 8s
CI / Frontend tests & type-check (push) Successful in 40s
CI / Go tests & lint (pull_request) Successful in 7s
CI / Frontend tests & type-check (pull_request) Successful in 35s
2026-04-08 14:58:58 -03:00
9905234b34 Fix Dashboard.tsx: update Schedule refs to ShiftInstance
All checks were successful
CI / Go tests & lint (push) Successful in 8s
CI / Frontend tests & type-check (push) Successful in 38s
CI / Go tests & lint (pull_request) Successful in 8s
CI / Frontend tests & type-check (pull_request) Successful in 38s
Replace removed Schedule type and api.listSchedules() with
ShiftInstance and api.listShifts() after the schedule rewrite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 11:48:47 -03:00
fc88b8f005 Implement Issue #2: Scheduling & Publishing
Some checks failed
CI / Go tests & lint (push) Successful in 1m42s
CI / Frontend tests & type-check (push) Failing after 1m38s
CI / Go tests & lint (pull_request) Successful in 8s
CI / Frontend tests & type-check (pull_request) Failing after 32s
Replaces stub schedule CRUD with full shift template + instance system.

- DB: add shift_templates, shift_template_roles, shift_template_volunteers,
  shift_instances, shift_instance_volunteers tables
- schedule package: ShiftTemplate and ShiftInstance models with store
  (generate, publish/unpublish, per-instance edits, volunteer confirmation)
- API: shift-templates CRUD + shifts generate/publish/unpublish/update/confirm
- Notifications sent on publish (FR-S04), unpublish (FR-S05), instance edit
  (FR-S09), and volunteer added mid-month (FR-S10)
- Frontend: Schedules page with month navigation, template management,
  publish/unpublish controls, and per-shift edit/confirm
- Tests: Go handler tests (14 cases) + React tests (11 cases)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 11:40:41 -03:00