import { Injectable } from '@nestjs/common';
import { UseCaseOutputPort } from '@core/shared/application';
import { DemoLoginResult } from '../../../development/use-cases/DemoLoginUseCase';

@Injectable()
export class DemoLoginPresenter implements UseCaseOutputPort<DemoLoginResult> {
  private _responseModel: DemoLoginResult | null = null;

  present(result: DemoLoginResult): void {
    this._responseModel = result;
  }

  get responseModel(): DemoLoginResult {
    if (!this._responseModel) {
      throw new Error('DemoLoginPresenter: No response model available');
    }
    return this._responseModel;
  }

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