rating
This commit is contained in:
33
core/identity/application/ports/IRaceResultsProvider.ts
Normal file
33
core/identity/application/ports/IRaceResultsProvider.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Port: IRaceResultsProvider
|
||||
*
|
||||
* 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 IRaceResultsProvider {
|
||||
/**
|
||||
* 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>;
|
||||
}
|
||||
Reference in New Issue
Block a user