Skip to content

Table reservation page - #14

Open
SirQuackyy wants to merge 11 commits into
mainfrom
table-reservation-page
Open

SirQuackyy wants to merge 11 commits into
mainfrom
table-reservation-page

Conversation

@SirQuackyy

@SirQuackyy SirQuackyy commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Adds a table reservation system for accepted participants and organizers.

Participants

  • Adds /reserve for direct or random table selection.
  • Restricts access to accepted applicants, including RSVP-complete decisions.
  • Enforces one table per team per event.
  • Displays scheduled, open, and closed reservation states.
  • Prevents organizers from using participant reservation actions.

Organizers

  • Adds a Reservations entry to the organizer dashboard.
  • Supports event creation, editing, scheduling, opening, closing, archiving, and deletion.
  • Supports bulk and individual table creation, renumbering, and safe deletion.
  • Supports team assignment, moving, swapping, displacement, and unassignment.
  • Adds participant preview and paginated audit views.
  • Blocks destructive operations when tables or teams are still assigned.

Database and security

  • Adds reservation teams, user-team links, event lifecycle fields, and audit storage.
  • Adds constraints, indexes, RLS policies, and append-only audit protections.
  • Repairs migration ordering and supports clean resets and upgrades with existing reservation data.
  • Keeps all mutations behind organizer-guarded or participant-authorized server actions.

Reliability

  • Uses transactional assignment and audit writes.
  • Adds concurrency-safe locking for lifecycle, topology, and assignment changes.
  • Rejects stale confirmations when table numbers, occupants, or assignments change.
  • Validates reservation windows, UUIDs, table numbers, and bulk table limits.

Test plan

  • pnpm db:reset
  • pnpm test — 101 tests passed
  • pnpm test:db — 220 tests passed
  • pnpm exec tsc --noEmit
  • Focused ESLint and Prettier checks
  • pnpm build
  • Organizer browser workflow: events, tables, assignments, audit, archive/restore, and preview
  • Participant browser workflow: event visibility, reservation, and duplicate-reservation prevention
  • Accepted-applicant page and server-action authorization tests

@SirQuackyy
SirQuackyy marked this pull request as draft June 29, 2026 22:41
@SirQuackyy
SirQuackyy marked this pull request as ready for review June 29, 2026 22:48
@HangYeung1
HangYeung1 requested a review from pradhamk July 12, 2026 21:18
@HangYeung1

Copy link
Copy Markdown
Contributor

Plz pull from main

@pradhamk pradhamk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably best to defer merging this into main until the user management dashboard is setup, so we have a good sense of the schema for user teams. Afterwards, we can wire those schemas into the reservation system and merge it.

@SirQuackyy
SirQuackyy marked this pull request as draft August 26, 2026 01:43
@SirQuackyy
SirQuackyy marked this pull request as ready for review August 26, 2026 09:42
@SirQuackyy
SirQuackyy requested review from pradhamk and a lite review from Copilot August 26, 2026 09:43
@SirQuackyy
SirQuackyy requested a review from HangYeung1 August 26, 2026 09:45
@SirQuackyy SirQuackyy self-assigned this Aug 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a full table-reservation feature set spanning participant /reserve, organizer reservation management UI, and a supporting Supabase schema + RLS/audit layer, with Vitest coverage added to validate domain logic, UI behavior, and schema upgrades.

Changes:

  • Introduces reservation domain/validation utilities, participant reservation actions, and organizer event/table/assignment/audit workflows.
  • Adds Supabase migrations/seeds for teams, events, tables, audit log, constraints/indexes/RLS, plus upgrade fixtures and integration schema tests.
  • Adds Vitest + Testing Library setup and a broad test suite for the new reservation functionality.

Reviewed changes

