<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;


class CreateDeviceRequest 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
    {
        // Log::info("CreateDeviceRequest: " . json_encode($this->all()));
        return [
            'name' => 'required|string|max:255',
            'label' => 'required|string|max:255',
            'customerId' => 'required|integer',
            'asset_id' => 'required|string',
        ];
    }

    public function messages()
    {
        return [
            'name.required' => 'Name is required!',
            'label.required' => 'Label is required!',
            'customerId.required' => 'Customer is required!',
            'asset_id.required' => 'Asset is required!',
        ];
    }
}
