wip league admin tools
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user