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

namespace Kufer\Web\KuferTools\Teilnehmer\BayerischerApothekertagEhrengaeste\CheckSepa;

class CheckSepaUseCase extends \Kufer\Web\KuferTools\Basis\UseCase\ToolUseCase
{
  public function __construct($request)
  {
    parent::__construct($request, new CheckSepaResponse());
  }

  public function action()
  {
    $resultAry = \ValidationAPI::validateSepa($this->request->iban, $this->request->bic, \SessionOperations::getCurrentWebToolsUser()->tnr);

    return $this->getResponse($resultAry);
  }

  public static function getToolSectionId()
  {
    return 550;
  }

  public static function getToolId()
  {
    return 47;
  }

  protected function getResponse($resultAry)
  {
    $this->response->result = $resultAry;

    return $this->response;
  }
}

class CheckSepaRequest
{
  public $iban;
  public $bic;
}

class CheckSepaResponse extends \Kufer\Web\KuferTools\Basis\UseCase\ToolResponse
{
  public $result;
}