feat: define competition domain contracts
This commit is contained in:
1 parent
f4ba3d524f
commit
05a83db886
13 files changed
+843
No files matched your search
@@ -0,0 +1,80 @@
|
||||
import type {
|
||||
GameId,
|
||||
GameSlotId,
|
||||
RiotMatchId,
|
||||
SeriesId,
|
||||
TeamId,
|
||||
UserId,
|
||||
} from "./ids.js";
|
||||
import type { IsoDateTime, SeriesSlot } from "./series.js";
|
||||
|
||||
export type TeamSide = "blue" | "red";
|
||||
|
||||
export type GameEvidenceView =
|
||||
| {
|
||||
type: "riot";
|
||||
riotMatchId: RiotMatchId;
|
||||
}
|
||||
| {
|
||||
type: "legacy";
|
||||
legacyReference: string;
|
||||
};
|
||||
|
||||
export interface GameParticipantView {
|
||||
userId: UserId | null;
|
||||
teamId: TeamId;
|
||||
side: TeamSide;
|
||||
summonerName: string;
|
||||
tagLine: string;
|
||||
championId: number;
|
||||
kills: number;
|
||||
deaths: number;
|
||||
assists: number;
|
||||
}
|
||||
|
||||
export interface GameTeamView {
|
||||
teamId: TeamId;
|
||||
side: TeamSide;
|
||||
}
|
||||
|
||||
export interface CompetitionGameView {
|
||||
id: GameId;
|
||||
seriesId: SeriesId;
|
||||
gameSlotId: GameSlotId;
|
||||
ordinal: number;
|
||||
displayNumber: number;
|
||||
evidence: GameEvidenceView;
|
||||
teams: {
|
||||
blue: GameTeamView & { side: "blue" };
|
||||
red: GameTeamView & { side: "red" };
|
||||
};
|
||||
winnerTeamId: TeamId;
|
||||
startedAt: IsoDateTime;
|
||||
durationSeconds: number;
|
||||
participants: GameParticipantView[];
|
||||
}
|
||||
|
||||
export type GameSlotStatus =
|
||||
| "inactive"
|
||||
| "waiting"
|
||||
| "ready"
|
||||
| "reserved"
|
||||
| "used"
|
||||
| "completed"
|
||||
| "voided";
|
||||
|
||||
export interface GameSlotEntryView {
|
||||
slot: SeriesSlot;
|
||||
teamId: TeamId | null;
|
||||
}
|
||||
|
||||
export interface GameSlotView {
|
||||
id: GameSlotId;
|
||||
seriesId: SeriesId;
|
||||
ordinal: number;
|
||||
displayNumber: number;
|
||||
status: GameSlotStatus;
|
||||
entries: [GameSlotEntryView, GameSlotEntryView];
|
||||
gameId?: GameId;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user