<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

namespace Kufer\KuferTools\Teilnehmer\BayerischerApothekertagEhrengaeste\CheckSepa;

class CheckSepaUseCase extends \Kufer\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\KuferTools\Basis\UseCase\ToolResponse
{
  public $result;
}