import type { DriversApiClient } from '../../api/drivers/DriversApiClient';
import { DriverRegistrationStatusViewModel } from '../../view-models/DriverRegistrationStatusViewModel';

/**
 * Driver Registration Service
 *
 * Orchestrates driver registration status operations by coordinating API calls and view model creation.
 * All dependencies are injected via constructor.
 */
export class DriverRegistrationService {
  constructor(
    private readonly apiClient: DriversApiClient
  ) {}

  /**
   * Get driver registration status for a specific race
   */
  async getDriverRegistrationStatus(
    driverId: string,
    raceId: string
  ): Promise<DriverRegistrationStatusViewModel> {
    const dto = await this.apiClient.getRegistrationStatus(driverId, raceId);
    return new DriverRegistrationStatusViewModel(dto);
  }
}