import { ForgotPasswordResult } from '@core/identity/application/use-cases/ForgotPasswordUseCase';
import { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import { Injectable } from '@nestjs/common';

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

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

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

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