<?php

namespace App\Modules\HR\Recruitment\Requests;

use App\Modules\HR\Recruitment\Support\OnboardingTaskStatus;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

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

    /** @return array<string, mixed> */
    public function rules(): array
    {
        return [
            'status' => ['sometimes', 'required', Rule::in(OnboardingTaskStatus::all())],
            'assigned_to' => ['nullable', 'integer', 'exists:users,id'],
            'due_date' => ['nullable', 'date'],
            'notes' => ['nullable', 'string', 'max:5000'],
            'meta' => ['nullable', 'array'],
            'meta.account_username' => ['nullable', 'string', 'max:255'],
            'meta.asset_name' => ['nullable', 'string', 'max:255'],
            'meta.asset_serial' => ['nullable', 'string', 'max:255'],
            'meta.custom_label' => ['nullable', 'string', 'max:255'],
        ];
    }
}
