Overview
Items represent the master catalog in SushiGo. Each Item can have multiple ItemVariants that represent different packaging sizes, presentations, or configurations.Example: Item “Rice” (INSUMO) might have variants: “Rice 1kg Bag”, “Rice 5kg Bag”, “Rice 20kg Sack” — each with different codes, barcodes, and pricing.
Item Structure
Item (Master)
The parent entity that groups related variants.Unique SKU code (max 100 chars, auto-uppercase)Example:
INS-001, PROD-CALIFORNIA, ACT-COOKERItem name (max 255 chars)Example:
Arroz Sushi Premium, California Roll, Rice CookerDetailed description (optional)
Item type:
INSUMO, PRODUCTO, or ACTIVOWhether to track inventory for this item
Whether item has expiration dates (enables lot tracking)
Active status (inactive items hidden from selection)
ItemVariant (SKU Level)
Represents a specific SKU with its own barcode, pricing, and stock tracking.Parent item ID
Base unit of measure ID (e.g., kg, unit, liter)
Unique variant code (max 100 chars, auto-uppercase)Example:
ARR-KG, ARR-5KG, ROLL-CAL-8PCProduct barcode (EAN, UPC, Code128, etc.)Auto-cleaned: removes spaces and special chars
Variant name (max 255 chars)Example:
Arroz Premium 1kg, California Roll 8 piezasVariant-specific description
Enable lot number tracking (for batches with expiration)
Enable serial number tracking (for unique assets)
Default sale price (optional)
Minimum stock level (triggers low stock alerts)
Maximum stock level (must be >= min_stock)
Active status
Cost Tracking Fields (Auto-Updated)
Most recent purchase cost per base unit
Weighted average cost per base unit (updated on receipts)
API Endpoints
Create Item
Create Item Variant
List Items
Filter by type:
INSUMO, PRODUCTO, or ACTIVOFilter stocked items
Filter perishable items
Filter active/inactive items
Search by SKU or name (case-insensitive)
Results per page
Show Item
Update Item
Delete Item
Real-World Examples
Example 1: INSUMO with Multiple Variants
Item: Salmon (INSUMO)SAL-KG- Salmon Atlantic 1kg (base UOM: kg)SAL-200G- Salmon Atlantic 200g (conversion: 1kg = 5 × 200g)SAL-SAKU- Salmon Saku Block 250g (conversion: 1kg = 4 × 250g)
Example 2: PRODUCTO with Single Variant
Item: California Roll (PRODUCTO)ROLL-CAL-8PC- California Roll 8 piezas (base UOM: unit, sale_price: 120.00)
Products typically have 1:1 UOM (base unit only). Multi-unit conversions are for INSUMOs.
Example 3: ACTIVO with Serial Tracking
Item: Rice Cooker (ACTIVO)COOKER-ZOJIRUSHI-10CUP- Zojirushi 10 Cup (track_serial: true)
Validation Rules
Item Creation
- Required Fields
- Optional Fields
- Auto-Transforms
sku(unique, max 100)name(max 255)type(INSUMO, PRODUCTO, ACTIVO)
Variant Creation
- Required Fields
- Optional Fields
- Custom Validations
item_id(must exist)uom_id(must exist)code(unique, max 100)name(max 255)
Business Rules
Type Immutability
Item type cannot be changed after creation
SKU Uniqueness
SKUs and variant codes must be globally unique
Soft Deletion
Deleted items preserved for audit trail
Cost Tracking
Costs updated automatically on stock receipts
UOM Rules by Type
| Type | UOM Conversions | Typical Base UOM |
|---|---|---|
| INSUMO | Multiple allowed | kg, L, unit, box |
| PRODUCTO | Base only (1:1) | unit, portion, set |
| ACTIVO | Base only (1:1) | unit, set |
Common Workflows
Workflow 1: Register New Supply
Workflow 2: Add Finished Product
Database Schema
items Table
| Column | Type | Constraints |
|---|---|---|
| id | bigint | PK, auto-increment |
| sku | varchar(100) | UNIQUE, NOT NULL |
| name | varchar(255) | NOT NULL |
| description | text | NULLABLE |
| type | enum | IN (‘INSUMO’, ‘PRODUCTO’, ‘ACTIVO’) |
| is_stocked | boolean | DEFAULT true |
| is_perishable | boolean | DEFAULT false |
| is_active | boolean | DEFAULT true |
| meta | jsonb | DEFAULT '' |
| created_at | timestamp | |
| updated_at | timestamp | |
| deleted_at | timestamp | NULLABLE |
item_variants Table
| Column | Type | Constraints |
|---|---|---|
| id | bigint | PK, auto-increment |
| item_id | bigint | FK → items.id |
| uom_id | bigint | FK → units_of_measure.id |
| code | varchar(100) | UNIQUE, NOT NULL |
| barcode | varchar(50) | UNIQUE, NULLABLE |
| name | varchar(255) | NOT NULL |
| description | text | NULLABLE |
| track_lot | boolean | DEFAULT false |
| track_serial | boolean | DEFAULT false |
| last_unit_cost | decimal(10,4) | DEFAULT 0 |
| avg_unit_cost | decimal(10,4) | DEFAULT 0 |
| sale_price | decimal(10,4) | NULLABLE |
| min_stock | decimal(10,4) | DEFAULT 0 |
| max_stock | decimal(10,4) | DEFAULT 0 |
| is_active | boolean | DEFAULT true |
| meta | jsonb | DEFAULT '' |
| created_at | timestamp | |
| updated_at | timestamp | |
| deleted_at | timestamp | NULLABLE |
Next Steps
Inventory Locations
Set up locations to hold stock
Unit Conversions
Configure UOM conversions for INSUMOs
Stock Movements
Register opening balances and movements