BEGIN;

-- =======================
-- DISPOSITION ACTIONS
-- =======================
CREATE TABLE IF NOT EXISTS disposition_actions (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    code TEXT UNIQUE NOT NULL,
    label TEXT NOT NULL,
    description TEXT,
    requires_note BOOLEAN NOT NULL DEFAULT FALSE,
    group_name TEXT,
    sort_order INT,
    is_active BOOLEAN NOT NULL DEFAULT TRUE,
    created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP
);

CREATE TRIGGER trg_disposition_actions_updated_at
    BEFORE UPDATE ON disposition_actions
    FOR EACH ROW EXECUTE FUNCTION set_updated_at();

COMMIT; 