Skip to content

[CU-86e1jnzkv]: ranking reports — include projectCode, admin/public endpoints, Spanish Excel export - #145

Merged
isaAJ05 merged 4 commits into
devfrom
CU-86e1jnzkv/Event-Service-Ranking-report-endpoint-with-ExcelJSON-export
May 30, 2026
Merged

[CU-86e1jnzkv]: ranking reports — include projectCode, admin/public endpoints, Spanish Excel export#145
isaAJ05 merged 4 commits into
devfrom
CU-86e1jnzkv/Event-Service-Ranking-report-endpoint-with-ExcelJSON-export

Conversation

@isaAJ05

@isaAJ05 isaAJ05 commented May 29, 2026

Copy link
Copy Markdown
Contributor
  • Implemented in the gateway the recommended approach (separate admin and public endpoints).
  • Endpoints support JSON and downloadable XLSX and apply ranking ordering, tie-break rules, and visibility constraints.

What’s included (ready)

  • Admin endpoint
    • GET /events/:eventId/rankings
    • Requires permission: manage:events
    • Returns full ranking (all positions and grades)
  • Public endpoint
    • GET /events/:eventId/rankings/public
    • No authentication required
    • Returns 403 when visible_public is false
    • Applies positions limit from ranking configuration
    • Hides grades/average when grade_visible is false

Query parameters supported

  • format: json or excel (downloadable .xlsx)
  • categoryId (optional)
  • category_id (optional alias)

Ordering & tie-breaks

  • Primary: averageGrade (descending)
  • Tie-break: tiebreakOrder from TieBreaks table (lower wins)
  • Fallback: stable lexical by projectName then projectId

Excel export behavior

  • Downloadable .xlsx when format=excel
  • Column order (Spanish): Posición, Código, Proyecto, Categoría, Participantes, Calificaciones, Puntaje Final
  • For public exports with grade_visible=false, grade columns and average are returned empty
  • The export uses a stable header+autofilter layout, header frozen, styled header row (blue), centered Código/Posición columns — avoids previous Excel repair issues

Files of interest

  • events.service.ts
  • events.controller.ts

Notes

  • Non-breaking API additions: projectCode added to ranking result.
  • Route rename: PATCH ranking-config/:idupdate-ranking-config/:id (update consumers/docs).

@isaAJ05
isaAJ05 requested review from a team and MrManini May 29, 2026 09:50
@J-Povea21

Copy link
Copy Markdown
Collaborator

@MrManini MrManini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@isaAJ05
isaAJ05 merged commit 0c0a787 into dev May 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants