fix issues in core
This commit is contained in:
27
core/racing/application/ports/DriverRatingPort.ts
Normal file
27
core/racing/application/ports/DriverRatingPort.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
export interface DriverRatingChange {
|
||||
driverId: string;
|
||||
oldRating: number;
|
||||
newRating: number;
|
||||
change: number;
|
||||
}
|
||||
|
||||
export interface RatingChange {
|
||||
driverId: string;
|
||||
oldRating: number;
|
||||
newRating: number;
|
||||
change: number;
|
||||
}
|
||||
|
||||
export interface DriverRatingPort {
|
||||
calculateRatingChange(
|
||||
driverId: string,
|
||||
raceId: string,
|
||||
finalPosition: number,
|
||||
incidents: number,
|
||||
baseRating: number,
|
||||
): Promise<RatingChange>;
|
||||
|
||||
getDriverRating(driverId: string): Promise<number>;
|
||||
|
||||
updateDriverRating(driverId: string, newRating: number): Promise<void>;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
export interface AllRacesPageOutputPort {
|
||||
races: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
leagueId: string;
|
||||
leagueName: string;
|
||||
scheduledTime: Date;
|
||||
trackId: string;
|
||||
status: string;
|
||||
participants: number;
|
||||
}>;
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
export interface ChampionshipStandingsOutputPort {
|
||||
leagueId: string;
|
||||
seasonId: string;
|
||||
standings: Array<{
|
||||
driverId: string;
|
||||
position: number;
|
||||
points: number;
|
||||
driverName: string;
|
||||
teamId?: string;
|
||||
teamName?: string;
|
||||
}>;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export interface ChampionshipStandingsRowOutputPort {
|
||||
driverId: string;
|
||||
position: number;
|
||||
points: number;
|
||||
driverName: string;
|
||||
teamId?: string;
|
||||
teamName?: string;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export interface DriverRegistrationStatusOutputPort {
|
||||
driverId: string;
|
||||
raceId: string;
|
||||
leagueId: string;
|
||||
registered: boolean;
|
||||
status: 'registered' | 'withdrawn' | 'pending' | 'not_registered';
|
||||
}
|
||||
Reference in New Issue
Block a user