<?php

namespace App\Http\Requests\Admin;

use App\Enums\ModerationStatus;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class ModerateContentRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->isAdmin() ?? false;
    }

    public function rules(): array
    {
        return [
            'status' => ['required', Rule::enum(ModerationStatus::class)],
            'reason' => ['nullable', 'string', 'max:2000'],
        ];
    }
}
