<?php

namespace App\Http\Requests\Inventory;

use App\Http\Requests\ApiFormRequest;

class InventoryCategoryUpdateRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return auth()->check();
    }

    public function rules(): array
    {
        return [
            'type' => ['sometimes', 'string', 'max:20'],
            'name' => ['sometimes', 'string', 'max:120'],
            'description' => ['nullable', 'string'],
            'grade_min' => ['nullable', 'integer', 'min:0', 'max:13'],
            'grade_max' => ['nullable', 'integer', 'min:0', 'max:13'],
        ];
    }
}
