Files
gridpilot.gg/core/identity/application/ports/RaceResultsProvider.ts
2026-01-16 16:46:57 +01:00

33 lines
819 B
TypeScript

/**
* Port: RaceResultsProvider
*
* Provider interface for race results data needed for rating calculations.
* This is an application layer port that bridges racing context to identity context.
*/
export interface RaceResultData {
userId: string;
startPos: number;
finishPos: number;
incidents: number;
status: 'finished' | 'dnf' | 'dns' | 'dsq' | 'afk';
sof?: number; // Optional strength of field
}
export interface RaceResultsData {
raceId: string;
results: RaceResultData[];
}
export interface RaceResultsProvider {
/**
* Get race results by race ID
* Returns null if race not found or no results
*/
getRaceResults(raceId: string): Promise<RaceResultsData | null>;
/**
* Check if race results exist for a race
*/
hasRaceResults(raceId: string): Promise<boolean>;
}