import type { IRaceRegistrationsPresenter, RaceRegistrationsViewModel, } from '@gridpilot/racing/application/presenters/IRaceRegistrationsPresenter'; export class RaceRegistrationsPresenter implements IRaceRegistrationsPresenter { private viewModel: RaceRegistrationsViewModel | null = null; present(registeredDriverIds: string[]): RaceRegistrationsViewModel { this.viewModel = { registeredDriverIds, count: registeredDriverIds.length, }; return this.viewModel; } getViewModel(): RaceRegistrationsViewModel { if (!this.viewModel) { throw new Error('Presenter has not been called yet'); } return this.viewModel; } }