<?php

namespace App\Http\Requests\Leave;

use Illuminate\Foundation\Http\FormRequest;

class UpdateRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'leave_type' => 'nullable|string|in:annual,half_am,half_pm,sick,family,maternity,parental',
            'start_date' => 'nullable|date',
            'end_date' => 'nullable|date|after_or_equal:start_date',
            'days' => 'nullable|numeric|min:0.5|max:365',
            'reason' => 'nullable|string|max:1000',
        ];
    }
}
