CREATE TABLE IF NOT EXISTS cash_movements (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    session_id BIGINT UNSIGNED NOT NULL,
    type VARCHAR(30) NOT NULL, -- suprimento | sangria | venda | troco | ajuste
    amount DECIMAL(18,2) NOT NULL,
    reason VARCHAR(255) NULL,
    ref_sale_id BIGINT UNSIGNED NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (session_id) REFERENCES cash_sessions(id)
);