<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CreateUserRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'email' => 'required|email|unique:users,email',
            // 'password' => 'required|min:6',
            'authority' => 'required|in:TENANT_ADMIN,CUSTOMER_USER,SYS_ADMIN',
            'first_name' => 'nullable|string|max:50',
            'last_name' => 'nullable|string|max:50',
            'phone' => 'nullable|string|max:20',
            'tenant_id' => 'required|integer',
            'customer_id' => 'required|uuid',
            'version' => 'required|integer',
            'name' => 'required|string|max:255',
            'description' => 'nullable|string',
            'default_dashboard_id' => 'nullable|uuid',
            'default_dashboard_fullscreen' => 'boolean',
            'home_dashboard_id' => 'nullable|uuid',
            'home_dashboard_hide_toolbar' => 'boolean',
            'user_credentials_enabled' => 'boolean',
            'failed_login_attempts' => 'integer',
            'last_login_ts' => 'nullable|integer',
        ];
    }
}
