Skip to content

feat: add GET /events/trending — top events by scan velocity in the last 24 hours #160

@BigBen-7

Description

@BigBen-7

Description

Ticket buyers want to know what events are "hot right now". Scan velocity (scans per hour in the last 24 hours) is a strong proxy for demand and a useful discovery surface.

Requirements & context

  • GET /events/trending?limit=10 (public, no auth)
  • Queries ticket_scans grouped by event_id, counting scans in the last 24 hours, ordered descending
  • Returns: { "events": [ { "event_id", "scan_count_24h", "rank" } ], "generated_at" }
  • Join with event_sales_summary to include event_name in the response
  • Cache for 10 minutes — trending data does not need to be real-time
  • Write tests with seeded scan data

Suggested execution

git checkout -b feat/trending-events-endpoint
  • Add get_trending_events(limit, hours) to AnalyticsService
  • Add route to src/main.py
  • Write tests

Guidelines

  • PR must include: Closes #[issue_id]
  • Timeframe: 48 hours

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or improvementsearchSearch and recommendations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions