mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-20 21:14:10 +00:00
44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Orders\Standards\Validators;
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
|
|
|
class OrderRoleValidation extends AbstractValidation
|
|
{
|
|
/**
|
|
* @param OrderObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array
|
|
{
|
|
return [
|
|
'order_id' => $object->getOrderId(),
|
|
'company_module_id' => $object->getCompanyModuleId(),
|
|
'role_hash_id' => $object->getRoleHashId(),
|
|
'role_signature' => $object->getRoleSignature(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @param string $type
|
|
* @return array
|
|
*/
|
|
protected function rules(?string $type = 'POST'): array
|
|
{
|
|
return [
|
|
'order_id' => 'required|exists:orders,id',
|
|
'company_module_id' => 'required|exists:company_modules,id',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|