fix issues in adapters

This commit is contained in:
2025-12-22 22:46:15 +01:00
parent 41b27402dc
commit 1efd971032
25 changed files with 144 additions and 103 deletions

View File

@@ -27,6 +27,15 @@ export class InMemoryRaceRegistrationRepository implements IRaceRegistrationRepo
return Promise.resolve(driverIds);
}
async findByRaceId(raceId: string): Promise<RaceRegistration[]> {
this.logger.debug(`[InMemoryRaceRegistrationRepository] Finding all registrations for race ${raceId}.`);
const registrations = Array.from(this.registrations.values()).filter(
reg => reg.raceId.toString() === raceId
);
this.logger.info(`Found ${registrations.length} registrations for race ${raceId}.`);
return Promise.resolve(registrations);
}
async getRegistrationCount(raceId: string): Promise<number> {
this.logger.debug(`[InMemoryRaceRegistrationRepository] Getting registration count for race ${raceId}.`);
const count = Array.from(this.registrations.values()).filter(reg => reg.raceId.toString() === raceId).length;