Skip to content

Inventory Management Components

Overview

The Inventory Management module provides enterprise-grade stock tracking and management capabilities.

Components

InventoryList

Main inventory overview component displaying all inventory items.

Features:

  • Search by SKU or name
  • Filter by zone and low stock status
  • Sortable table columns
  • Low stock badge when quantity < min_quantity
  • Direct navigation to item detail page

Location: src/components/admin/InventoryList.tsx

InventoryItemPage

Detailed view for a single inventory item.

Features:

  • Item header with SKU, name, quantity, and zone
  • Zone location display
  • Low stock warning when quantity < min_quantity
  • Stock chart showing movement history grouped by date
  • Movement log table with filters
  • Action buttons: Inbound, Outbound, Transfer, Adjust Stock

Location: src/components/admin/InventoryItemPage.tsx

CreateInventoryItemModal

Modal for creating new inventory items.

Features:

  • SKU input (unique)
  • Name and description fields
  • Zone selection (optional)
  • Minimum quantity setting
  • Unit selection (default: pcs)

Location: src/components/admin/CreateInventoryItemModal.tsx

StockMovementModal

Modal for creating stock movements.

Features:

  • Movement type selection (inbound, outbound, transfer, adjustment)
  • Quantity input with validation
  • Zone selection (from/to based on type)
  • Reason field (optional)
  • Automatic inventory quantity updates

Location: src/components/admin/StockMovementModal.tsx

StockMovementLog

Full registry of all stock movements.

Features:

  • Sortable table
  • Filters: SKU, user, type, date range
  • Movement details: type, quantity, zones, user, timestamp
  • Direct link to item detail page

Location: src/components/admin/StockMovementLog.tsx

Backend Functions

lib/inventory.ts

Core inventory management functions:

  • createItem() - Create new inventory item
  • adjustStock() - Manual stock adjustment
  • inbound() - Inbound stock movement
  • outbound() - Outbound stock movement
  • transfer() - Transfer stock between zones
  • getItemWithMovementHistory() - Get item with full history
  • getLowStockItems() - Get items below minimum quantity

Permissions

  • Admin: Full access (create, read, update, delete, adjustments)
  • Inventory Worker: Read items, create movements (inbound, outbound, transfer)
  • Driver: No access

Database Tables

  • inventory_items - Master inventory data
  • stock_movements - Complete audit trail of all movements

See Database Schema for details.

Veröffentlicht unter kommerzieller Lizenz