<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreInstallRequest 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 [
            'title'          => 'required|string|max:255',
            'description'    => 'nullable|string',
            'address'        => 'required|string|max:255',
            'client_name'    => 'nullable|string|max:255',
            'client_phone'   => 'nullable|string|max:255',
            'scheduled_date' => 'required|date',
            'region'         => 'required|string|max:255',
            'subject'        => 'nullable|string|max:255',
            'installer_id'   => 'nullable|exists:users,id',
            'photos.*'       => 'file|mimes:jpg,jpeg,png,webp,mp4,mov,avi,webm|max:20480',
        ];
    }
}
