Skip to content

feat(admin): add reservation trends analytics page#44

Merged
mighty840 merged 2 commits into
mainfrom
feat/reservation-trends
May 14, 2026
Merged

feat(admin): add reservation trends analytics page#44
mighty840 merged 2 commits into
mainfrom
feat/reservation-trends

Conversation

@mighty840
Copy link
Copy Markdown
Owner

Summary

  • Adds a new /reservations/trends page in the admin with charts for daily bookings, peak days of week, party-size distribution, status breakdown, booking lead time, and hourly distribution.
  • Supports 7/14/30/60/90-day windows and per-location filtering.
  • Backed by a new staff-only GET /api/reservations/analytics endpoint using Prisma aggregations plus raw SQL for date-binning, mirroring the existing dashboard analytics pattern.
  • Adds the link as a sub-item under the existing Reservations nav entry ("All Reservations" / "Trends").

Closes one of the post-pitch asks from Moksha (analytics on booking patterns).

Test plan

  • Log in to the admin panel
  • Navigate to Reservations → Trends
  • Confirm all six charts render and the summary cards populate
  • Switch between 7d/14d/30d/60d/90d — charts re-fetch
  • If multiple locations exist, the location filter appears and filters results
  • With no data in the window, charts show "No reservations in this window."

🤖 Generated with Claude Code

mighty840 and others added 2 commits May 14, 2026 12:03
Adds a new /reservations/trends page with charts for booking patterns,
peak days of week, party-size distribution, status breakdown, lead-time
buckets, and hourly distribution. Supports 7/14/30/60/90-day windows
and per-location filtering. Backed by a new staff-only
GET /api/reservations/analytics endpoint that uses Prisma aggregations
plus raw SQL for date-binning, matching the existing dashboard
analytics pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds auth checks (401, 403) and a happy-path test verifying the
GET /api/reservations/analytics response shape — summary, daily
bookings, day-of-week, party-size, status, hourly, and lead-time
buckets.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mighty840 mighty840 merged commit a4e32a1 into main May 14, 2026
8 checks passed
@mighty840 mighty840 deleted the feat/reservation-trends branch May 14, 2026 11:23
@mighty840 mighty840 mentioned this pull request May 14, 2026
2 tasks
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