import { DriverStatsDto } from '../dto/DriverDto'; import type { ITotalDriversPresenter, TotalDriversResultDTO } from '../../../../../core/racing/application/presenters/ITotalDriversPresenter'; export class DriverStatsPresenter implements ITotalDriversPresenter { private result: DriverStatsDto | null = null; reset() { this.result = null; } present(dto: TotalDriversResultDTO) { this.result = { totalDrivers: dto.totalDrivers, }; } get viewModel(): DriverStatsDto { if (!this.result) throw new Error('Presenter not presented'); return this.result; } }