import type {
    GetTotalDriversResult,
} from '@core/racing/application/use-cases/GetTotalDriversUseCase';
import { DriverStatsDTO } from '../dtos/DriverStatsDTO';

export class DriverStatsPresenter {
  private responseModel: DriverStatsDTO | null = null;

  present(result: GetTotalDriversResult): void {
    this.responseModel = {
      totalDrivers: result.totalDrivers,
    };
  }

  getResponseModel(): DriverStatsDTO {
    if (!this.responseModel) throw new Error('Presenter not presented');
    return this.responseModel;
  }
}