<?php

namespace App\Http\Requests\CategoryField;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'field_key' => 'sometimes|string|max:30|alpha_dash',
            'field_name' => 'sometimes|string|max:100',
            'field_type' => 'sometimes|string|max:20',
            'is_required' => 'sometimes|boolean',
            'sort_order' => 'sometimes|integer|min:0',
            'default_value' => 'nullable|string|max:100',
            'options' => 'nullable|json',
            'description' => 'nullable|string|max:255',
        ];
    }
}
