<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'title' => 'sometimes|required|string|max:255',
            'description' => 'nullable|string',
            'project_id' => 'sometimes|required|exists:projects,id',
            'assignee_id' => 'nullable|exists:users,id',
            'priority' => 'nullable|string|max:50',
            'status' => 'nullable|string|max:50',
            'blocker_type' => 'nullable|string|max:80',
            'blocker_note' => 'nullable|string',
            'start_date' => 'nullable|date',
            'due_date' => 'nullable|date',
            'estimated_time' => 'nullable|numeric',
            'actual_time' => 'nullable|numeric',
        ];
    }
}
