<?php

namespace App\Http\Requests;

use App\Enums\DietaryRestriction;
use App\Enums\StylePreference;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class UserPreferenceRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    /** @return array<string, mixed> */
    public function rules(): array
    {
        return [
            'dietary_restrictions' => ['nullable', 'array'],
            'dietary_restrictions.*' => ['required', 'string', Rule::enum(DietaryRestriction::class)],
            'style_preferences' => ['nullable', 'array'],
            'style_preferences.*' => ['required', 'string', Rule::enum(StylePreference::class)],
            'other_notes' => ['nullable', 'string', 'max:1000'],
        ];
    }
}
