<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

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

class AdressDetailsController extends \Kufer\KuferTools\Basis\Controller\ToolController
{
  protected function getUseCase(): \Kufer\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);
  }
}