<?php

namespace App\Classes\Modules\Banks\Standards\Rules;

use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Banks\Standards\Validators\BankValidation;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyObject;

class CanCreateBank extends AbstractRule
{

    /** @var BankValidation */
    private $BankValidation;

    /**
     * CanCreateBank constructor.
     * @param BankValidation $BankValidation
     */
    public function __construct(BankValidation $BankValidation)
    {
        $this->BankValidation = $BankValidation;
    }

    /**
     * @return bool
     */
    protected function authorized(): bool
    {
        return true;
    }

    /**
     * @param CompanyObject $object
     * @return bool
     * @throws \App\Classes\Exceptions\RequestValidationException
     */
    protected function validators($object): bool
    {
        return $this->BankValidation->validate($object);
    }

    /**
     * @param CompanyObject $object
     * @return bool
     */
    protected function criteria($object): bool
    {
        return true;
    }
}