"""Expand lead_requests for 3-step quote qualification flow."""


def up(conn):
    cols = {r[1] for r in conn.execute("PRAGMA table_info(lead_requests)")}
    new_cols = {
        "facility_type": "TEXT",
        "glass_type": "TEXT",
        "lighting_type": "TEXT",
        "build_context": "TEXT",
        "country": "TEXT",
        "timeline": "TEXT",
        "location_status": "TEXT",
        "financing_status": "TEXT",
        "wants_financing_help": "INTEGER DEFAULT 0",
        "decision_process": "TEXT",
        "previous_supplier_contact": "TEXT",
        "services_needed": "TEXT",
        "additional_info": "TEXT",
        "contact_name": "TEXT",
        "contact_email": "TEXT",
        "contact_phone": "TEXT",
        "contact_company": "TEXT",
        "heat_score": "TEXT DEFAULT 'cool'",
    }
    for col, col_type in new_cols.items():
        if col not in cols:
            conn.execute(
                f"ALTER TABLE lead_requests ADD COLUMN {col} {col_type}"
            )
