<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Receipts\DataTransferObjects\ReceiptObject;
use App\Classes\Modules\Receipts\Standards\Validators\ReceiptValidation;

class CanCreateReceipt extends AbstractRule
{

    /** @var ReceiptValidation */
    private $receiptValidation;

  
    public function __construct(ReceiptValidation $receiptValidation)
    {
        $this->receiptValidation = $receiptValidation;
    }


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

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

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

}