54 lines
1.2 KiB
TypeScript
54 lines
1.2 KiB
TypeScript
import { ViewData } from "@/lib/contracts/view-data/ViewData";
|
|
|
|
/**
|
|
* ViewData for StandingEntry
|
|
* This is the JSON-serializable input for the Template.
|
|
*/
|
|
export interface StandingEntryViewData {
|
|
driverId: string;
|
|
position: number;
|
|
points: number;
|
|
totalPoints: number;
|
|
wins: number;
|
|
podiums: number;
|
|
races: number;
|
|
racesStarted: number;
|
|
avgFinish: number;
|
|
leaderPoints: number;
|
|
nextPoints: number;
|
|
currentUserId: string;
|
|
previousPosition?: number;
|
|
driver?: any;
|
|
// Phase 3 fields
|
|
positionChange: number;
|
|
lastRacePoints: number;
|
|
droppedRaceIds: string[];
|
|
}
|
|
|
|
/**
|
|
* ViewData for LeagueStandings
|
|
* This is the JSON-serializable input for the Template.
|
|
*/
|
|
export interface LeagueStandingsViewData extends ViewData {
|
|
standings: StandingEntryViewData[];
|
|
drivers: Array<{
|
|
id: string;
|
|
name: string;
|
|
avatarUrl: string | null;
|
|
iracingId: string;
|
|
rating?: number;
|
|
country: string;
|
|
}>;
|
|
memberships: Array<{
|
|
driverId: string;
|
|
leagueId: string;
|
|
role: 'owner' | 'admin' | 'steward' | 'member';
|
|
joinedAt: string;
|
|
status: 'active' | 'inactive';
|
|
}>;
|
|
leagueId: string;
|
|
currentDriverId: string | null;
|
|
isAdmin: boolean;
|
|
isTeamChampionship: boolean;
|
|
}
|