Files
gridpilot.gg/apps/api/src/domain/driver/presenters/DriverStatsPresenter.ts

19 lines
534 B
TypeScript

import { DriverStatsDTO } from '../dtos/DriverStatsDTO';
import type {
GetTotalDriversResult,
} from '@core/racing/application/use-cases/GetTotalDriversUseCase';
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;
}
}