<?php

namespace App\Http\Requests\TaskInstances;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'task_template_id' => ['sometimes', 'required', 'integer', 'exists:task_templates,id'],
            'due_date' => ['sometimes', 'required', 'date'],
            'status' => ['sometimes', 'nullable', 'string', 'max:50'],
            'completed_at' => ['sometimes', 'nullable', 'date'],
            'notes' => ['sometimes', 'nullable', 'string'],
        ];
    }
}
