aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/game/service.go
AgeCommit message (Collapse)Author
2026-03-20fix(game): allow participants to view watch states after game finishesnsfisis
Previously GetWatchLatestStates returned ErrForbidden for participants regardless of game state. Now checks whether the game has finished and permits access once complete. Also fixes config test env var cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28feat(admin): allow admin users to view and submit code before game startsnsfisis
Admin users can now access the gaming UI (problem description, code editor, submit button) even when a game has not started yet. Regular users still see the waiting screen as before. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21refactor: rename stuttering exported types in game and tournament packagesnsfisis
Fix golangci-lint revive warnings by removing package name prefixes: - game.GameHubInterface → game.HubInterface - game.GameDetail → game.Detail - tournament.TournamentEntry → tournament.Entry - tournament.TournamentMatch → tournament.Match - tournament.TournamentBracket → tournament.Bracket - tournament.TournamentEditData → tournament.EditData Also fix gofmt alignment in api/convert.go and gosimple S1016 in game/service.go. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21refactor(admin): separate business logic into game and tournament servicesnsfisis
Move transaction handling, rejudge workflow, tournament bracket creation, and data repair logic from admin handler into game.Service and tournament.Service, mirroring the earlier api package separation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21refactor(api): separate business logic into game, tournament, session packagesnsfisis
Extract business logic from api/handler.go into dedicated service packages: - session: context helpers (resolves admin → api import dependency) - game: game state, code submission, ranking, watch logic - tournament: bracket construction and seed ordering - api/convert.go: domain → API type conversion functions api/handler.go is now a thin adapter that delegates to services and maps domain errors to HTTP status codes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>