Copilot reviewed 67 out of 68 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vitest.setup.ts Adds Testing Library jest-dom matchers for Vitest.
vitest.config.ts Configures Vitest (aliases, setup file, defaults).
package.json Adds Vitest scripts and test/dev dependencies.
supabase/config.toml Registers the new reservation seed in local seed paths.
supabase/seeds/reservation-demo.sql Seeds deterministic teams and assigns demo users to teams.
supabase/migrations/20260614183803_applicant_user_fk.sql Converts an old migration into a compatibility no-op to stabilize ordering.
supabase/migrations/20260614183803_snapshot.json Adds/updates a stored schema snapshot for migration metadata.
supabase/migrations/20260628000000_sync_application_schema.sql Compatibility no-op for an outdated schema sync migration.
supabase/migrations/20260629000000_table_reservations.sql Introduces baseline events/tables schema for reservations.
supabase/migrations/20260825000000_reservation_management.sql Expands reservation schema (teams, lifecycle, audit, constraints, indexes, RLS) and upgrade logic.
scripts/reservation-upgrade-fixture.mjs Inserts legacy reservation fixtures to validate upgrade preservation behavior.
scripts/reservation-schema.integration.test.ts Integration tests asserting schema objects, RLS behavior, and upgrade invariants.
lib/reservation/domain.ts Reservation lifecycle availability + table-count planning logic.
lib/reservation/domain.test.ts Tests for availability logic and table count planning behavior.
lib/reservation/layout.ts Utility to chunk table list into UI rows.
lib/reservation/validation.ts Zod schemas for IDs, table numbers/counts, and event input validation.
lib/reservation/validation.test.ts Tests for reservation validation constraints.
lib/reservation/types.ts Shared types for participant/admin reservation views.
lib/reservation/access.ts Authorization helpers to restrict reservation access to accepted applicants (with locking).
lib/reservation/access.test.ts Tests for accepted-decision predicates.
lib/reservation/audit.ts Helper to write reservation audit entries via a provided executor.
lib/db/schema/reservation-teams.ts Drizzle schema for teams with RLS select policy.
lib/db/schema/reservation.ts Drizzle schema for events/tables/audit log with constraints/indexes and RLS policies.
lib/db/schema/users.ts Adds team_id FK + index to users schema.
lib/db/index.ts Registers reservation schema with the Drizzle database instance.
lib/db/queries/reservation.ts Participant-side reservation queries (events, user, tables).
lib/queries/admin-reservations.ts Organizer-side queries for event lists/details, tables/assignments views, and audit pagination.
lib/actions/reservation.ts Participant server actions for direct and random table reservation with auditing and locking.
lib/admin/sections.ts Adds organizer navigation entry for Reservations (and groups as “Event logistics”).
components/ui/dialog.tsx Adds Dialog UI primitive wrapper (Radix-based) for organizer flows.
components/ui/card.tsx Adjusts card spacing/title styling to support updated UI patterns.
components/reservation/event-picker.tsx Participant event picker control for /reserve.
components/reservation/judging-map.tsx Table-map UI component with participant/admin modes and accessible labels.
components/reservation/judging-map.test.tsx Tests for map interactivity and labeling in participant/admin modes.
components/reservation/reservation-board.tsx Participant reservation UI, integrates map + actions + state messaging.
components/reservation/reservation-board.test.tsx Tests for participant reservation UI behavior and read-only preview mode.
app/reserve/page.tsx Participant /reserve route with organizer redirect + accepted-applicant gating.
app/reserve/page.test.tsx Tests for /reserve authorization/redirect behavior.
app/admin/reservations/page.tsx Organizer Reservations landing page with event list + audit link.
app/admin/reservations/reservation-event-list.tsx Organizer event list UI with lifecycle/window summaries and create dialog.
app/admin/reservations/reservation-event-form.tsx Shared create/edit event form with hydration-safe datetime-local behavior.
app/admin/reservations/reservation-event-list.test.tsx Tests covering organizer reservation event list/layout/nav/form flows.
app/admin/reservations/audit/page.tsx Global reservation audit page with canonical page normalization.
app/admin/reservations/audit/audit-pagination.ts Utilities for parsing/normalizing audit pagination query params.
app/admin/reservations/audit/audit-pages.test.tsx Tests for pagination normalization for global + event audit pages.
app/admin/reservations/audit/audit-list.tsx Audit list UI with expandable JSON details and pagination integration.
app/admin/reservations/audit/audit-list.test.tsx Tests for audit list rendering, details expansion, and page navigation URL updates.
app/admin/reservations/[eventId]/layout.tsx Organizer event workspace layout (status badge, participant preview link, nav).
app/admin/reservations/[eventId]/page.tsx Organizer event overview route.
app/admin/reservations/[eventId]/event-overview.tsx Organizer event overview UI (edit, archive/restore/delete lifecycle).
app/admin/reservations/[eventId]/reservation-event-nav.tsx Workspace navigation tabs for overview/tables/assignments/audit.
app/admin/reservations/[eventId]/preview/page.tsx Organizer-only read-only participant preview for an event.
app/admin/reservations/[eventId]/preview/page.test.tsx Tests for preview behavior and notFound handling.
app/admin/reservations/[eventId]/audit/page.tsx Per-event audit page with canonical page normalization.
app/admin/reservations/[eventId]/tables/page.tsx Organizer tables management route loader.
app/admin/reservations/[eventId]/tables/table-management.tsx Organizer UI for bulk count changes, table creation, renumbering, and safe deletion.
app/admin/reservations/[eventId]/tables/table-management.test.tsx Tests for table-management behaviors and server wiring.
app/admin/reservations/[eventId]/assignments/page.tsx Organizer assignments management route loader.
app/admin/reservations/[eventId]/assignments/assignment-management.tsx Organizer assignment map UI supporting move/swap/displace/unassign.
app/admin/reservations/[eventId]/assignments/assignment-management.test.tsx Tests for organizer assignment interactions, confirmations, and pending/archived behavior.
docs/superpowers/specs/2026-07-12-how-to-mcp-page-design.md Removes obsolete MCP docs design spec.
docs/superpowers/plans/2026-07-12-how-to-mcp-page.md Removes obsolete MCP docs implementation plan.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread components/reservation/reservation-board.tsx
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

4 participants