Skip to content

[Backend] — Ranked event leaderboard (replaces binary "winners" model) #956

@Olowodarey

Description

@Olowodarey

Background

There is currently no points-based leaderboard. The closest things that
exist are:

  • getParticipants() in `creator-events.service.

Goal

Add a GET /creator-events/:id/leaderboard endpoint backed by the new
contract view (with a DB-cached fallback populated by Issue 6's
EventFinalized handler for finalized events), replacing the unused
winners-query.dto.ts / WinnerResponse model.

Tasks

  1. ContractService (src/contract/contract.service.ts): add
  2. New entity src/matches/entities/creator-event-leaderboard-entry.entity.ts
  3. Migration: <timestamp>-CreateCreatorEventLeaderboardEntry.ts.
  4. Rewrite src/creator-events/dto/leaderboard-query.dto.ts to match the
  5. New service method getLeaderboard() in creator-events.service.ts:
    • If event.is_finalized (from the cached CreatorEvent row) → read
    • Otherwise → call contractService.getEventLeaderboard(eventId) (live),
  6. New endpoint in creator-events.controller.ts:

Acceptance Criteria

  • GET /creator-events/:id/leaderboard?page=1&limit=20 returns a
  • For a non-finalized event, the response reads live from
  • For a finalized event, the response reads from
  • winners-query.dto.ts and all ContractWinner/getEventWinners

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions