feat(admin): add reservation trends analytics page#44
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/reservations/trendspage in the admin with charts for daily bookings, peak days of week, party-size distribution, status breakdown, booking lead time, and hourly distribution.GET /api/reservations/analyticsendpoint using Prisma aggregations plus raw SQL for date-binning, mirroring the existing dashboard analytics pattern.Closes one of the post-pitch asks from Moksha (analytics on booking patterns).
Test plan
🤖 Generated with Claude Code