-- 072_state_puc_requirements.sql
--
-- State PUC/PSC registration requirements for VoIP/IPES and broadband providers.
-- Seeded with all 50 US states + DC.
--
-- Data sources: state PUC websites, regulatory statutes, industry databases.
-- Fee amounts are best-known as of 2025 — verify before filing.

BEGIN;

CREATE TABLE IF NOT EXISTS state_puc_requirements (
    id                      SERIAL PRIMARY KEY,
    state_code              CHAR(2) NOT NULL UNIQUE REFERENCES jurisdictions(code),
    agency_name             TEXT NOT NULL,
    agency_url              TEXT,
    filing_portal_url       TEXT,

    -- VoIP/IPES requirements
    voip_registration_required  BOOLEAN NOT NULL DEFAULT FALSE,
    voip_registration_type      TEXT,  -- 'cpcn','certificate_of_authority','registration','notification','exempt'
    voip_registration_fee_cents INTEGER NOT NULL DEFAULT 0,
    voip_annual_fee_cents       INTEGER NOT NULL DEFAULT 0,
    voip_bond_required          BOOLEAN NOT NULL DEFAULT FALSE,
    voip_bond_amount_cents      INTEGER NOT NULL DEFAULT 0,
    voip_bond_type              TEXT,  -- 'surety','cash','letter_of_credit'
    -- Reseller vs facilities-based differentiation
    voip_reseller_exempt        BOOLEAN NOT NULL DEFAULT FALSE,  -- resellers exempt from full registration?
    voip_reseller_bond_cents    INTEGER NOT NULL DEFAULT 0,      -- lower bond for resellers (0 = same as full)
    voip_reseller_fee_cents     INTEGER NOT NULL DEFAULT 0,      -- different app fee for resellers (0 = same)
    voip_reseller_notes         TEXT,
    voip_ott_exempt             BOOLEAN NOT NULL DEFAULT FALSE,  -- over-the-top VoIP exempt?
    voip_notes                  TEXT,

    -- Broadband/ISP requirements
    broadband_registration_required BOOLEAN NOT NULL DEFAULT FALSE,
    broadband_registration_type     TEXT,
    broadband_registration_fee_cents INTEGER NOT NULL DEFAULT 0,
    broadband_annual_fee_cents      INTEGER NOT NULL DEFAULT 0,
    broadband_notes                 TEXT,

    -- CLEC certification (often separate from VoIP registration)
    clec_certification_required     BOOLEAN NOT NULL DEFAULT FALSE,
    clec_certification_fee_cents    INTEGER NOT NULL DEFAULT 0,
    clec_bond_required              BOOLEAN NOT NULL DEFAULT FALSE,
    clec_bond_amount_cents          INTEGER NOT NULL DEFAULT 0,

    -- Ongoing obligations
    annual_report_required      BOOLEAN NOT NULL DEFAULT FALSE,
    annual_report_due           TEXT,
    usf_surcharge_required      BOOLEAN NOT NULL DEFAULT FALSE,
    usf_surcharge_description   TEXT,

    -- Metadata
    last_verified_date          DATE DEFAULT CURRENT_DATE,
    notes                       TEXT,
    created_at                  TIMESTAMPTZ NOT NULL DEFAULT NOW(),
    updated_at                  TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE INDEX IF NOT EXISTS idx_state_puc_voip_required
  ON state_puc_requirements(voip_registration_required)
  WHERE voip_registration_required = TRUE;

-- Updated_at trigger
CREATE OR REPLACE FUNCTION set_updated_at_state_puc_req() RETURNS trigger AS $$
BEGIN
  NEW.updated_at = NOW();
  RETURN NEW;
END;
$$ LANGUAGE plpgsql;

DROP TRIGGER IF EXISTS trg_state_puc_req_updated_at ON state_puc_requirements;
CREATE TRIGGER trg_state_puc_req_updated_at
  BEFORE UPDATE ON state_puc_requirements
  FOR EACH ROW EXECUTE FUNCTION set_updated_at_state_puc_req();

-- ──────────────────────────────────────────────────────────────────────
-- Seed all 51 jurisdictions
-- ──────────────────────────────────────────────────────────────────────

INSERT INTO state_puc_requirements (
    state_code, agency_name, agency_url,
    voip_registration_required, voip_registration_type, voip_registration_fee_cents,
    voip_annual_fee_cents, voip_bond_required, voip_bond_amount_cents, voip_bond_type,
    voip_reseller_exempt, voip_reseller_bond_cents, voip_reseller_notes,
    voip_ott_exempt,
    voip_notes,
    broadband_registration_required, broadband_notes,
    clec_certification_required, clec_certification_fee_cents, clec_bond_required, clec_bond_amount_cents,
    annual_report_required, usf_surcharge_required, usf_surcharge_description,
    notes
) VALUES
-- TIER 1: States that REQUIRE VoIP registration
-- Format: state_code, agency_name, agency_url,
--   voip_registration_required, voip_registration_type, voip_registration_fee_cents,
--   voip_annual_fee_cents, voip_bond_required, voip_bond_amount_cents, voip_bond_type,
--   voip_reseller_exempt, voip_reseller_bond_cents, voip_reseller_notes, voip_ott_exempt,
--   voip_notes,
--   broadband_registration_required, broadband_notes,
--   clec_certification_required, clec_certification_fee_cents, clec_bond_required, clec_bond_amount_cents,
--   annual_report_required, usf_surcharge_required, usf_surcharge_description, notes

('AL', 'Alabama Public Service Commission', 'https://psc.alabama.gov',
 TRUE, 'certificate_of_authority', 10000, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, TRUE,
 'Certificate of Authority required for telephone companies including VoIP',
 FALSE, NULL,
 TRUE, 10000, TRUE, 2500000,
 TRUE, TRUE, 'Annual regulatory assessment based on intrastate revenue',
 NULL),

('CA', 'California Public Utilities Commission', 'https://www.cpuc.ca.gov/industries-and-topics/telecommunications',
 TRUE, 'registration', 15000, 0, TRUE, 10000000, 'surety',
 FALSE, 2500000, 'Resellers may qualify for lower $25K bond vs $100K for facilities-based', TRUE,
 'CPUC Resolution T-17002 requires VoIP registration. Bond $25K-$100K depending on category.',
 FALSE, 'Facilities-based broadband providers may need CPCN',
 TRUE, 15000, TRUE, 10000000,
 TRUE, TRUE, 'User fee surcharge 0.1-0.5% of CA intrastate revenue + CHCF-A/B + CTF + DDTP + LifeLine',
 'One of the most complex states. Multiple surcharge funds with detailed reporting.'),

('CO', 'Colorado Public Utilities Commission', 'https://puc.colorado.gov/telecom',
 TRUE, 'registration', 10000, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, FALSE,
 'Must register as Telecommunications Provider. SB 14-180 deregulated many services but registration remains.',
 FALSE, NULL,
 TRUE, 10000, FALSE, 0,
 TRUE, TRUE, 'RRIF assessment + High Cost Support Mechanism + TRS fund',
 NULL),

('CT', 'Connecticut Public Utilities Regulatory Authority', 'https://portal.ct.gov/pura/telecommunications',
 TRUE, 'registration', 25000, 0, TRUE, 5000000, 'surety',
 FALSE, 0, 'Bond may be waived for VoIP-only resellers', TRUE,
 'Certified Telecommunications Provider (CTP). $50K bond may be waived for VoIP-only.',
 FALSE, NULL,
 TRUE, 25000, TRUE, 5000000,
 TRUE, TRUE, 'CTUSF contribution + annual assessment',
 NULL),

('DC', 'DC Public Service Commission', 'https://dcpsc.org',
 TRUE, 'certificate_of_authority', 50000, 0, TRUE, 5000000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Certificate of Authority required. $50K surety bond.',
 FALSE, NULL,
 TRUE, 50000, TRUE, 5000000,
 TRUE, TRUE, 'Assessment based on DC revenue',
 NULL),

('FL', 'Florida Public Service Commission', 'https://www.psc.state.fl.us/ElectronicFiling',
 TRUE, 'registration', 0, 0, FALSE, 0, NULL,
 FALSE, 0, 'Resellers and facilities-based have same lightweight registration', TRUE,
 'Register as ALEC or VoIP provider under FL Stat. 364.02. No application fee. HB 247 (2021) deregulated but registration remains.',
 FALSE, NULL,
 TRUE, 0, FALSE, 0,
 TRUE, TRUE, 'RAF ~0.09% of FL gross operating revenue + Relay Service + Lifeline',
 'Substantially deregulated under HB 247 (2021). Registration is lightweight.'),

('GA', 'Georgia Public Service Commission', 'https://psc.ga.gov/telecommunications/',
 TRUE, 'certificate_of_authority', 25000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, 'Bond may be reduced based on revenue for smaller resellers', TRUE,
 'Certificate of Authority required. $25K bond may be reduced based on revenue.',
 FALSE, NULL,
 TRUE, 25000, TRUE, 2500000,
 TRUE, TRUE, 'GA Universal Access Fund + GA Relay Service',
 NULL),

('IL', 'Illinois Commerce Commission', 'https://www.icc.illinois.gov/filings',
 TRUE, 'certificate_of_authority', 10000, 0, TRUE, 5000000, 'surety',
 FALSE, 2500000, 'Resellers typically $25K bond vs $50K for facilities-based', TRUE,
 'Certificate of Service Authority required. Bond $25K-$50K depending on service type.',
 FALSE, NULL,
 TRUE, 10000, TRUE, 5000000,
 TRUE, TRUE, 'IL TRS fund + Universal Service contribution',
 NULL),

('IN', 'Indiana Utility Regulatory Commission', 'https://www.in.gov/iurc/',
 TRUE, 'certificate_of_authority', 15000, 0, FALSE, 0, NULL,
 TRUE, 0, 'HEA 1279 (2006) exempts VoIP resellers from most IURC regulation', TRUE,
 'Certificate of Territorial Authority (CTA). HEA 1279 (2006) limited PUC authority but registration remains.',
 FALSE, NULL,
 TRUE, 15000, TRUE, 2500000,
 TRUE, TRUE, 'Indiana USF contribution',
 NULL),

('KS', 'Kansas Corporation Commission', 'https://kcc.ks.gov/telecommunications',
 TRUE, 'certificate_of_authority', 20000, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, TRUE,
 'Certificate of Convenience and Authority. K.S.A. 66-2005 partially deregulated VoIP but registration/USF remain.',
 FALSE, NULL,
 TRUE, 20000, FALSE, 0,
 TRUE, TRUE, 'KUSF contribution',
 NULL),

('KY', 'Kentucky Public Service Commission', 'https://psc.ky.gov',
 TRUE, 'cpcn', 0, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, FALSE,
 'CPCN required. No filing fee. SB 99 (2006) limited regulation but CPCN still required.',
 FALSE, NULL,
 TRUE, 0, FALSE, 0,
 TRUE, TRUE, 'KY USF assessment',
 NULL),

('LA', 'Louisiana Public Service Commission', 'https://lpsc.louisiana.gov',
 TRUE, 'certificate_of_authority', 50000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Certificate of Authority required. $25K surety bond.',
 FALSE, NULL,
 TRUE, 50000, TRUE, 2500000,
 TRUE, TRUE, 'LA USF contribution',
 NULL),

('ME', 'Maine Public Utilities Commission', 'https://www.maine.gov/mpuc/',
 TRUE, 'registration', 20000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, 'Bond may be reduced for VoIP resellers', FALSE,
 'Register as CLEC or VoIP provider. 35-A M.R.S. Chapter 7. $25K bond may be reduced.',
 FALSE, NULL,
 TRUE, 20000, TRUE, 2500000,
 TRUE, FALSE, NULL,
 NULL),

('MD', 'Maryland Public Service Commission', 'https://www.psc.state.md.us',
 TRUE, 'cpcn', 25000, 0, TRUE, 5000000, 'surety',
 FALSE, 0, NULL, FALSE,
 'CPCN or registration required. $50K standard surety bond. MD Code PU Section 8-101 et seq.',
 FALSE, NULL,
 TRUE, 25000, TRUE, 5000000,
 TRUE, TRUE, 'MD Relay fund + Universal Service contribution',
 NULL),

('MA', 'Massachusetts Department of Telecommunications and Cable', 'https://www.mass.gov/orgs/department-of-telecommunications-and-cable',
 TRUE, 'registration', 25000, 0, TRUE, 10000000, 'surety',
 FALSE, 2500000, 'Resellers may qualify for reduced $25K bond', FALSE,
 'Register as CLEC or obtain authorization. $100K surety bond — one of the highest.',
 TRUE, 'MA is one of the few states requiring ISP registration',
 TRUE, 25000, TRUE, 10000000,
 TRUE, TRUE, 'MA TRS + Universal Service contribution',
 'One of the few states requiring broadband/ISP registration.'),

('MI', 'Michigan Public Service Commission', 'https://www.michigan.gov/mpsc',
 TRUE, 'registration', 0, 0, FALSE, 0, NULL,
 TRUE, 0, 'PA 48 of 2014 substantially deregulated VoIP resellers', TRUE,
 'Must obtain authorization (less than full CPCN). PA 48 of 2014 substantially deregulated but registration persists.',
 FALSE, NULL,
 TRUE, 0, FALSE, 0,
 TRUE, TRUE, 'MI USF assessment',
 NULL),

('MN', 'Minnesota Public Utilities Commission', 'https://mn.gov/puc/',
 TRUE, 'registration', 10000, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, TRUE,
 'Simplified registration process post-2015. Minn. Stat. 237.01. Registration serves as CLEC authorization.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 TRUE, TRUE, 'TAM (Telephone Assistance Mechanism) fund contribution',
 NULL),

('MS', 'Mississippi Public Service Commission', 'https://www.psc.ms.gov',
 TRUE, 'cpcn', 50000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Certificate of Convenience and Necessity (CCN). $25K surety bond. MS Code 77-3-1 et seq.',
 FALSE, NULL,
 TRUE, 50000, TRUE, 2500000,
 TRUE, FALSE, NULL,
 NULL),

('MO', 'Missouri Public Service Commission', 'https://psc.mo.gov',
 TRUE, 'certificate_of_authority', 5000, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, TRUE,
 'Certificate of Service Authority (CSA). RSMo 392.611 — VoIP providers must register but exempt from rate regulation.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 TRUE, TRUE, 'MO USF contribution',
 NULL),

('NE', 'Nebraska Public Service Commission', 'https://psc.nebraska.gov',
 TRUE, 'registration', 20000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Must register as telecommunications carrier. $25K surety bond.',
 FALSE, NULL,
 TRUE, 20000, TRUE, 2500000,
 TRUE, TRUE, 'NUSF contribution + regulatory fee',
 NULL),

('NV', 'Public Utilities Commission of Nevada', 'https://puc.nv.gov',
 TRUE, 'cpcn', 100000, 0, TRUE, 10000000, 'surety',
 FALSE, 2500000, 'Resellers may qualify for lower bond ($25K vs $100K for facilities-based)', TRUE,
 'CPCN required. $1,000 app fee. Bond $25K-$100K varies by size. NRS 704 governs.',
 FALSE, NULL,
 TRUE, 100000, TRUE, 10000000,
 TRUE, TRUE, 'NV USF contribution + ~0.4% annual regulatory assessment',
 'High application fee ($1,000) and potentially high bond.'),

('NH', 'New Hampshire Public Utilities Commission', 'https://www.puc.nh.gov',
 TRUE, 'registration', 20000, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, TRUE,
 'Registration/authorization required. RSA 362 governs. VoIP lightly regulated but must register.',
 FALSE, NULL,
 TRUE, 20000, FALSE, 0,
 TRUE, FALSE, NULL,
 NULL),

('NJ', 'New Jersey Board of Public Utilities', 'https://www.nj.gov/bpu/',
 TRUE, 'registration', 10000, 0, TRUE, 5000000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Register as CLEC or VoIP provider. $50K surety bond. N.J.S.A. 48:2-1 et seq.',
 FALSE, NULL,
 TRUE, 10000, TRUE, 5000000,
 TRUE, TRUE, 'NJ USF + NJ TRS fund',
 NULL),

('NM', 'New Mexico Public Regulation Commission', 'https://www.nmprc.state.nm.us',
 TRUE, 'certificate_of_authority', 10000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Certificate of Authority required. $25K surety bond. NMSA 63-7-1 et seq.',
 FALSE, NULL,
 TRUE, 10000, TRUE, 2500000,
 TRUE, TRUE, 'NM USF contribution',
 NULL),

('NY', 'New York Public Service Commission', 'https://www.dps.ny.gov',
 TRUE, 'registration', 50000, 0, TRUE, 10000000, 'surety',
 FALSE, 5000000, 'Resellers may qualify for reduced $50K bond vs $100K', FALSE,
 'Must obtain authorization. Bond $50K-$100K. Section 18-a assessment on gross intrastate revenue is one of the most significant ongoing obligations.',
 FALSE, 'NY broadband mapping program requires data reporting but no PUC registration',
 TRUE, 50000, TRUE, 10000000,
 TRUE, TRUE, 'Section 18-a assessment (% of gross intrastate revenue) + NY USF + NY TRS',
 'Section 18-a assessment can be substantial. Often the most expensive ongoing state obligation.'),

('NC', 'North Carolina Utilities Commission', 'https://www.ncuc.gov',
 TRUE, 'certificate_of_authority', 50000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, TRUE,
 'Certificate of Authority required. $25K surety bond. G.S. 62-2 et seq.',
 FALSE, NULL,
 TRUE, 50000, TRUE, 2500000,
 TRUE, TRUE, 'NC USF contribution + E-911 fund',
 NULL),

('OH', 'Public Utilities Commission of Ohio', 'https://puco.ohio.gov',
 TRUE, 'registration', 25000, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, TRUE,
 'Register as Competitive Telecommunications Service Provider. ORC 4927 governs. Light regulation post-SB 162 (2010).',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 TRUE, TRUE, 'OH USF assessment',
 NULL),

('OK', 'Oklahoma Corporation Commission', 'https://oklahoma.gov/occ.html',
 TRUE, 'cpcn', 5000, 0, TRUE, 1000000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Certificate of Convenience and Necessity. $10K surety bond. 17 O.S. Section 131 et seq.',
 FALSE, NULL,
 TRUE, 5000, TRUE, 1000000,
 TRUE, TRUE, 'OK USF + annual gross receipts assessment',
 NULL),

('OR', 'Oregon Public Utility Commission', 'https://www.oregon.gov/puc',
 TRUE, 'registration', 10000, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, TRUE,
 'Register as Competitive Telecommunications Provider. ORS 759 governs. Light regulation.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 TRUE, TRUE, 'OR USF + OR TRS fund',
 NULL),

('PA', 'Pennsylvania Public Utility Commission', 'https://www.puc.pa.gov',
 TRUE, 'cpcn', 35000, 0, TRUE, 5000000, 'surety',
 FALSE, 0, 'Resellers use same Certificate of Public Convenience but may have expedited review', FALSE,
 'Certificate of Public Convenience required (Act 183 of 2004 streamlined process). $50K standard bond.',
 FALSE, NULL,
 TRUE, 35000, TRUE, 5000000,
 TRUE, TRUE, 'PA USF + PA TRS + ~0.3-0.5% annual assessment on intrastate revenue',
 NULL),

('RI', 'Rhode Island Public Utilities Commission', 'https://ripuc.ri.gov',
 TRUE, 'registration', 10000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Must register. $25K surety bond. R.I.G.L. 39-1 et seq.',
 FALSE, NULL,
 TRUE, 10000, TRUE, 2500000,
 TRUE, FALSE, NULL,
 NULL),

('SC', 'South Carolina Public Service Commission', 'https://www.psc.sc.gov',
 TRUE, 'cpcn', 30000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, FALSE,
 'CPCN required. $25K surety bond. S.C. Code 58-9 et seq.',
 FALSE, NULL,
 TRUE, 30000, TRUE, 2500000,
 TRUE, TRUE, 'SC USF contribution',
 NULL),

('TN', 'Tennessee Regulatory Authority', 'https://www.tn.gov/tra',
 TRUE, 'certificate_of_authority', 0, 0, FALSE, 0, NULL,
 TRUE, 0, 'VoIP resellers substantially deregulated under T.C.A. 65-4-101', TRUE,
 'Certificate of Authority or simplified registration. No filing fee. T.C.A. 65-4-101 et seq.',
 FALSE, NULL,
 TRUE, 0, FALSE, 0,
 TRUE, TRUE, 'TN USF',
 NULL),

('TX', 'Public Utility Commission of Texas', 'https://www.puc.texas.gov',
 TRUE, 'certificate_of_authority', 100000, 0, TRUE, 10000000, 'surety',
 FALSE, 2500000, 'SPCOA (reseller type) has lower $25K bond vs COA $100K for facilities-based', TRUE,
 'COA or SPCOA required. $1,000 app fee. Bond $25K-$100K. PURA 55.002-55.008 provides some VoIP exemptions.',
 FALSE, NULL,
 TRUE, 100000, TRUE, 10000000,
 TRUE, TRUE, 'TUSF 3.3%+ of intrastate revenue (quarterly) + TRS contribution',
 'TX distinguishes COA (facilities-based) from SPCOA (reseller). TUSF is one of the largest state USF programs.'),

('UT', 'Utah Public Service Commission', 'https://psc.utah.gov',
 TRUE, 'cpcn', 10000, 0, TRUE, 2500000, 'surety',
 FALSE, 1000000, 'Resellers may qualify for $10K bond vs $25K', FALSE,
 'CPCN required. Bond $10K-$25K. UCA 54-8b-1 et seq.',
 FALSE, NULL,
 TRUE, 10000, TRUE, 2500000,
 TRUE, TRUE, 'UT USF contribution (relatively small)',
 NULL),

('VT', 'Vermont Public Utility Commission', 'https://puc.vermont.gov',
 TRUE, 'cpcn', 10000, 0, TRUE, 1000000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Certificate of Public Good (CPG) required. $10K bond. 30 V.S.A. Chapter 1.',
 TRUE, 'VT is one of the few states requiring broadband provider PUC registration under CPG',
 TRUE, 10000, TRUE, 1000000,
 TRUE, FALSE, NULL,
 'One of the few states that regulates broadband providers under PUC authority.'),

('VA', 'Virginia State Corporation Commission', 'https://www.scc.virginia.gov',
 TRUE, 'certificate_of_authority', 25000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, TRUE,
 'Certificate of Authority required. $25K surety bond. VA Code 56-1 et seq.',
 FALSE, NULL,
 TRUE, 25000, TRUE, 2500000,
 TRUE, TRUE, 'VA Relay Center contribution + ~0.04-0.06% annual assessment',
 NULL),

('WA', 'Washington Utilities and Transportation Commission', 'https://www.utc.wa.gov',
 TRUE, 'registration', 25000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, TRUE,
 'Register as Competitive Telecommunications Company. $25K surety bond. RCW 80.36 governs.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 TRUE, TRUE, 'WA USF assessment + TRS',
 NULL),

('WV', 'West Virginia Public Service Commission', 'https://www.psc.state.wv.us',
 TRUE, 'cpcn', 50000, 0, TRUE, 2500000, 'surety',
 FALSE, 0, NULL, FALSE,
 'Certificate of Convenience and Necessity. $25K surety bond. WV Code 24-2-1 et seq.',
 FALSE, NULL,
 TRUE, 50000, TRUE, 2500000,
 TRUE, TRUE, 'WV USF + special revenue fund assessment',
 NULL),

('WI', 'Public Service Commission of Wisconsin', 'https://psc.wi.gov',
 TRUE, 'certificate_of_authority', 10000, 0, FALSE, 0, NULL,
 FALSE, 0, NULL, TRUE,
 'Certificate of Authority. Wis. Stat. 196.01 et seq. 2011 Act 22 substantially deregulated but registration remains.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 TRUE, TRUE, 'WI USF contribution + TRS',
 NULL),

-- TIER 2: States with LIMITED or NO VoIP registration requirement
('AK', 'Regulatory Commission of Alaska', 'https://rca.alaska.gov',
 FALSE, 'notification', 0, 0, FALSE, 0, NULL,
 TRUE, 0, NULL, TRUE,
 'VoIP largely deregulated. May need to register for AUSF contribution purposes only.',
 FALSE, NULL,
 TRUE, 0, FALSE, 0,
 FALSE, TRUE, 'AUSF contribution may apply',
 'Remote state with few VoIP-specific requirements. RCA may assert jurisdiction for AUSF.'),

('AZ', 'Arizona Corporation Commission', 'https://www.azcc.gov',
 FALSE, 'exempt', 0, 0, FALSE, 0, NULL,
 TRUE, 0, NULL, TRUE,
 'Arizona exempted VoIP from state regulation under ARS 9-582. Explicitly prohibits local government VoIP regulation.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 FALSE, FALSE, NULL,
 'Explicit legislative exemption for VoIP.'),

('AR', 'Arkansas Public Service Commission', 'https://www.arkansas.gov/psc/',
 FALSE, 'exempt', 0, 0, FALSE, 0, NULL,
 TRUE, 0, 'Act 781 of 2013 specifically exempts VoIP resellers', TRUE,
 'Act 781 of 2013 deregulated VoIP. No CPCN required for VoIP-only providers. May still need to contribute to AR USF.',
 FALSE, NULL,
 TRUE, 0, FALSE, 0,
 FALSE, TRUE, 'AR USF contribution may apply',
 'CLECs still need certification; pure VoIP providers exempt from PSC regulation.'),

('DE', 'Delaware Public Service Commission', 'https://depsc.delaware.gov',
 FALSE, 'exempt', 0, 0, FALSE, 0, NULL,
 TRUE, 0, NULL, TRUE,
 'Delaware does not require VoIP providers to register with the PSC. Very limited telecom regulation.',
 FALSE, NULL,
 TRUE, 0, FALSE, 0,
 FALSE, FALSE, NULL,
 'CLEC certification exists but VoIP-only providers generally exempt.'),

('HI', 'Hawaii Public Utilities Commission', 'https://puc.hawaii.gov',
 FALSE, 'notification', 0, 0, FALSE, 0, NULL,
 TRUE, 0, NULL, TRUE,
 'HRS 269 governs but VoIP substantially deregulated. Registration may be required for E-911 purposes.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 FALSE, FALSE, NULL,
 'Relatively light regulatory touch for VoIP.'),

('ID', 'Idaho Public Utilities Commission', 'https://www.puc.idaho.gov',
 FALSE, 'exempt', 0, 0, FALSE, 0, NULL,
 TRUE, 0, NULL, TRUE,
 'Idaho exempted VoIP from PUC regulation under Idaho Code 62-622. Explicit legislative exemption.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 FALSE, FALSE, NULL,
 'Explicit legislative exemption for VoIP/IP-enabled services.'),

('IA', 'Iowa Utilities Board', 'https://iub.iowa.gov',
 FALSE, 'exempt', 0, 0, FALSE, 0, NULL,
 TRUE, 0, 'SF 2325 (2014) exempts VoIP resellers; only facilities-based CLECs need certificate', TRUE,
 'SF 2325 (2014) deregulated VoIP. Certificate required only for facilities-based CLECs.',
 FALSE, NULL,
 TRUE, 0, FALSE, 0,
 FALSE, TRUE, 'Iowa Communications Network fund contribution may apply',
 'VoIP providers exempt from most IUB regulation.'),

('MT', 'Montana Public Service Commission', 'https://psc.mt.gov',
 FALSE, 'exempt', 0, 0, FALSE, 0, NULL,
 TRUE, 0, NULL, TRUE,
 'Montana exempted VoIP from PSC jurisdiction. MCA 69-3-802 exempts IP-enabled services.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 FALSE, FALSE, NULL,
 'Explicit legislative exemption.'),

('ND', 'North Dakota Public Service Commission', 'https://www.psc.nd.gov',
 FALSE, 'notification', 0, 0, FALSE, 0, NULL,
 TRUE, 0, NULL, TRUE,
 'NDCC 49-21 governs. VoIP providers may need to register for USF contribution purposes.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 FALSE, TRUE, 'ND USF contribution may apply',
 'Relatively light regulation; registration may be for assessment/USF purposes only.'),

('SD', 'South Dakota Public Utilities Commission', 'https://puc.sd.gov',
 FALSE, 'notification', 0, 0, FALSE, 0, NULL,
 TRUE, 0, NULL, TRUE,
 'SDCL 49-31 governs. VoIP registration exists but is simplified.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 FALSE, FALSE, NULL,
 'Relatively light telecom regulation for VoIP.'),

('WY', 'Wyoming Public Service Commission', 'https://psc.wyo.gov',
 FALSE, 'exempt', 0, 0, FALSE, 0, NULL,
 TRUE, 0, NULL, TRUE,
 'Wyoming exempted VoIP from PSC regulation under W.S. 37-15-501. Explicit legislative exemption.',
 FALSE, NULL,
 FALSE, 0, FALSE, 0,
 FALSE, FALSE, NULL,
 'Explicit legislative exemption.')
ON CONFLICT (state_code) DO NOTHING;

COMMIT;
