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

namespace Kufer\Web\KuferTools\Teilnehmer\BayerischerApothekertagStudenten\SaveAnmeldeFormular;

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

  protected function getRequestObj()
  {
    $wssHandler = new \Kufer\Web\KuferTools\Utils\WssHandler(
      SaveAnmeldeFormularUseCase::getToolId(),
      SaveAnmeldeFormularUseCase::getToolSectionId(),
      SaveAnmeldeFormularUseCase::getUser()
    );
    $requestObj = new SaveAnmeldeFormularRequest();
    $requestObj->columnValues = $wssHandler->getColumnValuesFromPost();
    $requestObj->wssHandler = $wssHandler;

    $action = $this->getActionVal();

    return $this->handleXsrf($requestObj, $action);
  }

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