diff --git a/scripts/data/WorldCup2022.ts b/scripts/data/WorldCup2022.ts index fc528f66..d0fc8d95 100644 --- a/scripts/data/WorldCup2022.ts +++ b/scripts/data/WorldCup2022.ts @@ -91,8 +91,8 @@ export default async function Main(): Promise { value: e.cost, position: ["", "gk", "def", "mid", "att"][e.position] as position, forecast, - total_points: e.stats.totalPoints ? e.stats.totalPoints : 0, - average_points: e.stats.avgPoints ? e.stats.avgPoints : 0, + total_points: e.stats.totalPoints, + average_points: e.stats.avgPoints, last_match: 0, locked: e.locked === 1, exists: e.status !== "eliminated", diff --git a/types/data/WorldCup2022.d.ts b/types/data/WorldCup2022.d.ts index 7c42b46d..be689bfb 100644 --- a/types/data/WorldCup2022.d.ts +++ b/types/data/WorldCup2022.d.ts @@ -9,11 +9,31 @@ export interface Player { preferredName: string; squadId: number; cost: number; - stats: { [key: string]: number | null }; + stats: Stats; status: Status; position: number; locked: number; - matchDayPoints: { [key: string]: null }; + matchDayPoints: { [key: string]: number | null }; +} + +export interface Stats { + totalPoints: number; + avgPoints: number; + gamesPlayed: number; + roundScores: { [key: string]: number | null } | null; + tournamentScores: { [key: string]: number | null } | null; + pickedBy: number; + goals: number; + assists: number; + redCard: number; + yellowCard: number; + ownGoals: number; + penaltySave: number; + penaltyMissed: number; + starting11: number; + substitutions: number; + cleanSheets: number; + goalsConceded: number; } export enum Status {