<?php

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


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

class CanUpdateBank extends AbstractRule
{

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


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

    /**
     * @return bool
     */
    protected function authorized(): bool
    {
        // TODO  Set Authorization rules
        return true;
    }

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

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

}