Files
gridpilot.gg/packages/racing/domain/repositories/IProtestRepository.ts
2025-12-09 10:32:59 +01:00

54 lines
1.1 KiB
TypeScript

/**
* Repository Interface: IProtestRepository
*
* Defines the contract for persisting and retrieving Protest entities.
*/
import type { Protest } from '../entities/Protest';
export interface IProtestRepository {
/**
* Find a protest by ID
*/
findById(id: string): Promise<Protest | null>;
/**
* Find all protests for a race
*/
findByRaceId(raceId: string): Promise<Protest[]>;
/**
* Find all protests filed by a specific driver
*/
findByProtestingDriverId(driverId: string): Promise<Protest[]>;
/**
* Find all protests against a specific driver
*/
findByAccusedDriverId(driverId: string): Promise<Protest[]>;
/**
* Find all pending protests (for steward review queue)
*/
findPending(): Promise<Protest[]>;
/**
* Find all protests under review by a specific steward
*/
findUnderReviewBy(stewardId: string): Promise<Protest[]>;
/**
* Save a new protest
*/
create(protest: Protest): Promise<void>;
/**
* Update an existing protest
*/
update(protest: Protest): Promise<void>;
/**
* Check if a protest exists
*/
exists(id: string): Promise<boolean>;
}