fix inventory

This commit is contained in:
root
2026-06-11 11:06:32 -04:00
parent 9483750161
commit c91fa2ce4d
53 changed files with 2936 additions and 12666 deletions
@@ -14,13 +14,13 @@ class InventoryItemStoreRequest extends ApiFormRequest
public function rules(): array
{
return [
'type' => ['required', 'string', 'max:20'],
'category_id' => ['nullable', 'integer', 'min:1'],
'type' => ['required', 'string', 'in:classroom,book,office,kitchen'],
'category_id' => ['nullable', 'integer', 'min:1', 'exists:inventory_categories,id'],
'name' => ['required', 'string', 'max:255'],
'description' => ['nullable', 'string'],
'quantity' => ['nullable', 'integer'],
'quantity' => ['nullable', 'integer', 'min:0'],
'unit' => ['nullable', 'string', 'max:50'],
'condition' => ['nullable', 'string', 'max:50'],
'condition' => ['nullable', 'string', 'in:good,needs_repair,need_replace,cannot_find'],
'isbn' => ['nullable', 'string', 'max:50'],
'edition' => ['nullable', 'string', 'max:50'],
'sku' => ['nullable', 'string', 'max:50'],
@@ -14,12 +14,12 @@ class InventoryItemUpdateRequest extends ApiFormRequest
public function rules(): array
{
return [
'category_id' => ['nullable', 'integer', 'min:1'],
'category_id' => ['nullable', 'integer', 'min:1', 'exists:inventory_categories,id'],
'name' => ['sometimes', 'string', 'max:255'],
'description' => ['nullable', 'string'],
'quantity' => ['nullable', 'integer'],
// quantity is intentionally excluded: stock changes must go through movements
'unit' => ['nullable', 'string', 'max:50'],
'condition' => ['nullable', 'string', 'max:50'],
'condition' => ['nullable', 'string', 'in:good,needs_repair,need_replace,cannot_find'],
'isbn' => ['nullable', 'string', 'max:50'],
'edition' => ['nullable', 'string', 'max:50'],
'sku' => ['nullable', 'string', 'max:50'],