<?php

namespace App\Http\Requests\CategoryField;

use Illuminate\Foundation\Http\FormRequest;

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

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