<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Receipts\DataTransferObjects\ReceiptDetailObject;
use App\Classes\Modules\Receipts\Standards\Validators\ReceiptDetailValidation;

class CanCreateReceiptDetail extends AbstractRule
{

    /** @var ReceiptDetailValidation */
    private $receiptDetailValidation;

  
    public function __construct(ReceiptDetailValidation $receiptDetailValidation)
    {
        $this->receiptDetailValidation = $receiptDetailValidation;
    }


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

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

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

}