<?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()
    {
        return true;
    }

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

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