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

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

class AdressUebersichtController extends \Kufer\Web\KuferTools\Basis\Uebersicht\UebersichtController
{
  protected function getUseCase(): \Kufer\Web\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);
  }
}