Skip to content

feat: add booking availability editor#86

Open
goetchstone wants to merge 1 commit into
mainfrom
feat/availability-editor
Open

feat: add booking availability editor#86
goetchstone wants to merge 1 commit into
mainfrom
feat/availability-editor

Conversation

@goetchstone

Copy link
Copy Markdown
Owner

What

Adds an availability editor to /dashboard/scheduling so booking hours can be set from the dashboard.

Why

Booking hours live in StaffAvailability rows. The setAvailability mutation already existed — but nothing called it (grep found it only in the router definition). So the only way to change booking times was direct database access. That's the real gap behind "tighten up the booking."

Notes

  • Scoped to one service, deliberately. availableSlots matches OR: [{ serviceId }, { serviceId: null }], so availability rows union rather than replace — writing "global" hours would silently add slots on top of the seeded per-service ones. The editor targets one explicit service, so what you see is what you overwrite.
  • Added getAvailability (staffProcedure) — there was no way to read current availability either. Its scope mirrors setAvailability's replace-scope exactly, or the editor would display one set of hours and overwrite a different one.
  • Unchecked day → no rows → no times on the public booking page.
  • Rejects end-before-start before saving (a window that would silently yield zero slots).
  • Times are Eastern (matches the existing timezone default); availableSlots converts per visitor.

Verified

tsc --noEmit, 73 tests, and npm run build all clean.

🤖 Generated with Claude Code

Hours are StaffAvailability rows and setAvailability had no caller, so
booking times could only be changed by direct DB access. The editor
scopes to one service to match availableSlots union semantics.
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