<?php

namespace App\Http\Requests;

use App\Enums\SpecDocumentSectionType;
use Illuminate\Validation\Rule;

class StoreSpecDocumentSection extends SpecDocumentRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'type' => ['required', Rule::in(SpecDocumentSectionType::values())],
            'title' => ['required', 'string', 'max:255'],
            'data' => ['sometimes', 'nullable', 'array'],
        ];
    }
}
