mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Currencies\Standards\Rules;
|
|
|
|
|
|
use App\Classes\General\Abstracts\AbstractRule;
|
|
use App\Classes\Modules\Currencies\DataTransferObjects\CurrencyObject;
|
|
use App\Classes\Modules\Currencies\Standards\Validators\CurrencyValidation;
|
|
|
|
class CanUpdateCurrency extends AbstractRule
|
|
{
|
|
|
|
/** @var CurrencyValidation */
|
|
private $currencyValidation;
|
|
|
|
|
|
/**
|
|
* CanUpdateCurrency constructor.
|
|
* @param CurrencyValidation $currencyValidation
|
|
*/
|
|
public function __construct(CurrencyValidation $currencyValidation)
|
|
{
|
|
$this->currencyValidation = $currencyValidation;
|
|
}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
protected function authorized(): bool
|
|
{
|
|
// TODO Set Authorization rules
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @param CurrencyObject $object
|
|
* @return bool
|
|
* @throws \App\Classes\Exceptions\RequestValidationException
|
|
*/
|
|
protected function validators($object): bool
|
|
{
|
|
return $this->currencyValidation->validate($object);
|
|
}
|
|
|
|
/**
|
|
* @param CurrencyObject $object
|
|
* @return bool
|
|
*/
|
|
protected function criteria($object): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
} |