mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
1dfb75545f
Fetch Currency Rate Logic Class Create Currency Rate Logic Class Update Currency Rate Logic Class Currency Rate Converter Rate
44 lines
1013 B
PHP
44 lines
1013 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\CurrencyRates\Standards\Validators;
|
|
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\CurrencyRates\DataTransferObjects\CurrencyRateObject;
|
|
|
|
class CurrencyRateValidation extends AbstractValidation
|
|
{
|
|
/**
|
|
* @param CurrencyRateObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array {
|
|
|
|
$data = [
|
|
'currency_id'=> $object->getCurrencyId(),
|
|
'selling' => $object->getSelling(),
|
|
'payment_method_type' => $object->getPaymentMethodType(),
|
|
];
|
|
|
|
return $data;
|
|
}
|
|
|
|
/**
|
|
* @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 [];
|
|
}
|
|
|
|
} |