17 lines
698 B
TypeScript
17 lines
698 B
TypeScript
import type { IDriverStatsService, DriverStats } from '@core/racing/domain/services/IDriverStatsService';
|
|
import type { Logger } from '@core/shared/application';
|
|
import { DriverStatsStore } from './DriverStatsStore';
|
|
|
|
export class InMemoryDriverStatsService implements IDriverStatsService {
|
|
private store: DriverStatsStore;
|
|
|
|
constructor(private readonly logger: Logger) {
|
|
this.logger.info('InMemoryDriverStatsService initialized.');
|
|
this.store = DriverStatsStore.getInstance();
|
|
}
|
|
|
|
getDriverStats(driverId: string): DriverStats | null {
|
|
this.logger.debug(`[InMemoryDriverStatsService] Getting stats for driver: ${driverId}`);
|
|
return this.store.getDriverStats(driverId);
|
|
}
|
|
} |