<?php

namespace App\Http\Requests;

use App\Models\Informacia\Enums\StavInformacieEnum;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Enum;

/**
 * Class InformaciaCreateRequest
 */
class InformaciaCreateRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'titulok' => 'required',
            'obsah' => 'nullable|max:4096',
            'stav' => ['required', new Enum(StavInformacieEnum::class)],
            'zverejnit_pre_pouzivatelov_podla_role' => 'array|nullable',
            'planovany_cas_zverejnenia' => 'datetime|nullable|after:now',
            'odoslat_email_pouzivatelom' => 'required|boolean',
            'odoslat_push_notifikacie_pouzivatelom' => 'required|boolean',
            'odporucane' => 'required|boolean',
        ];
    }
}
