refactor
This commit is contained in:
@@ -81,7 +81,7 @@ export class CreateLeagueWithSeasonAndScoringUseCase
|
||||
this.logger.debug(`Generated seasonId: ${seasonId}`);
|
||||
const season = Season.create({
|
||||
id: seasonId,
|
||||
leagueId: league.id,
|
||||
leagueId: league.id.toString(),
|
||||
gameId: command.gameId,
|
||||
name: `${command.name} Season 1`,
|
||||
year: new Date().getFullYear(),
|
||||
@@ -113,7 +113,7 @@ export class CreateLeagueWithSeasonAndScoringUseCase
|
||||
this.logger.info(`Scoring configuration saved for season ${seasonId}.`);
|
||||
|
||||
const result: CreateLeagueWithSeasonAndScoringResultDTO = {
|
||||
leagueId: league.id,
|
||||
leagueId: league.id.toString(),
|
||||
seasonId,
|
||||
scoringPresetId: preset.id,
|
||||
scoringPresetName: preset.name,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
|
||||
import { Season } from '@core/racing/domain/entities/Season';
|
||||
import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import type { ISeasonRepository } from '@core/racing/domain/repositories/ISeasonRepository';
|
||||
import type { ILeagueRepository } from '@core/racing/domain/repositories/ILeagueRepository';
|
||||
import {
|
||||
|
||||
@@ -28,7 +28,7 @@ export class GetAllRacesPageDataUseCase
|
||||
]);
|
||||
this.logger.info(`Found ${allRaces.length} races and ${allLeagues.length} leagues.`);
|
||||
|
||||
const leagueMap = new Map(allLeagues.map((league) => [league.id, league.name]));
|
||||
const leagueMap = new Map(allLeagues.map((league) => [league.id.toString(), league.name.toString()]));
|
||||
|
||||
const races: AllRacesListItemViewModel[] = allRaces
|
||||
.slice()
|
||||
@@ -46,7 +46,7 @@ export class GetAllRacesPageDataUseCase
|
||||
|
||||
const uniqueLeagues = new Map<string, { id: string; name: string }>();
|
||||
for (const league of allLeagues) {
|
||||
uniqueLeagues.set(league.id, { id: league.id, name: league.name });
|
||||
uniqueLeagues.set(league.id.toString(), { id: league.id.toString(), name: league.name.toString() });
|
||||
}
|
||||
|
||||
const filters: AllRacesFilterOptionsViewModel = {
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { IChampionshipStandingRepository } from '@core/racing/domain/reposi
|
||||
|
||||
import type { ChampionshipConfig } from '@core/racing/domain/types/ChampionshipConfig';
|
||||
import type { SessionType } from '@core/racing/domain/types/SessionType';
|
||||
import type { ChampionshipStanding } from '@core/racing/domain/entities/ChampionshipStanding';
|
||||
import type { ChampionshipStanding } from '@core/racing/domain/entities/championship/ChampionshipStanding';
|
||||
import { EventScoringService } from '@core/racing/domain/services/EventScoringService';
|
||||
import { ChampionshipAggregator } from '@core/racing/domain/services/ChampionshipAggregator';
|
||||
|
||||
@@ -101,10 +101,10 @@ export class RecalculateChampionshipStandingsUseCase
|
||||
|
||||
const rows: ChampionshipStandingsRowDTO[] = standings.map((s) => ({
|
||||
participant: s.participant,
|
||||
position: s.position,
|
||||
totalPoints: s.totalPoints,
|
||||
resultsCounted: s.resultsCounted,
|
||||
resultsDropped: s.resultsDropped,
|
||||
position: s.position.toNumber(),
|
||||
totalPoints: s.totalPoints.toNumber(),
|
||||
resultsCounted: s.resultsCounted.toNumber(),
|
||||
resultsDropped: s.resultsDropped.toNumber(),
|
||||
}));
|
||||
|
||||
const dto: ChampionshipStandingsDTO = {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { describe, it, expect } from 'vitest';
|
||||
import {
|
||||
InMemorySeasonRepository,
|
||||
} from '@core/racing/infrastructure/repositories/InMemoryScoringRepositories';
|
||||
import { Season } from '@core/racing/domain/entities/Season';
|
||||
import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import type { ISeasonRepository } from '@core/racing/domain/repositories/ISeasonRepository';
|
||||
import type { ILeagueRepository } from '@core/racing/domain/repositories/ILeagueRepository';
|
||||
import {
|
||||
|
||||
Reference in New Issue
Block a user