<?php

namespace App\Classes\Modules\Accounts\Standards\Validators;

use App\Classes\General\Abstracts\AbstractValidation;
use App\Classes\Modules\Accounts\DataTransferObjects\RegistrationObject;

class UserRegistrationValidation extends AbstractValidation
{


    /**
     * @param RegistrationObject $object
     * @return array
     */
    protected function data($object): array
    {
        return [
            'name' => $object->getName(),
            'email' => $object->getEmail(),
            'password' => $object->getPassword(),
            'password_confirmation' => $object->getPasswordConfirmation(),
            'type' => $object->getType(),
            'status' => $object->getStatus(),
        ];
    }

    /**
     * @return array
     */
    protected function rules(): array
    {
        return [
            'name' => 'required',
            'email' => 'required|email|max:255|unique:users,email',
            'password' => 'required|min:6|confirmed',
            'type' => 'required',
            'status' => 'required'
        ];
    }

    /**
     * @return array
     */
    protected function messages(): array
    {
        return [];
    }
}