"""Migration 0024: Add outreach pipeline fields to suppliers table.

Four columns track cold B2B outreach state.  NULL outreach_status means the
supplier is not in the pipeline — this keeps existing claimed/paid suppliers
unaffected without requiring a backfill.
"""


def up(conn) -> None:
    # Status in the outreach pipeline.  NULL = not in pipeline.
    conn.execute("ALTER TABLE suppliers ADD COLUMN outreach_status TEXT DEFAULT NULL")
    # Freeform admin notes about this contact.
    conn.execute("ALTER TABLE suppliers ADD COLUMN outreach_notes TEXT DEFAULT NULL")
    # Timestamp of last outreach email sent.
    conn.execute("ALTER TABLE suppliers ADD COLUMN last_contacted_at TEXT DEFAULT NULL")
    # 0 = not started, 1 = initial contact, 2-5 = follow-ups.
    conn.execute("ALTER TABLE suppliers ADD COLUMN outreach_sequence_step INTEGER DEFAULT 0")
