<?php

declare(strict_types=1);

namespace App\Http\Requests\ProjectRequest;

use App\Models\ProjectRequest;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

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

    public function rules(): array
    {
        return [
            'status' => ['required', 'string', Rule::in(array_keys(ProjectRequest::statusOptions()))],
            'admin_note' => ['nullable', 'string', 'max:5000'],
            'create_project' => ['nullable', 'boolean'],
        ];
    }

    public function messages(): array
    {
        return [
            'status.required' => 'وضعیت الزامی است.',
            'status.in' => 'وضعیت معتبر نیست.',
        ];
    }
}
