+-------------------+ | locations | +-------------------+ | id (PK) | | code (UQ) | | name | | address | | created_at | | updated_at | +-------------------+ | | 1 | | N +-------------------+ | inventories | +-------------------+ | id (PK) | | item_id (FK) | | location_id (FK) | | quantity | +-------------------+ ^ | | | N | | 1 +-------------------+ +----------------------+ | items | | item_barcodes | +-------------------+ +----------------------+ | id (PK) |<------ | id (PK) | | sku (UQ) | 1:N | item_id (FK) | | name | | barcode (UQ) | | description | | is_primary | | unit | +----------------------+ | is_active | | created_at | | updated_at | +-------------------+ | | 1 | | N +------------------------+ | stock_movements | +------------------------+ | id (PK) | | item_id (FK) | | location_id (FK) | | movement_type | | quantity | | reference_type | | reference_id | | notes | | created_at | +------------------------+ ================ STO MODULE ================= +-------------------------------+ | stock_transfer_orders (STO) | +-------------------------------+ | id (PK) | | sto_number (UQ) | | from_location_id (FK) | | to_location_id (FK) | | status | | created_by | | approved_by | | created_at | | updated_at | +-------------------------------+ | 1 | | N +--------------------------------------+ | stock_transfer_order_items | +--------------------------------------+ | id (PK) | | sto_id (FK) | | item_id (FK) | | requested_qty | | shipped_qty | | received_qty | +--------------------------------------+ | | 1 | | N +--------------------------------------+ | stock_transfer_shipments | +--------------------------------------+ | id (PK) | | sto_id (FK) | | shipped_at | | received_at | | status | +--------------------------------------+ ================ USERS ================= +-------------------+ | users | +-------------------+ | id (PK) | | name | | email (UQ) | | password | | role | | created_at | +-------------------+