-- Migration: Create inventory_items table (produtos-venda)
CREATE TABLE IF NOT EXISTS inventory_items (
    id UUID PRIMARY KEY,
    product_id UUID NOT NULL REFERENCES products(id), -- catalogo_id
    seller_id UUID NOT NULL REFERENCES companies(id), -- empresa_id
    sale_price_cents BIGINT NOT NULL DEFAULT 0,       -- preco_venda
    stock_quantity BIGINT NOT NULL DEFAULT 0,         -- qtdade_estoque
    batch VARCHAR(255),                               -- Lote (implicit in img?)
    expires_at TIMESTAMP,                             -- data_validade
    observations TEXT,                                -- observacoes
    created_at TIMESTAMP DEFAULT (NOW() AT TIME ZONE 'utc'),
    updated_at TIMESTAMP DEFAULT (NOW() AT TIME ZONE 'utc')
);
