-
Notifications
You must be signed in to change notification settings - Fork 2
feat(events): Add company event stats and full registrations management system #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nt dashboard and refine the stats card layout.
…fetching, filtering, searching, updating, and exporting registrations, alongside a new dashboard page.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request introduces comprehensive event registration management functionality. It adds a CSV export endpoint for registrations, creates a new API route for retrieving and updating event registrations with filtering and search capabilities, and builds a new dashboard page for viewing and managing registrations with inline status updates and CSV export functionality. The events dashboard is also updated to display registration counts and total views. Changes
Sequence DiagramssequenceDiagram
participant User
participant Dashboard as Registrations Page
participant API as API Routes
participant DB as Supabase
User->>Dashboard: Load registrations page
Dashboard->>API: GET /events/[slug]/registrations?search=...&status=...
API->>DB: Authenticate & verify authorization
alt Unauthorized
API-->>Dashboard: 401/403
else Authorized
API->>DB: Query master_registrations filtered
DB-->>API: Registrations + user profiles
API->>DB: Enrich with profile data
API-->>Dashboard: Registrations array + metadata
Dashboard-->>User: Display table with registrations
end
User->>Dashboard: Update registration status
Dashboard->>API: PATCH /events/[slug]/registrations
API->>DB: Verify user authorization
API->>DB: Update master_registrations record
DB-->>API: Updated registration
API-->>Dashboard: Success response
Dashboard->>Dashboard: Refresh registrations list
User->>Dashboard: Export registrations
Dashboard->>API: GET /events/[slug]/registrations/export
API->>DB: Verify auth & fetch registrations
API->>API: Build CSV from registrations
API-->>Dashboard: CSV file (blob)
Dashboard->>User: Download CSV file
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR delivers two major enhancements to the company events module:
Both features are now integrated seamlessly into the company dashboard.
📊 1. Event Statistics: Views & Registrations
New Capabilities
UI Enhancements
📝 2. Event Registrations Management System
New API Endpoints
GET /api/events/[slug]/registrations
PATCH /api/events/[slug]/registrations
GET /api/events/[slug]/registrations/export
🎨 Frontend: Registrations Management UI
Added page
/dashboard/company/[slug]/events/[eventSlug]/registrationsFeatures
Stats card for total registrations
Search input
Status + Payment filters
Responsive table with detailed participant info:
Actions dropdown to update status
Export CSV button
Loading and empty states
Back navigation
Events list update
registeredcolumn is now a clickable link when count > 0🗄️ Database Integration
Uses existing master_registrations table:
activity_type = 'event')activity_id🔐 Authorization
📁 Files Added
app/api/events/[slug]/registrations/route.tsapp/api/events/[slug]/registrations/export/route.tsapp/dashboard/company/[slug]/events/[eventSlug]/registrations/page.tsxFiles Modified
app/dashboard/company/[slug]/events/page.tsx🚀 Next Improvements (Optional)
✅ Summary
This PR significantly improves the company event experience by:
Authored by: @akshay0611
Summary by CodeRabbit