aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/db/models.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-18 22:38:15 +0900
committernsfisis <nsfisis@gmail.com>2026-02-18 22:38:15 +0900
commit9f9efc2bc07810d2e06b37bad94e5922681eadef (patch)
tree79bcce2bf065a7ea282aa7855822c3bdee92ee7c /backend/db/models.go
parentc095200dc79f24c0cd17a2e3ba15c85a2971ea9a (diff)
downloadphperkaigi-2026-albatross-9f9efc2bc07810d2e06b37bad94e5922681eadef.tar.gz
phperkaigi-2026-albatross-9f9efc2bc07810d2e06b37bad94e5922681eadef.tar.zst
phperkaigi-2026-albatross-9f9efc2bc07810d2e06b37bad94e5922681eadef.zip
feat: refactor tournament to generic DB-backed N-person bracket
Replace hardcoded 6-person tournament with a generic single-elimination bracket system backed by new DB tables (tournaments, tournament_entries, tournament_matches). Includes admin CRUD, standard seeding algorithm, bye handling, and a CSS Grid bracket renderer on the frontend. Add comprehensive tests for backend API/admin handlers, seeding logic, and frontend bracket component. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/db/models.go')
-rw-r--r--backend/db/models.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/backend/db/models.go b/backend/db/models.go
index c4a713d..3086c3b 100644
--- a/backend/db/models.go
+++ b/backend/db/models.go
@@ -74,6 +74,29 @@ type TestcaseResult struct {
CreatedAt pgtype.Timestamp
}
+type Tournament struct {
+ TournamentID int32
+ DisplayName string
+ BracketSize int32
+ NumRounds int32
+ CreatedAt pgtype.Timestamp
+}
+
+type TournamentEntry struct {
+ TournamentEntryID int32
+ TournamentID int32
+ UserID int32
+ Seed int32
+}
+
+type TournamentMatch struct {
+ TournamentMatchID int32
+ TournamentID int32
+ Round int32
+ Position int32
+ GameID *int32
+}
+
type User struct {
UserID int32
Username string