This commit is contained in:
2025-12-08 23:52:36 +01:00
parent 2d0860d66c
commit 35f988f885
46 changed files with 4624 additions and 1041 deletions

View File

@@ -0,0 +1,65 @@
/**
* Application Port: ICarRepository
*
* Repository interface for Car entity CRUD operations.
* Defines async methods using domain entities as types.
*/
import type { Car, CarClass, CarLicense } from '../entities/Car';
export interface ICarRepository {
/**
* Find a car by ID
*/
findById(id: string): Promise<Car | null>;
/**
* Find all cars
*/
findAll(): Promise<Car[]>;
/**
* Find cars by game ID
*/
findByGameId(gameId: string): Promise<Car[]>;
/**
* Find cars by class
*/
findByClass(carClass: CarClass): Promise<Car[]>;
/**
* Find cars by license level
*/
findByLicense(license: CarLicense): Promise<Car[]>;
/**
* Find cars by manufacturer
*/
findByManufacturer(manufacturer: string): Promise<Car[]>;
/**
* Search cars by name
*/
searchByName(query: string): Promise<Car[]>;
/**
* Create a new car
*/
create(car: Car): Promise<Car>;
/**
* Update an existing car
*/
update(car: Car): Promise<Car>;
/**
* Delete a car by ID
*/
delete(id: string): Promise<void>;
/**
* Check if a car exists by ID
*/
exists(id: string): Promise<boolean>;
}

View 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>;
}