wip league admin tools
This commit is contained in:
@@ -4,7 +4,7 @@ import type { Logger } from '@core/shared/application';
|
||||
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import type { RaceStatus } from '../../domain/entities/Race';
|
||||
import type { RaceStatusValue } from '../../domain/entities/Race';
|
||||
|
||||
export type GetAllRacesPageDataInput = {};
|
||||
|
||||
@@ -13,14 +13,14 @@ export interface GetAllRacesPageRaceItem {
|
||||
track: string;
|
||||
car: string;
|
||||
scheduledAt: string;
|
||||
status: RaceStatus;
|
||||
status: RaceStatusValue;
|
||||
leagueId: string;
|
||||
leagueName: string;
|
||||
strengthOfField: number | null;
|
||||
}
|
||||
|
||||
export interface GetAllRacesPageDataFilters {
|
||||
statuses: { value: 'all' | RaceStatus; label: string }[];
|
||||
statuses: { value: 'all' | RaceStatusValue; label: string }[];
|
||||
leagues: { id: string; name: string }[];
|
||||
}
|
||||
|
||||
@@ -61,10 +61,10 @@ export class GetAllRacesPageDataUseCase {
|
||||
track: race.track,
|
||||
car: race.car,
|
||||
scheduledAt: race.scheduledAt.toISOString(),
|
||||
status: race.status,
|
||||
status: race.status.toString(),
|
||||
leagueId: race.leagueId,
|
||||
leagueName: leagueMap.get(race.leagueId) ?? 'Unknown League',
|
||||
strengthOfField: race.strengthOfField ?? null,
|
||||
strengthOfField: race.strengthOfField?.toNumber() ?? null,
|
||||
}));
|
||||
|
||||
const uniqueLeagues = new Map<string, { id: string; name: string }>();
|
||||
|
||||
Reference in New Issue
Block a user