Repository navigation
feat(report): ICPC standings export (#89) - #92
Merged
Merged
Conversation
Closes #89. `users.icpc_id` has existed since 2025_11_25_000007 and nothing used it -- not one reference in the codebase, and no form that could set it. BOCA produces the file it exists for in src/admin/report/icpc.php: one CSV line per team, in final standings order, usericpcid, placement, solved, total time, first solve This is not the webcast export of #44. That one streams a live scoreboard to a ceremony display; this is the record of what happened, and its consumer is a person filing results with a regional. Three surfaces, because filing results happens in more than one way: - `IcpcReportBuilder` holds the logic, reading Leaderboard::getScoreboard() -- the same source the public scoreboard uses, including #76's getContestTime() sign fix, without which every time here would be negative. - `GET /api/frontend/contests/{contest}/icpc-report` for the browser: admin session, text/csv attachment, no-store. - `php artisan contest:icpc-report {contest} [--output=]` for the contest host at 2am over ssh, which is where this usually actually happens. Teams still missing an icpc_id are reported rather than enforced: BOCA files the report with the column blank, and an organiser may well be exporting before the ids are in. The command names them, the endpoint counts them in X-Icpc-Teams-Missing-Id. Either way you learn it before sending the file, not after. The practice contest (#43) is refused by both: it is not an event and has no standings, and it must not be reachable through an event-shaped export. `icpc_id` is now settable on the backend user form, which is the only place a contest account is created outside the specced managed-accounts API. Adding it there too would change #47's frontend contract, so that is left alone. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Pvf2R8xtgbWQm1wRvjBqQY
This was referenced Sep 13, 2026
matbrgz
added a commit
that referenced
this pull request
Sep 13, 2026
…ted (#100) (#105) Closes #100. UserController had index(), store() and destroy() and nothing in between. Any mistake in a registration could only be fixed by deleting the account -- which cascades to its runs, scores, tasks and logs, with no undo. Name, email, username, user_type, site, is_enabled and icpc_id were all uncorrectable once saved. The last one was concrete: #92 added icpc_id to the create form, so an account that already existed had no way to receive one, and that is the exact column contest:icpc-report needs filled on every team. The command lists who is missing it precisely so an organiser can fill them in, and there was nowhere to do it. Editing keeps the row, so everything pointing at it survives. A blank password means "leave it alone" rather than "set an empty password", and the contest follows the chosen site exactly as it does on create. Two guards, on both edit and delete, because there is no second screen to undo either from: - You cannot disable or delete your own account. - The last admin cannot be demoted or deleted. destroy() had no guard at all before this: deleting the only admin was one confirm dialog away. Also makes icpc_id fillable on the User model. It has existed since 2025_11_25_000007 and was never in $fillable, so an Eloquent update dropped it silently -- the create path writes through the query builder, which is why #92 worked and this did not until now. Thirteen tests, including the two mistakes that would otherwise pass review: saving a user without changing their username must not collide with their own record, and another account's username must still be refused. Claude-Session: https://claude.ai/code/session_01Pvf2R8xtgbWQm1wRvjBqQY Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Fecha a #89.
users.icpc_idexiste desde2025_11_25_000007e nada o usava — nenhuma referência no código, e nenhum formulário que o preenchesse. O BOCA produz o arquivo para o qual ele existe emsrc/admin/report/icpc.php: uma linha CSV por equipe, na ordem da classificação final.Não é a exportação de webcast da #44. Aquela transmite o placar ao vivo para o telão; esta é o registro do que aconteceu, e o consumidor é uma pessoa prestando contas para a regional.
Três superfícies
IcpcReportBuilderLeaderboard::getScoreboard()— a mesma fonte do placar público, incluindo a correção de sinal dogetContestTime()da #76, sem a qual todo tempo aqui sairia negativoGET /api/frontend/contests/{contest}/icpc-reporttext/csvcomo anexo,no-storephp artisan contest:icpc-report {id} [--output=]Equipes sem
icpc_idReportadas, não barradas. O BOCA emite o relatório com a coluna em branco, e o organizador pode legitimamente estar exportando antes de preencher os ids. O comando lista os nomes; o endpoint conta no header
X-Icpc-Teams-Missing-Id. Dos dois jeitos você descobre antes de mandar o arquivo, não depois.Treino Livre
Recusado pelos dois caminhos (404 no endpoint, falha no comando). Não é evento, não tem classificação, e não pode ser alcançável por uma exportação com formato de evento.
Preenchimento do campo
icpc_idpassa a ser preenchível no formulário de usuário do backend — o único lugar onde uma conta de competição é criada fora da API de contas geridas. Adicionar lá também mudaria o contrato de frontend da #47, então deixei quieto; vale uma nota na #47 se for desejado.Testes
11 novos: layout das cinco colunas na ordem da classificação, primeiro AC como o mínimo entre os resolvidos (não o último, não o total),
0para quem não resolveu nada, vírgula no id que não desloca coluna, listagem de quem está sem id, 401/403/404, e os três modos do comando. Suíte: 736 verdes.🤖 Generated with Claude Code
https://claude.ai/code/session_01Pvf2R8xtgbWQm1wRvjBqQY