<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionDetailObject;
use App\Classes\Modules\Transactions\Standards\Validators\TransactionDetailValidation;

class CanCreateTransactionDetail extends AbstractRule
{

    /** @var TransactionDetailValidation */
    private $transactionDetailValidation;

  
    public function __construct(TransactionDetailValidation $transactionDetailValidation)
    {
        $this->transactionDetailValidation = $transactionDetailValidation;
    }


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

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

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

}