mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
45 lines
1015 B
PHP
45 lines
1015 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Currencies\Standards\Validators;
|
|
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\Currencies\DataTransferObjects\RateObject;
|
|
|
|
class RateValidation extends AbstractValidation
|
|
{
|
|
/**
|
|
* @param RateObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array {
|
|
|
|
$data = [
|
|
'currency_id'=> $object->getCurrencyId(),
|
|
'selling' => $object->getSelling(),
|
|
'payment_method_type' => $object->getPaymentMethodType(),
|
|
];
|
|
|
|
return $data;
|
|
}
|
|
|
|
/**
|
|
* @param null|string $type
|
|
* @return array
|
|
*/
|
|
protected function rules(?string $type = 'POST'): array {
|
|
return [
|
|
'currency_id' => $type == 'POST' ? 'required' : '',
|
|
'selling' => 'required',
|
|
'payment_method_type' => 'required',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array {
|
|
return [];
|
|
}
|
|
|
|
} |