mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +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\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;
|
|
}
|
|
|
|
} |