module creation
This commit is contained in:
33
adapters/racing/services/InMemoryDriverStatsService.ts
Normal file
33
adapters/racing/services/InMemoryDriverStatsService.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { IDriverStatsService, DriverStats } from '@gridpilot/racing/domain/services/IDriverStatsService';
|
||||
import type { ILogger } from '@gridpilot/shared/logging/ILogger';
|
||||
|
||||
export class InMemoryDriverStatsService implements IDriverStatsService {
|
||||
constructor(private readonly logger: ILogger) {
|
||||
this.logger.info('InMemoryDriverStatsService initialized.');
|
||||
}
|
||||
|
||||
getDriverStats(driverId: string): DriverStats | null {
|
||||
this.logger.debug(`[InMemoryDriverStatsService] Getting stats for driver: ${driverId}`);
|
||||
|
||||
// Mock data for demonstration purposes
|
||||
if (driverId === 'driver-1') {
|
||||
return {
|
||||
rating: 2500,
|
||||
wins: 10,
|
||||
podiums: 15,
|
||||
totalRaces: 50,
|
||||
overallRank: 1,
|
||||
};
|
||||
}
|
||||
if (driverId === 'driver-2') {
|
||||
return {
|
||||
rating: 2400,
|
||||
wins: 8,
|
||||
podiums: 12,
|
||||
totalRaces: 45,
|
||||
overallRank: 2,
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user