added finals forfeits
This commit is contained in:
@@ -81,12 +81,18 @@ type PlayoffSeries struct {
|
||||
LoserNextSlot *string `bun:"loser_next_slot"` // "team1" or "team2" in loser's next series
|
||||
CreatedAt int64 `bun:",notnull"`
|
||||
|
||||
Bracket *PlayoffBracket `bun:"rel:belongs-to,join:bracket_id=id"`
|
||||
Team1 *Team `bun:"rel:belongs-to,join:team1_id=id"`
|
||||
Team2 *Team `bun:"rel:belongs-to,join:team2_id=id"`
|
||||
Winner *Team `bun:"rel:belongs-to,join:winner_team_id=id"`
|
||||
Loser *Team `bun:"rel:belongs-to,join:loser_team_id=id"`
|
||||
Matches []*PlayoffMatch `bun:"rel:has-many,join:id=series_id"`
|
||||
// Forfeit-related fields
|
||||
IsForfeit bool `bun:"is_forfeit,default:false"`
|
||||
ForfeitTeamID *int `bun:"forfeit_team_id"` // Which team forfeited
|
||||
ForfeitReason *string `bun:"forfeit_reason"` // Admin-provided reason
|
||||
|
||||
Bracket *PlayoffBracket `bun:"rel:belongs-to,join:bracket_id=id"`
|
||||
Team1 *Team `bun:"rel:belongs-to,join:team1_id=id"`
|
||||
Team2 *Team `bun:"rel:belongs-to,join:team2_id=id"`
|
||||
Winner *Team `bun:"rel:belongs-to,join:winner_team_id=id"`
|
||||
Loser *Team `bun:"rel:belongs-to,join:loser_team_id=id"`
|
||||
ForfeitTeam *Team `bun:"rel:belongs-to,join:forfeit_team_id=id"`
|
||||
Matches []*PlayoffMatch `bun:"rel:has-many,join:id=series_id"`
|
||||
}
|
||||
|
||||
// PlayoffMatch represents a single game within a series
|
||||
@@ -344,6 +350,7 @@ func GetPlayoffSeriesByID(
|
||||
Relation("Team2").
|
||||
Relation("Winner").
|
||||
Relation("Loser").
|
||||
Relation("ForfeitTeam").
|
||||
Relation("Matches", func(q *bun.SelectQuery) *bun.SelectQuery {
|
||||
return q.Order("pm.match_number ASC")
|
||||
}).
|
||||
|
||||
Reference in New Issue
Block a user