import { IGetTotalRacesPresenter, GetTotalRacesResultDTO } from '@core/racing/application/presenters/IGetTotalRacesPresenter';
import { RaceStatsDto } from '../dto/RaceDto';

export class GetTotalRacesPresenter implements IGetTotalRacesPresenter {
  private result: RaceStatsDto | null = null;

  reset() {
    this.result = null;
  }

  present(dto: GetTotalRacesResultDTO) {
    this.result = {
      totalRaces: dto.totalRaces,
    };
  }

  getViewModel(): RaceStatsDto | null {
    return this.result;
  }
}