Enhance draft structures in backend models by adding new fields for banned actions and audit logs. Update frontend API interfaces to accommodate nullable properties for drafts and results, ensuring better handling of optional data. Improve series adaptation logic to manage null values effectively.
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
CI / compose (push) Has been cancelled

This commit is contained in:
2026-07-19 02:53:17 +03:00
parent 2d7be8b9cd
commit 4b8218ec14
4 changed files with 19 additions and 16 deletions

View File

@@ -264,7 +264,7 @@ func NewMapDraft(pool []string, firstTeam string, teams [2]string) (*MapDraft, e
if len(pool) < 1 || teams[0] == teams[1] || (firstTeam != teams[0] && firstTeam != teams[1]) {
return nil, fmt.Errorf("%w: invalid map draft", ErrInvalid)
}
return &MapDraft{Pool: slices.Clone(pool), FirstTeamID: firstTeam, TeamIDs: teams}, nil
return &MapDraft{Pool: slices.Clone(pool), Banned: []string{}, Actions: []DraftAction{}, FirstTeamID: firstTeam, TeamIDs: teams}, nil
}
func (d *MapDraft) NextTeam() string {
@@ -321,7 +321,7 @@ func NewHeroDraft(heroes []Hero, teams [2]string, first string, count int, previ
if previous == nil {
previous = map[string][]string{}
}
return &HeroDraft{Heroes: slices.Clone(heroes), TeamIDs: teams, FirstTeamID: first, BansPerTeam: count, SeriesBans: previous, CurrentRoles: map[string][]Role{}}, nil
return &HeroDraft{Heroes: slices.Clone(heroes), TeamIDs: teams, FirstTeamID: first, BansPerTeam: count, SeriesBans: previous, CurrentBans: []DraftAction{}, CurrentRoles: map[string][]Role{}}, nil
}
func (d *HeroDraft) NextTeam() string {