/**
 * 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>;
}