<?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\WithdrawWalletValidation;

class CanWithdrawWallet extends AbstractRule
{

    /** @var WithdrawWalletValidation */
    private $witdrawWalletValidation;


    public function __construct(WithdrawWalletValidation $witdrawWalletValidation)
    {
        $this->witdrawWalletValidation = $witdrawWalletValidation;
    }


    /**
     * @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->witdrawWalletValidation->validate($object);
    }

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

}
