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

namespace Kufer\KuferTools\Teilnehmer\BayerischerApothekertag\CheckKonto;

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

  public function action()
  {
    $resultAry = \ValidationAPI::validateDta($this->request->konto, $this->request->blz);

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

  public static function getToolSectionId()
  {
    return 550;
  }

  public static function getToolId()
  {
    return 45;
  }

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

    return $this->response;
  }
}

class CheckKontoRequest
{
  public $konto;
  public $blz;
}

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