import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { UpdateTeamResult } from '@core/racing/application/use-cases/UpdateTeamUseCase';
import type { UpdateTeamOutputDTO } from '../dtos/UpdateTeamOutputDTO';

export class UpdateTeamPresenter implements UseCaseOutputPort<UpdateTeamResult> {
  private result: UpdateTeamOutputDTO | null = null;

  reset(): void {
    this.result = null;
  }

  present(result: UpdateTeamResult): void {
    void result;

    this.result = {
      success: true,
    };
  }

  getResponseModel(): UpdateTeamOutputDTO | null {
    return this.result;
  }

  get responseModel(): UpdateTeamOutputDTO {
    if (!this.result) {
      throw new Error('Presenter not presented');
    }

    return this.result;
  }
}
