<?php

declare(strict_types=1);

namespace Seka\Vzdelavanie\Http\Requests\Frontend\Testovanie;

use Illuminate\Foundation\Http\FormRequest;

/**
 * Class VyhodnotenieTestuPutRequest
 *
 * @package Seka\Vzdelavanie\Http\Requests\Frontend\Testovanie
 */
final class VyhodnotenieTestuPutRequest extends FormRequest
{
    /**
     * @return bool
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function expectsJson(): bool
    {
        return true;
    }

    /**
     * @return string[]
     */
    public function rules(): array
    {
        return [
            'id' => 'required|integer',
            'otazky' => 'required|array',
            'otazky.*.id' => 'required|integer',
            'otazky.*.odpovede' => 'required|array',
            'otazky.*.odpovede.*.id' => 'required|integer',
            'otazky.*.odpovede.*.otazka_id' => 'required|integer',
            'otazky.*.odpovede.*.zvolena' => 'required|boolean',
        ];
    }
}
