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

namespace Kufer\Web\KuferTools\Dozent\KursUebersicht\Detailsreiter\Honorar\BurghausenVhs\HonorarPdf;

use Kufer\Web\KuferTools\Dozent\KursUebersicht\KursDetails\DozKursDetailsController;

class HonorarAbrechnungDialogController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  private $response;

  public function __construct(?HonorarAbrechnungDialogResponse $response = null)
  {
    $this->response = $response;
  }

  protected function getUseCase(): \Kufer\Web\KuferTools\Basis\UseCase\UseCase
  {
    return new HonorarAbrechnungDialogUseCase(
      $this->getRequestObj()
    );
  }

  protected function getRequestObj()
  {
    $requestObj = new HonorarAbrechnungDialogRequest();
    $requestObj->knr = \GetOperations::getVarValue('knr');
    $requestObj->response = $this->response;

    return $requestObj;
  }

  protected function getControllerToForward($pUseCaseResponse)
  {
    if ($pUseCaseResponse->redirect) {
      return new DozKursDetailsController();
    }

    return null;
  }

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