website refactor
This commit is contained in:
@@ -4,7 +4,16 @@ import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorC
|
||||
|
||||
import { Race } from '../../domain/entities/Race';
|
||||
import type { Season } from '../../domain/entities/season/Season';
|
||||
import { SeasonRepository } from '../../domain/repositories/SeasonRepository';
|
||||
import { RaceRepository } from '../../domain/repositories/RaceRepository';
|
||||
|
||||
export interface CreateLeagueSeasonScheduleRaceInput {
|
||||
leagueId: string;
|
||||
seasonId: string;
|
||||
track: string;
|
||||
car: string;
|
||||
scheduledAt: Date;
|
||||
}
|
||||
|
||||
export type CreateLeagueSeasonScheduleRaceResult = {
|
||||
raceId: string;
|
||||
@@ -88,6 +97,9 @@ export class CreateLeagueSeasonScheduleRaceUseCase {
|
||||
}
|
||||
|
||||
private isWithinSeasonWindow(season: Season, scheduledAt: Date): boolean {
|
||||
if (!season.startDate || !season.endDate) {
|
||||
return true;
|
||||
}
|
||||
return scheduledAt >= season.startDate && scheduledAt <= season.endDate;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user