mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-30 18:04:28 +00:00
Orders APIs WIP
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\OrderSteps\Standards\Validators;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractValidation;
|
||||
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
||||
|
||||
class UpdateOrderStepValidation extends AbstractValidation
|
||||
{
|
||||
/**
|
||||
* @param OrderObject $object
|
||||
* @return array
|
||||
*/
|
||||
protected function data($object): array
|
||||
{
|
||||
return [
|
||||
'id' => $object->getId(),
|
||||
'current_step' => $object->getCurrentStep(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @return array
|
||||
*/
|
||||
protected function rules(?string $type = 'POST'): array
|
||||
{
|
||||
return [
|
||||
'id'=> 'required|numeric',
|
||||
'current_step'=> 'required',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function messages(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user