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

class CanTopUpWallet extends AbstractRule
{

    /** @var TopUpWalletValidation */
    private $topUpWalletValidation;


    public function __construct(TopUpWalletValidation $topUpWalletValidation)
    {
        $this->topUpWalletValidation = $topUpWalletValidation;
    }


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

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

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

}
