mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-24 04:22:10 -05:00
* Remove old code * Add prefetching * Elim bracket initial * Hide rounds with only byes * Round hiding logic * Align stuff * Add TODO * Adjustments * Deadline * Compactify button * Simulations * Round robin bracket initial * eventId -> tournamentId * seedByTeamId removed * Couple more TODOs * RR placements table * Locking matches * Extract TournamentStream component * Bracket streams * Remove extras for tournament-manager, misc * Fix E2E tests * Fix SKALOP_SYSTEM_MESSAGE_URL in env.example * TODOs * TODO moved to GitHub * Handle team changing in match cache invalidation * Fix streamer seeing undo last score button * Show "Sub" badge on team roster page * Show who didn't play yet on match teams preview * Ranked/unranked badge * Bracket hover show roster * Add lock/unlock match test * Fix score reporting
100 lines
2.0 KiB
TypeScript
100 lines
2.0 KiB
TypeScript
/*-----------------------------------------------------------------|
|
|
* Contains the types which are persisted in the chosen storage.
|
|
*----------------------------------------------------------------*/
|
|
|
|
import type { StageSettings } from "./input";
|
|
import type { MatchResults } from "./other";
|
|
import type { StageType } from "./unions";
|
|
|
|
/**
|
|
* A participant of a stage (team or individual).
|
|
*/
|
|
export interface Participant {
|
|
/** ID of the participant. */
|
|
id: number;
|
|
|
|
/** ID of the tournament this participant belongs to. */
|
|
tournament_id: number;
|
|
|
|
/** Name of the participant. */
|
|
name: string;
|
|
}
|
|
|
|
/**
|
|
* A stage, which can be a round-robin stage or a single/double elimination stage.
|
|
*/
|
|
export interface Stage {
|
|
/** ID of the stage. */
|
|
id: number;
|
|
|
|
/** ID of the tournament this stage belongs to. */
|
|
tournament_id: number;
|
|
|
|
/** Name of the stage. */
|
|
name: string;
|
|
|
|
/** Type of the stage. */
|
|
type: StageType;
|
|
|
|
/** Settings of the stage. */
|
|
settings: StageSettings;
|
|
|
|
/** The number of the stage in its tournament. */
|
|
number: number;
|
|
}
|
|
|
|
/**
|
|
* A group of a stage.
|
|
*/
|
|
export interface Group {
|
|
/** ID of the group. */
|
|
id: number;
|
|
|
|
/** ID of the parent stage. */
|
|
stage_id: number;
|
|
|
|
/** The number of the group in its stage. */
|
|
number: number;
|
|
}
|
|
|
|
// The next levels don't have a `name` property. They are automatically named with their `number` and their context (parent levels).
|
|
|
|
/**
|
|
* A round of a group.
|
|
*/
|
|
export interface Round {
|
|
/** ID of the round. */
|
|
id: number;
|
|
|
|
/** ID of the parent stage. */
|
|
stage_id: number;
|
|
|
|
/** ID of the parent group. */
|
|
group_id: number;
|
|
|
|
/** The number of the round in its group. */
|
|
number: number;
|
|
}
|
|
|
|
/**
|
|
* A match of a round.
|
|
*/
|
|
export interface Match extends MatchResults {
|
|
/** ID of the match. */
|
|
id: number;
|
|
|
|
/** ID of the parent stage. */
|
|
stage_id: number;
|
|
|
|
/** ID of the parent group. */
|
|
group_id: number;
|
|
|
|
/** ID of the parent round. */
|
|
round_id: number;
|
|
|
|
/** The number of the match in its round. */
|
|
number: number;
|
|
|
|
lastGameFinishedAt?: number | null;
|
|
}
|