26 lines
559 B
TypeScript
26 lines
559 B
TypeScript
import { DriverRegistrationStatusDTO } from '../dtos/DriverRegistrationStatusDTO';
|
|
|
|
export class DriverRegistrationStatusPresenter {
|
|
private result: DriverRegistrationStatusDTO | null = null;
|
|
|
|
reset(): void {
|
|
this.result = null;
|
|
}
|
|
|
|
present(isRegistered: boolean, raceId: string, driverId: string): void {
|
|
this.result = {
|
|
isRegistered,
|
|
raceId,
|
|
driverId,
|
|
};
|
|
}
|
|
|
|
get viewModel(): DriverRegistrationStatusDTO {
|
|
if (!this.result) {
|
|
throw new Error('Presenter not presented');
|
|
}
|
|
|
|
return this.result;
|
|
}
|
|
}
|