feat: define competition domain contracts

This commit is contained in:
dahyeon committed 2026-07-12 18:44:26 +00:00
1 parent f4ba3d524f
commit 05a83db886
13 files changed
+843

No files matched your search

+95
View File
@@ -0,0 +1,95 @@
import type { CompetitionDetailResponse, CompetitionPhase } from "./competition.js";
import type { CompetitionFormatType } from "./format.js";
import type {
CommunityId,
CompetitionId,
GameSlotId,
MatchId,
SeriesId,
TeamId,
UserId,
} from "./ids.js";
import type { IsoDateTime, SeriesProjection } from "./series.js";
export type MatchLifecycleStatus =
| "recruiting"
| "team-building"
| "ready"
| "running"
| "completed"
| "cancelled";
export interface MatchCompetitionSummaryView {
id: CompetitionId;
phase: CompetitionPhase;
formatType: CompetitionFormatType;
}
export interface MatchSummaryResponse {
id: MatchId;
communityId: CommunityId;
shortCode?: string;
title: string;
description: string;
scheduledAt: IsoDateTime;
status: MatchLifecycleStatus;
maxParticipants: number;
participantCount: number;
joined: boolean;
competition?: MatchCompetitionSummaryView;
createdAt: IsoDateTime;
updatedAt: IsoDateTime;
}
export interface MatchParticipantView {
userId: UserId;
displayName: string;
gameName?: string;
tagLine?: string;
profileIconId?: number;
joinedAt: IsoDateTime;
excluded: boolean;
}
export interface MatchScheduleItemView {
time: string;
label: string;
}
export interface MatchDetailResponse
extends Omit<MatchSummaryResponse, "competition"> {
mapId: number;
hostUserId?: UserId;
participants: MatchParticipantView[];
prizes: string[];
notices: string[];
schedule: MatchScheduleItemView[];
competition?: CompetitionDetailResponse;
}
export interface TeamTournamentCodeView {
gameSlotId: GameSlotId;
seriesId: SeriesId;
ordinal: number;
displayNumber: number;
state: "pending" | "reserved" | "used";
code: string | null;
expiresAt: IsoDateTime | null;
}
export interface TeamCompetitionViewResponse {
competitionId: CompetitionId;
revision: number;
phase: CompetitionPhase;
teamId: TeamId;
activeSeries: SeriesProjection[];
tournamentCodes: TeamTournamentCodeView[];
}
export interface MatchListResponse {
matches: MatchSummaryResponse[];
page: number;
pageSize: number;
totalItems: number;
totalPages: number;
}