wip league admin tools

This commit is contained in:
2025-12-28 12:04:12 +01:00
parent 5dc8c2399c
commit 6edf12fda8
401 changed files with 15365 additions and 6047 deletions

View File

@@ -64,7 +64,7 @@ export class GetRaceWithSOFUseCase {
// Get participant IDs based on race status
let participantIds: string[] = [];
if (race.status === 'completed') {
if (race.status.isCompleted()) {
// For completed races, use results
const results = await this.resultRepository.findByRaceId(raceId);
participantIds = results.map(r => r.driverId.toString());
@@ -74,7 +74,7 @@ export class GetRaceWithSOFUseCase {
}
// Use stored SOF if available, otherwise calculate
let strengthOfField = race.strengthOfField ?? null;
let strengthOfField = race.strengthOfField?.toNumber() ?? null;
if (strengthOfField === null && participantIds.length > 0) {
// Get ratings for all participants using clean ports
@@ -100,8 +100,8 @@ export class GetRaceWithSOFUseCase {
const result: GetRaceWithSOFResult = {
race,
strengthOfField,
registeredCount: race.registeredCount ?? participantIds.length,
maxParticipants: race.maxParticipants ?? participantIds.length,
registeredCount: race.registeredCount?.toNumber() ?? participantIds.length,
maxParticipants: race.maxParticipants?.toNumber() ?? participantIds.length,
participantCount: participantIds.length,
};