<?php

namespace App\Modules\HR\Offboarding\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class ChecklistItemRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->can('offboarding.manage') ?? false;
    }

    public function rules(): array
    {
        return [
            'section' => ['required', Rule::in(['assets', 'accounts', 'documents', 'other'])],
            'title' => ['required', 'string', 'max:255'], 'is_done' => ['sometimes', 'boolean'],
        ];
    }
}
