fix: enforce room type scheduling rules #5

Merged
kdaniel2410 merged 1 commits from codex/fix-scheduling-contract-conflicts into main 2026-06-26 10:37:54 +00:00
Owner

Review finding

  • Room bookings were not constrained to meeting rooms: the booking form listed every room type and the server accepted any valid room id.
  • Contracts already filtered private offices/coworking desks on create/edit, but an older draft contract with an invalid meeting-room link could still be activated.
  • The recent invoice lifecycle page also had a small Prettier ordering drift.

Changes

  • Booking room options now only include meeting rooms.
  • Booking create/edit actions now reject non-meeting-room ids server-side.
  • Contract room type filtering now uses a shared server constant and activation re-validates linked rooms, so meeting rooms cannot be activated on contracts.
  • Removed the previous booking-vs-contract conflict helper because the type boundary makes it unnecessary.
  • Formatted the merged invoice detail page line flagged by Prettier.

Verification

  • pnpm check
  • pnpm exec eslint src/lib/server/scheduling.ts 'src/routes/dashboard/clients/[id]/bookings/+page.server.ts' 'src/routes/dashboard/clients/[id]/contracts/+page.server.ts' 'src/routes/dashboard/invoices/[id]/+page.svelte'\n- pnpm exec prettier --check src/lib/server/scheduling.ts 'src/routes/dashboard/clients/[id]/bookings/+page.server.ts' 'src/routes/dashboard/clients/[id]/contracts/+page.server.ts' 'src/routes/dashboard/invoices/[id]/+page.svelte'\n- pnpm build\n\nNote: full pnpm lint is still blocked by pre-existing unrelated lint/formatting issues in src/lib/components/first-admin-form.svelte, src/lib/components/organization-switcher.svelte, and generated worker types.
## Review finding - Room bookings were not constrained to meeting rooms: the booking form listed every room type and the server accepted any valid room id. - Contracts already filtered private offices/coworking desks on create/edit, but an older draft contract with an invalid meeting-room link could still be activated. - The recent invoice lifecycle page also had a small Prettier ordering drift. ## Changes - Booking room options now only include meeting rooms. - Booking create/edit actions now reject non-meeting-room ids server-side. - Contract room type filtering now uses a shared server constant and activation re-validates linked rooms, so meeting rooms cannot be activated on contracts. - Removed the previous booking-vs-contract conflict helper because the type boundary makes it unnecessary. - Formatted the merged invoice detail page line flagged by Prettier. ## Verification - pnpm check - pnpm exec eslint src/lib/server/scheduling.ts 'src/routes/dashboard/clients/[id]/bookings/+page.server.ts' 'src/routes/dashboard/clients/[id]/contracts/+page.server.ts' 'src/routes/dashboard/invoices/[id]/+page.svelte'\n- pnpm exec prettier --check src/lib/server/scheduling.ts 'src/routes/dashboard/clients/[id]/bookings/+page.server.ts' 'src/routes/dashboard/clients/[id]/contracts/+page.server.ts' 'src/routes/dashboard/invoices/[id]/+page.svelte'\n- pnpm build\n\nNote: full pnpm lint is still blocked by pre-existing unrelated lint/formatting issues in src/lib/components/first-admin-form.svelte, src/lib/components/organization-switcher.svelte, and generated worker types.
kdaniel2410 added 1 commit 2026-06-26 10:36:54 +00:00
kdaniel2410 force-pushed codex/fix-scheduling-contract-conflicts from 013b81879c to a6818607c8 2026-06-26 10:36:54 +00:00 Compare
kdaniel2410 changed title from fix: block bookings for contracted rooms to fix: enforce room type scheduling rules 2026-06-26 10:37:05 +00:00
kdaniel2410 merged commit d38d47051a into main 2026-06-26 10:37:54 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kdaniel2410/clearity#5