Feat/organizer dashboard - #94
Merged
Merged
Conversation
Add GET /api/organizer/events — the organizer dashboard landing. Returns the caller's events (status-filterable, paginated, newest-first) each with per-event and per-ticket-type stats (sold, available, revenue, checked-in), plus a top-level summary across ALL their events. Stats are derived with grouped aggregations (event.count, ticket.groupBy by type+status, ticketType price lookup) — no ticket rows loaded into memory. "Sold" = CONFIRMED|USED, "checkedIn" = USED, revenue = sold x current type price. 4 unit tests cover stat derivation, status exclusion, filter/pagination passthrough, and the empty-organizer case.
Add GET /api/organizer/events/:id/analytics (owner or admin; 404/403 guarded). Returns overview KPIs (revenue, sold, available, checked-in, check-in rate, avg ticket price), gap-filled daily sales for charting, and breakdowns by ticket type, payment provider, and payment channel. Revenue/provider/channel are derived from SUCCESS transactions (channel read from metadata, persisted at settlement); sold/check-in counts from ticket.groupBy. Daily series is zero-filled from the first sale day to today so the chart has no date holes. 7 unit tests cover auth, KPI/ breakdown math, gap-fill, unknown-channel bucketing, and the no-sales case.
Add two owner/admin endpoints for an event's attendees:
- GET /organizer/events/:id/attendees — paginated roster (default 50,
max 200) filterable by status, ticketTypeId, and name/email search
(case-insensitive), with event-wide summary counts (total, confirmed,
checked-in, cancelled).
- GET /organizer/events/:id/attendees/export — full CSV download with
RFC-4180 escaping and a {slug}-attendees.csv filename.
Plumbing: add a @SkipTransform() decorator + Reflector check in
TransformInterceptor so the CSV route returns its raw body instead of
the {success,data} envelope (wired via app.get(Reflector) in main.ts).
shared assertEventAccess() guards both endpoints (404/403).
8 tests cover auth, row mapping, summary counts, filter passthrough, and
CSV header/escaping/filename.
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.
closes #43
closes #44
closes #45