Skip to content

No persisted tournament champion / completed state #103

Closed

Description

@Dejmenek

Problem / motivation

ValidateNotFinalRound detects that the final has been played (winners.Count < 2) and blocks further UpdateRound calls, but this is purely a guard — nothing ever writes a "champion" anywhere. Neither Bracket nor Tournament has a WinnerId/ChampionId field, BracketType exposes only Id, TournamentId, Matches, and TournamentStatus never transitions to any Completed/Finished value (it's only Open/Closed). A client has to independently find the highest-round match and read its WinnerId to determine the tournament winner.

What should happen

  • Add a WinnerId field to Tournament, populated once the final match is decided.
  • Add a Completed/Finished value to TournamentStatus and transition to it at that point.
  • Expose the winner through TournamentType so clients don't need to derive it themselves.

Affected files

Brackets/BracketMutationValidations.cs:28-29 (ValidateNotFinalRound), Data/Models/Tournament.cs, Data/Models/TournamentStatus.cs, Tournaments/TournamentType.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions