/**
 * Application Port: DriverRepository
 * 
 * Repository interface for Driver entity CRUD operations.
 * Defines async methods using domain entities as types.
 */

import type { Driver } from '../entities/Driver';

export interface DriverRepository {
  /**
   * 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>;
}