Ticket 1.1: Backend API For Jury Movie Assignment

by Jule 50 views
Ticket 1.1: Backend API For Jury Movie Assignment

Creating a secure, precise endpoint where jury members view only their assigned films isn’t just a technical task - it’s a cultural checkpoint. The demand for this feature exploded after a viral TikTok series exposed how opaque film selection can breed distrust in selection panels.

At its core, this route must do three things: authenticate, authorize, and deliver. Here’s the breakdown:

  • A GET /api/jury/movies endpoint acts as the gateway.
  • Middleware requireAuth('jury') ensures only verified jurors proceed.
  • The controller extracts the user’s ID from the token and delegates to a service.
  • The service runs a secure SQL query filtering films by jury assignment.

Psychologically, this system taps into a universal need for fairness and visibility - people want to see their work genuinely considered, not just checked off. Think of it like a backstage pass: you’re in, but only what matters is visible.

Hidden truths: many developers overlook error handling for unassigned films - leaving users confused. Also, middleware misconfigurations often expose access logs. Don’t skip input validation.

Ticket 1.1: Ensure the service returns a clean 200 with a filtered films array - or return 403 fast if unauthorized. Safety and clarity aren’t optional. Do you trust your system to handle both?