<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
use App\Classes\Modules\Wallets\Standards\Validators\CompanyWalletValidation;

class CanCreateCompanyWallet extends AbstractRule
{

    /** @var CompanyWalletValidation */
    private $companyWalletValidation;

    /**
     * CanCreateCompanyWallet constructor.
     * @param CompanyWalletValidation $companyWalletValidation
     */
    public function __construct(CompanyWalletValidation $companyWalletValidation)
    {
        $this->companyWalletValidation = $companyWalletValidation;
    }


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

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


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

}