<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
use App\Classes\Modules\Transactions\Standards\Validators\TransactionValidation;

class CanCreateTransaction extends AbstractRule
{

    /** @var TransactionValidation */
    private $transactionValidation;

  
    public function __construct(TransactionValidation $transactionValidation)
    {
        $this->transactionValidation = $transactionValidation;
    }


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

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

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

}