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

namespace Kufer\KuferTools\Mitarbeiter\AdressInfo\AdressUebersicht;

class AdressUebersichtController extends \Kufer\KuferTools\Basis\Uebersicht\UebersichtController
{
  protected function getUseCase(): \Kufer\KuferTools\Basis\UseCase\UseCase
  {
    return new AdressUebersichtUseCase(
      $this->getRequestObj()
    );
  }

  protected function getRequestObj()
  {
    $request = parent::getRequestObj();
    $request->newAdrStatusCode = \SessionOperations::getVarValueWTIntern('newAdrStatusCode');
    $request->newAdrWrongFields = \SessionOperations::getVarValueWTIntern('newAdrWrongFields');
    if ($request->einstieg) {
      $request->aendereFilter = true;
    }

    return $request;
  }

  protected function getToolId()
  {
    return AdressUebersichtUseCase::getToolId();
  }

  protected function getDefaultRequestObj()
  {
    return new AdressUebersichtRequest();
  }

  protected function getSuchAPI()
  {
    return new \Kufer\Web\KuferTools\Utils\FilterSearch\AdressenSearchFilter();
  }

  protected function getRequestSearchName()
  {
    return 'searchadresse';
  }

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