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