wip
This commit is contained in:
60
packages/racing/domain/repositories/ITrackRepository.ts
Normal file
60
packages/racing/domain/repositories/ITrackRepository.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Application Port: ITrackRepository
|
||||
*
|
||||
* Repository interface for Track entity CRUD operations.
|
||||
* Defines async methods using domain entities as types.
|
||||
*/
|
||||
|
||||
import type { Track, TrackCategory } from '../entities/Track';
|
||||
|
||||
export interface ITrackRepository {
|
||||
/**
|
||||
* Find a track by ID
|
||||
*/
|
||||
findById(id: string): Promise<Track | null>;
|
||||
|
||||
/**
|
||||
* Find all tracks
|
||||
*/
|
||||
findAll(): Promise<Track[]>;
|
||||
|
||||
/**
|
||||
* Find tracks by game ID
|
||||
*/
|
||||
findByGameId(gameId: string): Promise<Track[]>;
|
||||
|
||||
/**
|
||||
* Find tracks by category
|
||||
*/
|
||||
findByCategory(category: TrackCategory): Promise<Track[]>;
|
||||
|
||||
/**
|
||||
* Find tracks by country
|
||||
*/
|
||||
findByCountry(country: string): Promise<Track[]>;
|
||||
|
||||
/**
|
||||
* Search tracks by name
|
||||
*/
|
||||
searchByName(query: string): Promise<Track[]>;
|
||||
|
||||
/**
|
||||
* Create a new track
|
||||
*/
|
||||
create(track: Track): Promise<Track>;
|
||||
|
||||
/**
|
||||
* Update an existing track
|
||||
*/
|
||||
update(track: Track): Promise<Track>;
|
||||
|
||||
/**
|
||||
* Delete a track by ID
|
||||
*/
|
||||
delete(id: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Check if a track exists by ID
|
||||
*/
|
||||
exists(id: string): Promise<boolean>;
|
||||
}
|
||||
Reference in New Issue
Block a user