alpha wip
This commit is contained in:
50
apps/website/application/ports/IDriverRepository.ts
Normal file
50
apps/website/application/ports/IDriverRepository.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Application Port: IDriverRepository
|
||||
*
|
||||
* Repository interface for Driver entity CRUD operations.
|
||||
* Defines async methods using domain entities as types.
|
||||
*/
|
||||
|
||||
import { Driver } from '../../domain/entities/Driver';
|
||||
|
||||
export interface IDriverRepository {
|
||||
/**
|
||||
* Find a driver by ID
|
||||
*/
|
||||
findById(id: string): Promise<Driver | null>;
|
||||
|
||||
/**
|
||||
* Find a driver by iRacing ID
|
||||
*/
|
||||
findByIRacingId(iracingId: string): Promise<Driver | null>;
|
||||
|
||||
/**
|
||||
* Find all drivers
|
||||
*/
|
||||
findAll(): Promise<Driver[]>;
|
||||
|
||||
/**
|
||||
* Create a new driver
|
||||
*/
|
||||
create(driver: Driver): Promise<Driver>;
|
||||
|
||||
/**
|
||||
* Update an existing driver
|
||||
*/
|
||||
update(driver: Driver): Promise<Driver>;
|
||||
|
||||
/**
|
||||
* Delete a driver by ID
|
||||
*/
|
||||
delete(id: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Check if a driver exists by ID
|
||||
*/
|
||||
exists(id: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Check if an iRacing ID is already registered
|
||||
*/
|
||||
existsByIRacingId(iracingId: string): Promise<boolean>;
|
||||
}
|
||||
Reference in New Issue
Block a user