mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-21 13:33:57 +00:00
48 lines
926 B
PHP
48 lines
926 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Vouchers\Standards\Validators;
|
|
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\Vouchers\DataTransferObjects\CreateVoucherObject;
|
|
|
|
class VoucherValidation extends AbstractValidation
|
|
{
|
|
/**
|
|
* @param CreateVoucherObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array {
|
|
|
|
$data = [
|
|
'user'=> $object->getUser(),
|
|
'voucherCode' => $object->getVoucherCode(),
|
|
];
|
|
|
|
return $data;
|
|
}
|
|
|
|
/**
|
|
* @param null|string $type
|
|
* @return array
|
|
*/
|
|
protected function rules(): array {
|
|
return [
|
|
'user' => [
|
|
'required',
|
|
],
|
|
'voucherCode' => [
|
|
'required',
|
|
]
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array {
|
|
return [];
|
|
}
|
|
|
|
}
|