mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
52 lines
1.1 KiB
PHP
52 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($object): 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;
|
|
}
|
|
|
|
}
|