mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-21 21:44:16 +00:00
51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?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;
|
|
}
|
|
|
|
} |