Overview
Inventory Locations represent physical or logical zones within an Operating Unit where stock is held. Each location maintains separate stock records and enables precise tracking of inventory movement between zones.Example: A branch might have MAIN (warehouse), KITCHEN (prep area), BAR (beverage station), and WASTE (spoilage tracking) as separate locations.
Location Types
SushiGo supports six predefined location types, each with specific operational semantics:MAIN - Primary Warehouse
Primary storage location for the operating unit
- Typically set as
is_primary = true - Receives opening balances and purchase receipts
- Source for transfers to other locations
- Highest priority in allocation logic
KITCHEN - Food Preparation
Prep area where ingredients are consumed for production
- Receives transfers from MAIN
- Source for production consumption
- May have multiple instances (Kitchen 1, Kitchen 2)
BAR - Beverage Station
Dedicated location for beverage inventory
- Receives transfers from MAIN
- Tracks cocktail ingredients, bottled drinks, etc.
- Separate from food prep for control
TEMP - Temporary Location
Temporary holding location (events, catering)
- Used for events or temporary operations
- Stock typically returned to MAIN after event closure
- Time-bounded (start_date, end_date on Operating Unit)
RETURN - Return/Quarantine
Holding area for returned or quarantined items
- Receives customer returns or damaged goods
- Quality inspection before moving to MAIN or WASTE
- Separate costing and reporting
WASTE - Spoilage/Loss
Virtual location for tracking spoilage, breakage, and loss
- Receives stock via CONSUMPTION movements
- Does not transfer out (one-way only)
- Used for loss analysis and variance reports
Location Fields
Parent operating unit ID (branch or event)
Location name (max 255 chars)Examples:
Main Warehouse, Kitchen - Prep 1, Bar CentralLocation type:
MAIN, TEMP, KITCHEN, BAR, RETURN, WASTEWhether this is the primary location for the operating unit
Each operating unit should have exactly one primary location
Active status (inactive locations hidden from selection)
Display/allocation priority (higher = first)Used for sorting in UI and stock allocation logic
Additional notes or instructions
Custom metadata (capacity, address, contact, etc.)
API Endpoints
Create Location
List Locations
Filter by operating unit
Filter by location type
Filter primary locations
Filter active/inactive locations
Show Location with Stock
Update Location
Delete Location
Real-World Examples
Example 1: Single Branch Setup
Operating Unit: SushiGo Centro (BRANCH_MAIN) Locations:- Opening balances registered at MAIN
- Morning prep: transfer ingredients MAIN → KITCHEN
- Service: consumption from KITCHEN (reason: CONSUMPTION)
- Spoilage: transfer KITCHEN → WASTE (reason: CONSUMPTION)
Example 2: Event Setup
Operating Unit: Festival Nikkei 2026 (EVENT_TEMP) Locations:- Pre-event: transfer from branch MAIN → event MAIN
- During event: transfers event MAIN → prep tents → booths
- Post-event: count remaining stock, transfer back to branch MAIN
- Event closure: generate profitability report
Example 3: Multi-Kitchen Branch
Operating Unit: SushiGo Polanco (Large Format) Locations:Location Workflows
Workflow 1: Initial Location Setup
Workflow 2: Stock Allocation Flow
Workflow 3: End-of-Day Count
Business Rules
One Primary per Unit
Each operating unit must have exactly one primary location
Type Immutability
Location type cannot be changed after creation
Zero Stock Deletion
Can only delete locations with zero stock
WASTE One-Way
WASTE locations only receive (never transfer out)
Priority Guidelines
| Type | Suggested Priority | Reasoning |
|---|---|---|
| MAIN | 100 | Default source for allocations |
| KITCHEN | 40-60 | Active working locations |
| BAR | 40-50 | Active working locations |
| TEMP | 30-50 | Event-specific, temporary |
| RETURN | 10-20 | Inspection/quarantine area |
| WASTE | 0 | Tracking only, no allocations |
Database Schema
inventory_locations Table
| Column | Type | Constraints |
|---|---|---|
| id | bigint | PK, auto-increment |
| operating_unit_id | bigint | FK → operating_units.id, NOT NULL |
| name | varchar(255) | NOT NULL |
| type | enum | IN (‘MAIN’, ‘TEMP’, ‘KITCHEN’, ‘BAR’, ‘RETURN’, ‘WASTE’) |
| is_primary | boolean | DEFAULT false |
| is_active | boolean | DEFAULT true |
| priority | integer | DEFAULT 0 |
| notes | text | NULLABLE |
| meta | jsonb | DEFAULT '' |
| created_at | timestamp | |
| updated_at | timestamp | |
| deleted_at | timestamp | NULLABLE |
idx_inventory_locations_operating_uniton (operating_unit_id)idx_inventory_locations_typeon (type)idx_inventory_locations_priorityon (priority DESC, name ASC)
- Unique: (operating_unit_id, name)
- Check:
priority >= 0
Integration Points
With Stock
Each location has manyStock records (one per item variant):
With Stock Movements
Locations are source and target for movements:Common Queries
Get Stock Summary by Location
Find Primary Location for Operating Unit
Get Active Locations by Type
Validation Rules
Location Creation
- Required Fields
- Optional Fields
- Uniqueness
operating_unit_id(must exist)name(max 255)type(valid enum)
Business Validations
- Cannot set
is_primary=trueif operating unit already has a primary location - Cannot delete location with on_hand > 0 or reserved > 0
- Cannot change
typeoroperating_unit_idafter creation - Cannot deactivate location with active stock movements
Best Practices
Use Descriptive Names
Use Descriptive Names
Name locations clearly: “Kitchen - Sushi Bar” instead of “K1”
Set Meaningful Priorities
Set Meaningful Priorities
Use priority to control allocation order: MAIN (100) > KITCHEN (50) > WASTE (0)
Track Waste Separately
Track Waste Separately
Always create a WASTE location to measure loss and spoilage
Use RETURN for QC
Use RETURN for QC
Create a RETURN location for items that need inspection before re-stocking
Consolidate Before Counts
Consolidate Before Counts
Transfer unused stock back to MAIN before physical counts for accuracy
Next Steps
Stock Movements
Record transfers and consumption between locations
Items & Variants
Define items to track in these locations