<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Mitarbeiter\AdressInfo\AdressUebersicht\AdressDetails;

class AdressDetailsController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  protected function getUseCase(): \Kufer\Web\KuferTools\Basis\UseCase\UseCase
  {
    return new AdressDetailsUseCase(
      $this->getRequestObj()
    );
  }

  protected function getRequestObj()
  {
    $request = new AdressDetailsRequest();
    $request->anr = \GetOperations::getVarValue('anr');
    $request->aguid = \GetOperations::getVarValue('aguid', null);
    $request->referer = \GetOperations::getVarValue('referer');
    $request->refererLabel = \GetOperations::getVarValue('refererLabel');
    $request->statusMessageContainer = null;
    $request->newAdrStatusCode = \SessionOperations::getVarValueWTIntern('newAdrStatusCode');
    $request->newAdrWrongFields = \SessionOperations::getVarValueWTIntern('newAdrWrongFields');

    return $request;
  }

  protected function getPresenter($pUseCaseResponse)
  {
    return new AdressDetailsPresenter($pUseCaseResponse);
  }
}