Full contractor inventory management system — track stock, scan barcodes, manage suppliers, and generate usage reports. Terracotta contractor palette.
InventoryDashboard overview with stats, categories, and quick actions
useQuery(api.inventory.items.getStats)
ItemList with search, category filters, stock level bars
useQuery(api.inventory.items.list) + useInventory()
ItemDetail with stock adjustment, supplier info, usage history
useQuery(api.inventory.items.getById) + useMutation(api.inventory.items.adjustStock)
ItemForm with photo upload, auto-SKU, category picker, supplier dropdown
useMutation(api.inventory.items.create) | useMutation(api.inventory.items.update)
BarcodeScanner camera viewfinder with scan overlay and history
expo-camera + useQuery(api.inventory.items.getByBarcode)
PurchaseOrderList with active/completed toggle, status badges, tracking
useQuery(api.inventory.purchaseOrders.list) + usePurchaseOrders()
SupplierDirectory with contact info, item count, delivery avg, ratings
useQuery(api.inventory.suppliers.list)
UsageReports with pie chart, top consumed bars, job-linked breakdown
useQuery(api.inventory.reports.getUsage) + useQuery(api.inventory.reports.getCostByCategory)
inventoryItems // SKU, barcode, stock, cost
inventoryCategories // Plumbing, Electrical, etc.
purchaseOrders // PO#, supplier, status, total
purchaseOrderItems // Line items per PO
suppliers // Name, contact, rating
usageLog // Item + job + qty consumed
stockAdjustments // Audit trail for +/- changes
getStats // totalItems, lowStock, value
listItems // search, category, sort
getItemById // full detail + usage
getByBarcode // scanner lookup
listPurchaseOrders // active/completed
listSuppliers // with item counts
getUsageReport // period, top items
getCostByCategory // pie chart data
createItem
args: name, sku, category, cost, supplier
updateItem
args: itemId, partial fields
adjustStock
args: itemId, delta, reason
createPurchaseOrder
args: supplierId, items[], notes
updatePOStatus
args: poId, status // draft→ordered→shipped→received
createSupplier
args: name, email, phone, rating
logUsage
args: itemId, jobId, quantity
useInventory() // items, stats, search
returns: items, stats, search, filters
usePurchaseOrders() // PO list + CRUD
returns: orders, create, updateStatus
useBarcodeScan() // camera + lookup
returns: scan, result, history
draft // Being assembled by contractor
ordered // Submitted to supplier
shipped // Supplier dispatched
received // All items received + stocked
cancelled // PO cancelled before ship
// Visual indicators
green → stock > 2x reorderPoint
yellow → stock ≤ 2x reorderPoint
red → stock ≤ reorderPoint
// Alert triggers
lowStock → notification + badge
outOfStock → urgent alert + PO suggestion