diff --git a/packages/shared/src/game-types.ts b/packages/shared/src/game-types.ts index 2c41b61..aabf9a4 100644 --- a/packages/shared/src/game-types.ts +++ b/packages/shared/src/game-types.ts @@ -37,6 +37,57 @@ export const predictionSchema = z.object({ export type Prediction = z.infer +// ─── Jury Voting ──────────────────────────────────────────────────── + +export const juryRoundSchema = z.object({ + id: z.string(), + countryCode: z.string(), + countryName: z.string(), + countryFlag: z.string(), + status: z.enum(["open", "closed"]), +}) + +export type JuryRound = z.infer + +export const juryResultSchema = z.object({ + countryCode: z.string(), + countryName: z.string(), + countryFlag: z.string(), + averageRating: z.number(), + totalVotes: z.number(), +}) + +export type JuryResult = z.infer + +// ─── Bingo ────────────────────────────────────────────────────────── + +export const bingoSquareSchema = z.object({ + tropeId: z.string(), + label: z.string(), + tapped: z.boolean(), +}) + +export type BingoSquare = z.infer + +export const bingoCardSchema = z.object({ + squares: z.array(bingoSquareSchema).length(16), + hasBingo: z.boolean(), +}) + +export type BingoCard = z.infer + +// ─── Scoring ──────────────────────────────────────────────────────── + +export const leaderboardEntrySchema = z.object({ + playerId: z.string(), + displayName: z.string(), + juryPoints: z.number(), + bingoPoints: z.number(), + totalPoints: z.number(), +}) + +export type LeaderboardEntry = z.infer + // ─── Game State (sent to clients) ─────────────────────────────────── export const gameStateSchema = z.object({ @@ -44,6 +95,18 @@ export const gameStateSchema = z.object({ myPrediction: predictionSchema.nullable(), predictionsLocked: z.boolean(), predictionSubmitted: z.record(z.string(), z.boolean()), + // Jury + currentJuryRound: juryRoundSchema.nullable(), + juryResults: z.array(juryResultSchema), + myJuryVote: z.number().nullable(), + // Bingo + myBingoCard: bingoCardSchema.nullable(), + bingoAnnouncements: z.array(z.object({ + playerId: z.string(), + displayName: z.string(), + })), + // Leaderboard + leaderboard: z.array(leaderboardEntrySchema), }) export type GameState = z.infer