Commit 5e8992bf authored by Mahmoud Aglan's avatar Mahmoud Aglan

feat(routes): every big-tournament hosting route, answering 404 until its module lands

The 73 routes of the hosting spec (section 5.4): stages, cut review, schedule
and bracket actions in tournaments; the form builder, registrations and the
check-in desk, prizes and exports; presentation, sponsors, the link panel,
announcement notify, the venue screen and the boards feed in live-tournaments;
the sponsor library; teams and lineups; the arbiter console; club CSV import
and the org dashboard.

The Router already answers 404 for a module without a controller and for a
missing action, so no guard was needed: probed through the real Router, all
73 answer 404, each resolves to its own module and action, and no existing
route changed. Static segments sit above their {param} siblings, and the
staff-only live-tournaments actions keep the admin prefix the Router uses to
require a login.
Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 03d14d20
......@@ -131,12 +131,86 @@ return [
'tournaments/{id}/arena/pair' => ['module' => 'tournaments', 'action' => 'arenaPair'],
'tournaments/{id}/arena/result' => ['module' => 'tournaments', 'action' => 'arenaResult'],
// ── Big-tournament hosting (docs/tournament-hosting-contract.md, section 7) ──
// A route whose module or action has not been merged yet answers 404: the
// Router checks the controller file and the method before calling either.
// Keep a static segment (bulk, desk, store...) above its {param} sibling.
// Stages, schedule, bracket actions (P8)
'tournaments/{id}/stages' => ['module' => 'tournaments', 'action' => 'stages'],
'tournaments/{id}/stages/save' => ['module' => 'tournaments', 'action' => 'saveStages'],
'tournaments/{id}/stages/{n}/cut' => ['module' => 'tournaments', 'action' => 'stageCut'],
'tournaments/{id}/stages/{n}/cut/adjust' => ['module' => 'tournaments', 'action' => 'stageCutAdjust'],
'tournaments/{id}/stages/{n}/cut/confirm' => ['module' => 'tournaments', 'action' => 'stageCutConfirm'],
'tournaments/{id}/stages/{n}/start' => ['module' => 'tournaments', 'action' => 'stageStart'],
'tournaments/{id}/schedule' => ['module' => 'tournaments', 'action' => 'schedule'],
'tournaments/{id}/schedule/save' => ['module' => 'tournaments', 'action' => 'saveSchedule'],
'tournaments/{id}/bracket/matches/{matchId}/decide' => ['module' => 'tournaments', 'action' => 'bracketDecide'],
'tournaments/{id}/bracket/matches/{matchId}/tiebreak' => ['module' => 'tournaments', 'action' => 'bracketTiebreak'],
'tournaments/{id}/bracket/matches/{matchId}/reopen' => ['module' => 'tournaments', 'action' => 'bracketReopen'],
// Registration form builder (P9)
'tournaments/{id}/form' => ['module' => 'tournament-forms', 'action' => 'index'],
'tournaments/{id}/form/copy' => ['module' => 'tournament-forms', 'action' => 'copy'],
'tournaments/{id}/form/fields/store' => ['module' => 'tournament-forms', 'action' => 'storeField'],
'tournaments/{id}/form/fields/reorder' => ['module' => 'tournament-forms', 'action' => 'reorder'],
'tournaments/{id}/form/fields/{fieldId}/update' => ['module' => 'tournament-forms', 'action' => 'updateField'],
'tournaments/{id}/form/fields/{fieldId}/archive' => ['module' => 'tournament-forms', 'action' => 'archiveField'],
// Registrations and the check-in desk (P9)
'tournaments/{id}/registrations' => ['module' => 'tournament-registrations', 'action' => 'list'],
'tournaments/{id}/registrations/bulk' => ['module' => 'tournament-registrations', 'action' => 'bulk'],
'tournaments/{id}/registrations/desk' => ['module' => 'tournament-registrations', 'action' => 'desk'],
'tournaments/{id}/registrations/seeds/save' => ['module' => 'tournament-registrations', 'action' => 'saveSeeds'],
'tournaments/{id}/registrations/{regId}' => ['module' => 'tournament-registrations', 'action' => 'show'],
'tournaments/{id}/registrations/{regId}/answers/update' => ['module' => 'tournament-registrations', 'action' => 'updateAnswers'],
'tournaments/{id}/registrations/{regId}/file/{fieldId}' => ['module' => 'tournament-registrations', 'action' => 'file'],
// Prizes and categories (P9)
'tournaments/{id}/prizes' => ['module' => 'tournament-prizes', 'action' => 'index'],
'tournaments/{id}/prizes/release' => ['module' => 'tournament-prizes', 'action' => 'release'],
'tournaments/{id}/prizes/recompute' => ['module' => 'tournament-prizes', 'action' => 'recompute'],
'tournaments/{id}/prizes/categories/store' => ['module' => 'tournament-prizes', 'action' => 'storeCategory'],
'tournaments/{id}/prizes/categories/{catId}/update' => ['module' => 'tournament-prizes', 'action' => 'updateCategory'],
'tournaments/{id}/prizes/categories/{catId}/delete' => ['module' => 'tournament-prizes', 'action' => 'deleteCategory'],
// Exports: trf, pgn, standings.csv, registrations.csv, registrations.xlsx, teams.csv, crosstable (P9)
'tournaments/{id}/exports' => ['module' => 'tournament-exports', 'action' => 'index'],
'tournaments/{id}/exports/{format}' => ['module' => 'tournament-exports', 'action' => 'download'],
// Teams and lineups (P11)
'tournaments/{id}/teams' => ['module' => 'tournament-teams', 'action' => 'list'],
'tournaments/{id}/teams/store' => ['module' => 'tournament-teams', 'action' => 'store'],
'tournaments/{id}/teams/from-orgs' => ['module' => 'tournament-teams', 'action' => 'fromOrgs'],
'tournaments/{id}/teams/{teamId}' => ['module' => 'tournament-teams', 'action' => 'show'],
'tournaments/{id}/teams/{teamId}/update' => ['module' => 'tournament-teams', 'action' => 'update'],
'tournaments/{id}/teams/{teamId}/lineup' => ['module' => 'tournament-teams', 'action' => 'lineup'],
'tournaments/{id}/teams/{teamId}/withdraw' => ['module' => 'tournament-teams', 'action' => 'withdraw'],
// Arbiter console and the event report (P11)
'tournaments/{id}/console' => ['module' => 'tournament-arbiter', 'action' => 'console'],
'tournaments/{id}/console/action' => ['module' => 'tournament-arbiter', 'action' => 'action'],
'tournaments/{id}/console/disputes' => ['module' => 'tournament-arbiter', 'action' => 'disputes'],
'tournaments/{id}/console/disputes/{did}/decide' => ['module' => 'tournament-arbiter', 'action' => 'decideDispute'],
'tournaments/{id}/console/fair-play' => ['module' => 'tournament-arbiter', 'action' => 'fairPlay'],
'tournaments/{id}/console/check-in' => ['module' => 'tournament-arbiter', 'action' => 'checkIn'],
'tournaments/{id}/console/report' => ['module' => 'tournament-arbiter', 'action' => 'report'],
'tournaments/{id}/console/forbidden-pairs' => ['module' => 'tournament-arbiter', 'action' => 'forbiddenPairs'],
'api/tournaments/{id}/console/boards' => ['module' => 'tournament-arbiter', 'action' => 'apiBoards'],
// Tournaments - JSON API (AJAX)
'api/tournaments/{id}/standings' => ['module' => 'tournaments', 'action' => 'apiStandings'],
'api/tournaments/{id}/pairings/{roundId}' => ['module' => 'tournaments', 'action' => 'apiPairings'],
'api/tournaments/{id}/bracket' => ['module' => 'tournaments', 'action' => 'apiBracket'],
'api/tournaments/{id}/arena' => ['module' => 'tournaments', 'action' => 'apiArena'],
// Club CSV import (P11). Exact routes, matched before organizations/{id}.
'organizations/import' => ['module' => 'org-import', 'action' => 'index'],
'organizations/import/preview' => ['module' => 'org-import', 'action' => 'preview'],
'organizations/import/commit' => ['module' => 'org-import', 'action' => 'commit'],
'organizations/import/{batch}/codes.csv' => ['module' => 'org-import', 'action' => 'codesCsv'],
'organizations/import/{batch}/posters' => ['module' => 'org-import', 'action' => 'posters'],
// Organizations
'organizations' => ['module' => 'organizations', 'action' => 'list'],
'organizations/create' => ['module' => 'organizations', 'action' => 'create'],
......@@ -154,6 +228,9 @@ return [
'organizations/{id}/members/{memberId}/action' => ['module' => 'organizations', 'action' => 'memberAction'],
'organizations/{id}/suspend' => ['module' => 'organizations', 'action' => 'suspend'],
// Org dashboard (P11)
'organizations/{id}/dashboard' => ['module' => 'org-dashboard', 'action' => 'show'],
// Economy
'economy' => ['module' => 'economy', 'action' => 'index'],
'economy/transactions' => ['module' => 'economy', 'action' => 'transactions'],
......@@ -440,6 +517,8 @@ return [
'live/{id}/bracket' => ['module' => 'live-tournaments', 'action' => 'bracketPage'],
'live/{id}/players' => ['module' => 'live-tournaments', 'action' => 'playersPage'],
'live/{id}/print' => ['module' => 'live-tournaments', 'action' => 'printView'],
// Venue screen (P10). Public: any live-tournaments action not named admin* skips auth.
'live/{id}/screen' => ['module' => 'live-tournaments', 'action' => 'screen'],
// Live Tournaments - Public API (no auth, JSON)
'api/live/{id}/data' => ['module' => 'live-tournaments', 'action' => 'apiData'],
......@@ -450,6 +529,7 @@ return [
'api/live/{id}/announcements' => ['module' => 'live-tournaments', 'action' => 'apiAnnouncements'],
'api/live/{id}/results' => ['module' => 'live-tournaments', 'action' => 'apiResults'],
'api/live/{id}/track' => ['module' => 'live-tournaments', 'action' => 'apiTrack'],
'api/live/{id}/boards' => ['module' => 'live-tournaments', 'action' => 'apiBoards'],
// Live Tournaments - Admin (auth required)
'tournaments/{id}/live-settings' => ['module' => 'live-tournaments', 'action' => 'adminSettings'],
......@@ -468,6 +548,29 @@ return [
'tournaments/{id}/live-settings/media/{mediaId}/delete' => ['module' => 'live-tournaments', 'action' => 'adminDeleteMedia'],
'tournaments/{id}/live-settings/analytics' => ['module' => 'live-tournaments', 'action' => 'adminAnalytics'],
// Presentation, sponsors, link and announcements (P10). Staff only: these
// actions must keep the admin prefix (the Router serves the others publicly).
// {sid} is a tournament_sponsorships id, {kind} a tournament_media kind.
'tournaments/{id}/live-settings/presentation' => ['module' => 'live-tournaments', 'action' => 'adminPresentation'],
'tournaments/{id}/live-settings/presentation/upload' => ['module' => 'live-tournaments', 'action' => 'adminUploadPresentation'],
'tournaments/{id}/live-settings/presentation/{kind}/delete' => ['module' => 'live-tournaments', 'action' => 'adminDeletePresentation'],
'tournaments/{id}/live-settings/sponsors' => ['module' => 'live-tournaments', 'action' => 'adminSponsors'],
'tournaments/{id}/live-settings/sponsors/attach' => ['module' => 'live-tournaments', 'action' => 'adminAttachSponsor'],
'tournaments/{id}/live-settings/sponsors/{sid}/update' => ['module' => 'live-tournaments', 'action' => 'adminUpdateSponsorship'],
'tournaments/{id}/live-settings/sponsors/{sid}/detach' => ['module' => 'live-tournaments', 'action' => 'adminDetachSponsor'],
'tournaments/{id}/live-settings/links' => ['module' => 'live-tournaments', 'action' => 'adminLinks'],
'tournaments/{id}/live-settings/links/code' => ['module' => 'live-tournaments', 'action' => 'adminCreateLinkCode'],
'tournaments/{id}/live-settings/announcements/{annId}/update' => ['module' => 'live-tournaments', 'action' => 'adminUpdateAnnouncement'],
'tournaments/{id}/live-settings/announcements/{annId}/notify' => ['module' => 'live-tournaments', 'action' => 'adminNotifyAnnouncement'],
// Sponsor library (P10)
'sponsors' => ['module' => 'sponsors', 'action' => 'list'],
'sponsors/create' => ['module' => 'sponsors', 'action' => 'create'],
'sponsors/store' => ['module' => 'sponsors', 'action' => 'store'],
'sponsors/{id}/edit' => ['module' => 'sponsors', 'action' => 'edit'],
'sponsors/{id}/update' => ['module' => 'sponsors', 'action' => 'update'],
'sponsors/{id}/archive' => ['module' => 'sponsors', 'action' => 'archive'],
// Org Announcements
'organizations/{id}/announcements' => ['module' => 'org-announcements', 'action' => 'list'],
'organizations/{id}/announcements/create' => ['module' => 'org-announcements', 'action' => 'create'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment