<?php

declare(strict_types=1);

namespace Seka\Vzdelavanie\Http\Requests\Api;

use Spatie\Enum\Laravel\Rules\EnumRule;
use Spatie\Enum\Laravel\Http\EnumRequest;
use Seka\Vzdelavanie\Enums\ModelsTypeEnum;
use Illuminate\Foundation\Http\FormRequest;
use Spatie\Enum\Laravel\Http\Requests\TransformsEnums;

/**
 * Class OblubeneStoreRequest
 *
 * @package Seka\Vzdelavanie\Http\Requests\Api
 */
class OblubeneStoreRequest extends FormRequest
{
    use TransformsEnums;

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

    /**
     * @return array
     */
    public function rules()
    {
        return [
            'id' => 'required|integer',
            'typ' => [
                'required',
                new EnumRule(ModelsTypeEnum::class),
            ]
        ];
    }

    /**
     * @return string[]
     */
    public function enums(): array
    {
        return [
            EnumRequest::REQUEST_REQUEST => [
                'typ' => ModelsTypeEnum::class,
            ],
        ];
    }
}
