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

namespace Kufer\Web\KuferTools\Mitarbeiter\KursUebersicht\KursDetails\Feedback;

class FeedbackUseCase extends \Kufer\Web\KuferTools\Basis\KursDetails\Feedback\FeedbackFormularUseCase
{
  public function __construct($request)
  {
    parent::__construct($request, new FeedbackResponse());
  }

  public static function getToolId()
  {
    return \ToolsAPI::TOOL_KURSPLANUNG_MA;
  }

  public static function getToolSectionId()
  {
    return 377;
  }

  public function hasAccess($pToolSectionId = null)
  {
    if (!parent::hasAccess()) {
      return false;
    }
    if (!$this->isRechtAllowed('377.0.6')) {
      return false;
    }

    return true;
  }

  protected function getKursnummer()
  {
    return $this->request->knr;
  }

  protected function getAction(): string
  {
    return 'kursdetails&knr=' . $this->request->knr;
  }
}

class FeedbackRequest extends \Kufer\Web\KuferTools\Basis\KursDetails\Feedback\FeedbackFormularRequest
{
}

class FeedbackResponse extends \Kufer\Web\KuferTools\Basis\KursDetails\Feedback\FeedbackFormularResponse
{
}