mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
a2381e44a7
Update Company Service Class Create Documents Service Class Create File Service Class Base64 File Convert Service Class File Upload Storage Service Class
53 lines
1.4 KiB
PHP
53 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Documents\Standards\Validators;
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
|
|
|
class DocumentValidation extends AbstractValidation
|
|
{
|
|
/**
|
|
* @param DocumentObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array
|
|
{
|
|
return [
|
|
'owner_id' => $object->getOwnerId(),
|
|
'owner_type' => $object->getOwnerType(),
|
|
'document_type' => $object->getDocumentType(),
|
|
'reference' => $object->getReference(),
|
|
'status' => $object->getStatus(),
|
|
'approved_by' => $object->getApprovedBy(),
|
|
'issued_date' => $object->getIssuedDate(),
|
|
'expired_date' => $object->getExpiredDate(),
|
|
'approved_date' => $object->getApprovedDate()
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function rules(): array
|
|
{
|
|
return [
|
|
'owner_id' => 'required',
|
|
'owner_type' => 'required',
|
|
'document_type' => 'required',
|
|
'reference' => 'required',
|
|
'status' => '',
|
|
'issued_date' => '',
|
|
'expired_date' => '',
|
|
'approved_date' => '',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array
|
|
{
|
|
return [];
|
|
}
|
|
} |