<?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 [];
    }
}