/** * Application Port: IRaceRepository * * Repository interface for Race entity CRUD operations. * Defines async methods using domain entities as types. */ import { Race, RaceStatus } from '../../domain/entities/Race'; export interface IRaceRepository { /** * Find a race by ID */ findById(id: string): Promise; /** * Find all races */ findAll(): Promise; /** * Find races by league ID */ findByLeagueId(leagueId: string): Promise; /** * Find upcoming races for a league */ findUpcomingByLeagueId(leagueId: string): Promise; /** * Find completed races for a league */ findCompletedByLeagueId(leagueId: string): Promise; /** * Find races by status */ findByStatus(status: RaceStatus): Promise; /** * Find races scheduled within a date range */ findByDateRange(startDate: Date, endDate: Date): Promise; /** * Create a new race */ create(race: Race): Promise; /** * Update an existing race */ update(race: Race): Promise; /** * Delete a race by ID */ delete(id: string): Promise; /** * Check if a race exists by ID */ exists(id: string): Promise; }