diff --git a/api/migrations/079_state_trucking_requirements.sql b/api/migrations/079_state_trucking_requirements.sql new file mode 100644 index 0000000..9aaaee3 --- /dev/null +++ b/api/migrations/079_state_trucking_requirements.sql @@ -0,0 +1,851 @@ +-- 079_state_trucking_requirements.sql +-- +-- State-level trucking compliance requirements for all 50 US states + DC. +-- Covers IRP, IFTA, weight-distance taxes, state motor carrier permits, +-- emissions compliance, intrastate authority, state DOT registration, +-- and state insurance filing requirements. +-- +-- Data sources: FMCSA, IRP Inc, IFTA Inc, state DOT/DMV/PUC websites, +-- J.J. Keller, Simplex Group, industry compliance databases. +-- Verified May 2026 — re-verify before filing. + +BEGIN; + +CREATE TABLE IF NOT EXISTS state_trucking_requirements ( + id SERIAL PRIMARY KEY, + state_code CHAR(2) NOT NULL UNIQUE REFERENCES jurisdictions(code), + + -- ── IRP (International Registration Plan) ────────────────────────── + irp_member BOOLEAN NOT NULL DEFAULT FALSE, + irp_agency TEXT, + irp_url TEXT, + + -- ── IFTA (International Fuel Tax Agreement) ──────────────────────── + ifta_member BOOLEAN NOT NULL DEFAULT FALSE, + ifta_agency TEXT, + ifta_url TEXT, + + -- ── Weight/Distance Tax ──────────────────────────────────────────── + weight_distance_tax BOOLEAN NOT NULL DEFAULT FALSE, + weight_distance_tax_name TEXT, -- 'Weight-Mile Tax', 'Highway Use Tax', etc. + weight_distance_agency TEXT, + weight_distance_url TEXT, + weight_distance_threshold_lbs INTEGER, -- min GVW that triggers tax + weight_distance_notes TEXT, + + -- ── State Motor Carrier Permit ───────────────────────────────────── + state_carrier_permit BOOLEAN NOT NULL DEFAULT FALSE, + state_carrier_permit_name TEXT, -- 'Motor Carrier Permit (MCP)', 'TxDMV Number', etc. + state_carrier_permit_agency TEXT, + state_carrier_permit_url TEXT, + state_carrier_permit_notes TEXT, + + -- ── Emissions Compliance ─────────────────────────────────────────── + emissions_program BOOLEAN NOT NULL DEFAULT FALSE, + emissions_program_name TEXT, -- 'CARB Truck & Bus Rule', 'Advanced Clean Trucks', etc. + emissions_agency TEXT, + emissions_url TEXT, + emissions_notes TEXT, + + -- ── Intrastate Operating Authority ───────────────────────────────── + intrastate_authority_required BOOLEAN NOT NULL DEFAULT FALSE, + intrastate_authority_name TEXT, -- 'Certificate of Authority', 'CPCN', etc. + intrastate_authority_agency TEXT, + intrastate_authority_url TEXT, + intrastate_authority_notes TEXT, + + -- ── State DOT Registration ───────────────────────────────────────── + -- States that require their own DOT-like number beyond federal USDOT + state_dot_required BOOLEAN NOT NULL DEFAULT FALSE, + state_dot_number_name TEXT, -- 'CA Number', 'TxDMV Number', etc. + state_dot_agency TEXT, + state_dot_url TEXT, + state_dot_notes TEXT, + + -- ── State Insurance Filing ───────────────────────────────────────── + -- States with insurance filing requirements beyond federal FMCSA BIPD + state_insurance_filing BOOLEAN NOT NULL DEFAULT FALSE, + state_insurance_min_cents INTEGER, -- state minimum liability in cents (0 = federal default) + state_insurance_agency TEXT, + state_insurance_url TEXT, + state_insurance_notes TEXT, + + -- ── Unified Carrier Registration (UCR) ───────────────────────────── + -- All interstate carriers must register; some states are the base state + ucr_base_state BOOLEAN NOT NULL DEFAULT TRUE, -- can this state serve as UCR base? + + -- ── 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_trucking_irp + ON state_trucking_requirements(irp_member) WHERE irp_member = TRUE; +CREATE INDEX IF NOT EXISTS idx_state_trucking_weight_dist + ON state_trucking_requirements(weight_distance_tax) WHERE weight_distance_tax = TRUE; +CREATE INDEX IF NOT EXISTS idx_state_trucking_emissions + ON state_trucking_requirements(emissions_program) WHERE emissions_program = TRUE; +CREATE INDEX IF NOT EXISTS idx_state_trucking_intrastate + ON state_trucking_requirements(intrastate_authority_required) WHERE intrastate_authority_required = TRUE; + +-- Updated_at trigger +CREATE OR REPLACE FUNCTION set_updated_at_state_trucking_req() RETURNS trigger AS $$ +BEGIN + NEW.updated_at = NOW(); + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS trg_state_trucking_req_updated_at ON state_trucking_requirements; +CREATE TRIGGER trg_state_trucking_req_updated_at + BEFORE UPDATE ON state_trucking_requirements + FOR EACH ROW EXECUTE FUNCTION set_updated_at_state_trucking_req(); + +-- ────────────────────────────────────────────────────────────────────── +-- Seed all 51 jurisdictions (50 states + DC) +-- ────────────────────────────────────────────────────────────────────── +-- +-- Column order in INSERT: +-- state_code, +-- irp_member, irp_agency, irp_url, +-- ifta_member, ifta_agency, ifta_url, +-- weight_distance_tax, weight_distance_tax_name, weight_distance_agency, weight_distance_url, weight_distance_threshold_lbs, weight_distance_notes, +-- state_carrier_permit, state_carrier_permit_name, state_carrier_permit_agency, state_carrier_permit_url, state_carrier_permit_notes, +-- emissions_program, emissions_program_name, emissions_agency, emissions_url, emissions_notes, +-- intrastate_authority_required, intrastate_authority_name, intrastate_authority_agency, intrastate_authority_url, intrastate_authority_notes, +-- state_dot_required, state_dot_number_name, state_dot_agency, state_dot_url, state_dot_notes, +-- state_insurance_filing, state_insurance_min_cents, state_insurance_agency, state_insurance_url, state_insurance_notes, +-- ucr_base_state, notes + +INSERT INTO state_trucking_requirements ( + state_code, + irp_member, irp_agency, irp_url, + ifta_member, ifta_agency, ifta_url, + weight_distance_tax, weight_distance_tax_name, weight_distance_agency, weight_distance_url, weight_distance_threshold_lbs, weight_distance_notes, + state_carrier_permit, state_carrier_permit_name, state_carrier_permit_agency, state_carrier_permit_url, state_carrier_permit_notes, + emissions_program, emissions_program_name, emissions_agency, emissions_url, emissions_notes, + intrastate_authority_required, intrastate_authority_name, intrastate_authority_agency, intrastate_authority_url, intrastate_authority_notes, + state_dot_required, state_dot_number_name, state_dot_agency, state_dot_url, state_dot_notes, + state_insurance_filing, state_insurance_min_cents, state_insurance_agency, state_insurance_url, state_insurance_notes, + ucr_base_state, notes +) VALUES + +-- ═══════════════════════════════════════════════════════════════════════ +-- ALABAMA +-- ═══════════════════════════════════════════════════════════════════════ +('AL', + TRUE, 'Alabama Department of Revenue', 'https://www.revenue.alabama.gov/motor-vehicle/irp-ifta-information/', + TRUE, 'Alabama Department of Revenue', 'https://www.revenue.alabama.gov/motor-vehicle/irp-ifta-information/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Alabama Public Service Commission', 'https://psc.alabama.gov', 'For-hire intrastate carriers must obtain COA from PSC', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- ALASKA +-- ═══════════════════════════════════════════════════════════════════════ +('AK', + FALSE, NULL, NULL, + TRUE, 'Alaska Department of Administration', 'https://doa.alaska.gov/dmv/commercial/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Not an IRP member. IFTA voluntary participant. Trip permits required for visiting carriers.'), + +-- ═══════════════════════════════════════════════════════════════════════ +-- ARIZONA +-- ═══════════════════════════════════════════════════════════════════════ +('AZ', + TRUE, 'Arizona Department of Transportation', 'https://azdot.gov/motor-vehicles/commercial-vehicles', + TRUE, 'Arizona Department of Transportation', 'https://azdot.gov/motor-vehicles/commercial-vehicles', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- ARKANSAS +-- ═══════════════════════════════════════════════════════════════════════ +('AR', + TRUE, 'Arkansas Department of Finance and Administration', 'https://www.dfa.arkansas.gov/motor-vehicle/motor-carrier-services/', + TRUE, 'Arkansas Department of Finance and Administration', 'https://www.dfa.arkansas.gov/motor-vehicle/motor-carrier-services/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Arkansas Highway Commission', 'https://www.ardot.gov/', 'For-hire intrastate carriers', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- CALIFORNIA +-- ═══════════════════════════════════════════════════════════════════════ +('CA', + TRUE, 'California DMV', 'https://www.dmv.ca.gov/portal/vehicle-registration/new-registration/commercial-vehicle-registration/international-registration-program/', + TRUE, 'California Board of Equalization', 'https://www.boe.ca.gov/sptaxprog/ifta.htm', + FALSE, NULL, NULL, NULL, NULL, NULL, + TRUE, 'Motor Carrier Permit (MCP)', 'California DMV', 'https://www.dmv.ca.gov/portal/vehicle-industry-services/motor-carrier-services-mcs/motor-carrier-permits/', 'Required for all for-hire carriers and CMVs over 10,001 lbs GVWR. Annual renewal.', + TRUE, 'CARB Truck & Bus Rule / Advanced Clean Trucks', 'California Air Resources Board (CARB)', 'https://ww2.arb.ca.gov/our-work/programs/truck-and-bus-regulation', 'All diesel vehicles >14,000 lbs must have 2010+ engine. ACT requires zero-emission sales targets for manufacturers.', + TRUE, 'Motor Carrier Permit (MCP)', 'California DMV / Caltrans', 'https://www.dmv.ca.gov/portal/vehicle-industry-services/motor-carrier-services-mcs/', 'MCP serves as both state carrier permit and intrastate authority', + TRUE, 'CA Number', 'California Highway Patrol (CHP)', 'https://dot.ca.gov/programs/traffic-operations/legal-truck-access/ca-number', 'CA Number issued by CHP; required before MCP. Must also have USDOT number.', + TRUE, 100000000, 'California DMV', 'https://www.dmv.ca.gov/portal/vehicle-industry-services/motor-carrier-services-mcs/', 'Liability $300K-$5M depending on vehicle type and cargo. Most carriers need $750K+. Form E/H filing with CHP.', + TRUE, 'Most regulated state for trucking. MCP + CA Number + CARB compliance all required.'), + +-- ═══════════════════════════════════════════════════════════════════════ +-- COLORADO +-- ═══════════════════════════════════════════════════════════════════════ +('CO', + TRUE, 'Colorado Department of Revenue', 'https://www.colorado.gov/pacific/dmv/motor-carrier-services', + TRUE, 'Colorado Department of Revenue', 'https://www.colorado.gov/pacific/dmv/motor-carrier-services', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'Colorado Department of Public Health and Environment', 'https://cdphe.colorado.gov/advanced-clean-trucks', 'ACT rule adopted; effective 2027 model year. May be delayed due to federal CRA action.', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- CONNECTICUT +-- ═══════════════════════════════════════════════════════════════════════ +('CT', + TRUE, 'Connecticut DMV', 'https://portal.ct.gov/dmv/commercial/irp', + TRUE, 'Connecticut Department of Revenue Services', 'https://portal.ct.gov/drs', + TRUE, 'Highway Use Fee (HUF)', 'Connecticut Department of Revenue Services', 'https://portal.ct.gov/drs/businesses/highway-use-fee/huf', 26000, 'Effective Jan 2023. 2.5-17.5 cents/mile based on weight class. Quarterly filing via myconneCT.', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Highway Use Fee is newest weight-distance tax in US (2023).'), + +-- ═══════════════════════════════════════════════════════════════════════ +-- DELAWARE +-- ═══════════════════════════════════════════════════════════════════════ +('DE', + TRUE, 'Delaware Division of Motor Vehicles', 'https://www.dmv.de.gov/Vehicle-Services/Commercial-Motor-Vehicle', + TRUE, 'Delaware Division of Motor Vehicles', 'https://www.dmv.de.gov/Vehicle-Services/Commercial-Motor-Vehicle', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- DISTRICT OF COLUMBIA +-- ═══════════════════════════════════════════════════════════════════════ +('DC', + TRUE, 'DC Department of Motor Vehicles', 'https://dmv.dc.gov/', + TRUE, 'DC Office of Tax and Revenue', 'https://otr.cfo.dc.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- FLORIDA +-- ═══════════════════════════════════════════════════════════════════════ +('FL', + TRUE, 'Florida Department of Highway Safety and Motor Vehicles', 'https://www.flhsmv.gov/motor-vehicles-tags-titles/commercial-motor-vehicles/', + TRUE, 'Florida Department of Revenue', 'https://floridarevenue.com/taxes/taxesfees/Pages/motor_fuel.aspx', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'No separate state intrastate authority; federal authority sufficient for for-hire interstate. Intrastate for-hire may need FDOT registration.', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + TRUE, 75000000, 'Florida DHSMV', 'https://www.flhsmv.gov/', '$750K interstate; $300K intrastate <10,001 lbs. PIP coverage required.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- GEORGIA +-- ═══════════════════════════════════════════════════════════════════════ +('GA', + TRUE, 'Georgia Department of Revenue', 'https://dor.georgia.gov/motor-vehicle-division', + TRUE, 'Georgia Department of Revenue', 'https://dor.georgia.gov/motor-vehicle-division', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Georgia Intrastate Motor Carrier (GIMC)', 'Georgia Public Service Commission', 'https://psc.ga.gov/', 'For-hire intrastate carriers must register with GA PSC', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- HAWAII +-- ═══════════════════════════════════════════════════════════════════════ +('HI', + FALSE, NULL, NULL, + FALSE, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Not an IRP or IFTA member. Island state with limited interstate trucking applicability.'), + +-- ═══════════════════════════════════════════════════════════════════════ +-- IDAHO +-- ═══════════════════════════════════════════════════════════════════════ +('ID', + TRUE, 'Idaho Transportation Department', 'https://itd.idaho.gov/motor-carrier/', + TRUE, 'Idaho Transportation Department', 'https://itd.idaho.gov/motor-carrier/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- ILLINOIS +-- ═══════════════════════════════════════════════════════════════════════ +('IL', + TRUE, 'Illinois Secretary of State', 'https://www.ilsos.gov/departments/vehicles/cft/irpintro.html', + TRUE, 'Illinois Secretary of State', 'https://www.ilsos.gov/departments/vehicles/cft/iftaintro.html', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Illinois Commerce Commission', 'https://www.icc.illinois.gov/industry/transportation', 'For-hire intrastate carriers of property and passengers must obtain ICC authority', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + TRUE, 75000000, 'Illinois Commerce Commission', 'https://www.icc.illinois.gov/', '$750K minimum liability for intrastate for-hire carriers. Form E filing.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- INDIANA +-- ═══════════════════════════════════════════════════════════════════════ +('IN', + TRUE, 'Indiana Department of Revenue', 'https://www.in.gov/dor/motor-carrier-services/', + TRUE, 'Indiana Department of Revenue', 'https://www.in.gov/dor/motor-carrier-services/fuel-tax/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Indiana Department of Revenue', 'https://www.in.gov/dor/motor-carrier-services/', 'Intrastate for-hire carriers must register. Intrastate fuel decals required.', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, 'Intrastate fuel permit/decals required for CMVs >26,000 lbs', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- IOWA +-- ═══════════════════════════════════════════════════════════════════════ +('IA', + TRUE, 'Iowa Department of Transportation', 'https://iowadot.gov/motor-carriers/irp-international-registration-plan', + TRUE, 'Iowa Department of Transportation', 'https://iowadot.gov/motor-carriers/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Iowa Department of Transportation', 'https://iowadot.gov/motor-carriers/', 'For-hire intrastate carriers must obtain authority from Iowa DOT', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- KANSAS +-- ═══════════════════════════════════════════════════════════════════════ +('KS', + TRUE, 'Kansas Department of Revenue', 'https://www.ksrevenue.gov/motorcarrier.html', + TRUE, 'Kansas Department of Revenue', 'https://www.ksrevenue.gov/motorcarrier.html', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Kansas Corporation Commission', 'https://kcc.ks.gov/transportation', 'For-hire intrastate carriers must obtain KCC authority', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- KENTUCKY +-- ═══════════════════════════════════════════════════════════════════════ +('KY', + TRUE, 'Kentucky Transportation Cabinet', 'https://drive.ky.gov/Motor-Carriers/Pages/default.aspx', + TRUE, 'Kentucky Transportation Cabinet', 'https://drive.ky.gov/Motor-Carriers/Pages/default.aspx', + TRUE, 'Weight Distance Tax (KYU)', 'Kentucky Transportation Cabinet', 'https://drive.ky.gov/Motor-Carriers/Pages/KYU.aspx', 60000, '$0.0285/mile for vehicles >59,999 lbs combined license weight. Quarterly filing required. KYU number issued online.', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Kentucky Transportation Cabinet', 'https://drive.ky.gov/Motor-Carriers/', 'For-hire intrastate carriers must register. Form E insurance filing required.', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + TRUE, 75000000, 'Kentucky Transportation Cabinet', 'https://drive.ky.gov/Motor-Carriers/', 'Form E filing required for intrastate for-hire carriers. Intrastate fuel decals required.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- LOUISIANA +-- ═══════════════════════════════════════════════════════════════════════ +('LA', + TRUE, 'Louisiana Department of Public Safety', 'https://www.expresslane.org/Motor-Carrier-Services/', + TRUE, 'Louisiana Department of Revenue', 'https://revenue.louisiana.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'Louisiana does not require separate intrastate authority for property carriers', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- MAINE +-- ═══════════════════════════════════════════════════════════════════════ +('ME', + TRUE, 'Maine Bureau of Motor Vehicles', 'https://www.maine.gov/sos/bmv/', + TRUE, 'Maine Revenue Services', 'https://www.maine.gov/revenue/taxes/fuel-tax/narratives-ifta-irp', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + TRUE, 35000000, 'Maine Bureau of Insurance', 'https://www.maine.gov/pfr/insurance/', '$350K CSL for intrastate property carriers. Form K filing required. 30-day cancellation notice.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- MARYLAND +-- ═══════════════════════════════════════════════════════════════════════ +('MD', + TRUE, 'Maryland Motor Vehicle Administration', 'https://mva.maryland.gov/', + TRUE, 'Maryland Comptroller', 'https://www.marylandtaxes.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'Maryland Department of the Environment', 'https://mde.maryland.gov/', 'ACT rule adopted; effective 2027 model year. May be delayed.', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- MASSACHUSETTS +-- ═══════════════════════════════════════════════════════════════════════ +('MA', + TRUE, 'Massachusetts Registry of Motor Vehicles', 'https://www.mass.gov/orgs/massachusetts-registry-of-motor-vehicles', + TRUE, 'Massachusetts Department of Revenue', 'https://www.mass.gov/orgs/massachusetts-department-of-revenue', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'Massachusetts Department of Environmental Protection', 'https://www.mass.gov/orgs/massdep', 'ACT rule effective 2025 model year. Enforcement may be paused.', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- MICHIGAN +-- ═══════════════════════════════════════════════════════════════════════ +('MI', + TRUE, 'Michigan Secretary of State', 'https://www.michigan.gov/sos/industry-services/irp', + TRUE, 'Michigan Department of Treasury', 'https://www.michigan.gov/treasury', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Michigan Public Service Commission', 'https://www.michigan.gov/mpsc', 'For-hire intrastate carriers of property must register with MPSC', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- MINNESOTA +-- ═══════════════════════════════════════════════════════════════════════ +('MN', + TRUE, 'Minnesota Department of Public Safety', 'https://dps.mn.gov/divisions/dvs/Pages/dvs-content-detail.aspx?pageID=683', + TRUE, 'Minnesota Department of Revenue', 'https://www.revenue.state.mn.us/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Minnesota Department of Transportation', 'https://www.dot.state.mn.us/cvo/', 'For-hire intrastate carriers must register with MnDOT', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- MISSISSIPPI +-- ═══════════════════════════════════════════════════════════════════════ +('MS', + TRUE, 'Mississippi Department of Revenue', 'https://www.dor.ms.gov/', + TRUE, 'Mississippi Department of Revenue', 'https://www.dor.ms.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Mississippi Public Service Commission', 'https://www.psc.ms.gov/', 'For-hire intrastate carriers must obtain PSC authority', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- MISSOURI +-- ═══════════════════════════════════════════════════════════════════════ +('MO', + TRUE, 'Missouri Department of Revenue', 'https://dor.mo.gov/motor-vehicle/motor-carrier/', + TRUE, 'Missouri Department of Revenue', 'https://dor.mo.gov/motor-vehicle/motor-carrier/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Missouri Department of Transportation', 'https://www.modot.org/motor-carrier-services', 'For-hire intrastate carriers must register with MoDOT', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- MONTANA +-- ═══════════════════════════════════════════════════════════════════════ +('MT', + TRUE, 'Montana Department of Justice', 'https://dojmt.gov/driving/motor-carrier-services/', + TRUE, 'Montana Department of Transportation', 'https://www.mdt.mt.gov/business/motor_carrier/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- NEBRASKA +-- ═══════════════════════════════════════════════════════════════════════ +('NE', + TRUE, 'Nebraska Department of Motor Vehicles', 'https://dmv.nebraska.gov/mc', + TRUE, 'Nebraska Department of Motor Vehicles', 'https://dmv.nebraska.gov/mc', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Nebraska Public Service Commission', 'https://psc.nebraska.gov/', 'For-hire intrastate carriers must register with NE PSC', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- NEVADA +-- ═══════════════════════════════════════════════════════════════════════ +('NV', + TRUE, 'Nevada DMV', 'https://dmv.nv.gov/mcnew.htm', + TRUE, 'Nevada Department of Motor Vehicles', 'https://dmv.nv.gov/mcnew.htm', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'Nevada requires USDOT for intrastate CMVs >26,001 lbs', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs >26,001 lbs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- NEW HAMPSHIRE +-- ═══════════════════════════════════════════════════════════════════════ +('NH', + TRUE, 'New Hampshire Department of Safety', 'https://www.nh.gov/safety/divisions/dmv/', + TRUE, 'New Hampshire Department of Safety', 'https://www.nh.gov/safety/divisions/dmv/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- NEW JERSEY +-- ═══════════════════════════════════════════════════════════════════════ +('NJ', + TRUE, 'New Jersey Motor Vehicle Commission', 'https://www.nj.gov/mvc/', + TRUE, 'New Jersey Division of Taxation', 'https://www.nj.gov/treasury/taxation/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'New Jersey Department of Environmental Protection', 'https://www.nj.gov/dep/', 'ACT rule effective 2025 model year.', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + TRUE, 75000000, 'New Jersey Motor Vehicle Commission', 'https://www.nj.gov/mvc/', '$750K minimum for intrastate for-hire property carriers.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- NEW MEXICO +-- ═══════════════════════════════════════════════════════════════════════ +('NM', + TRUE, 'New Mexico Motor Vehicle Division', 'https://www.mvd.newmexico.gov/commercial/commercial-vehicles/', + TRUE, 'New Mexico Taxation and Revenue Department', 'https://www.tax.newmexico.gov/', + TRUE, 'Weight Distance Tax (WDT)', 'New Mexico Taxation and Revenue Department', 'https://tap.state.nm.us/tap/_/', 26001, 'All CMVs >26,001 lbs declared gross weight. Annual e-permit per vehicle via TAP portal. Quarterly reporting.', + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'New Mexico Environment Department', 'https://www.env.nm.gov/', 'ACT rule adopted; effective 2027 model year.', + TRUE, 'Certificate of Authority', 'New Mexico Public Regulation Commission', 'https://www.nmprc.state.nm.us/', 'For-hire intrastate carriers must obtain NMPRC authority', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- NEW YORK +-- ═══════════════════════════════════════════════════════════════════════ +('NY', + TRUE, 'New York DMV', 'https://dmv.ny.gov/commercial-vehicles/irp-registration', + TRUE, 'New York Department of Taxation and Finance', 'https://www.tax.ny.gov/', + TRUE, 'Highway Use Tax (HUT)', 'New York Department of Taxation and Finance', 'https://www.tax.ny.gov/bus/hut/huidx.htm', 18000, 'All motor vehicles >18,000 lbs GVW on NY highways. Certificate of Registration + decals required. File via OSCAR or Web File.', + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'New York State DEC', 'https://www.dec.ny.gov/', 'ACT rule effective 2025 model year.', + TRUE, 'Operating Authority', 'New York State DOT', 'https://www.dot.ny.gov/', 'For-hire intrastate carriers must obtain NYSDOT operating authority', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + TRUE, 75000000, 'New York State DOT', 'https://www.dot.ny.gov/', '$750K CSL for for-hire property carriers. NYC operations may require $1.5M. Form E filing with NYSDOT.', + TRUE, 'HUT + intrastate authority + higher insurance = complex compliance state.'), + +-- ═══════════════════════════════════════════════════════════════════════ +-- NORTH CAROLINA +-- ═══════════════════════════════════════════════════════════════════════ +('NC', + TRUE, 'North Carolina DMV', 'https://www.ncdot.gov/dmv/title-registration/vehicle/Pages/irp.aspx', + TRUE, 'North Carolina Department of Revenue', 'https://www.ncdor.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'NC does not require separate intrastate authority for property carriers', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs. Intrastate fuel decals required.', + TRUE, 75000000, 'North Carolina Utilities Commission', 'https://www.ncuc.gov/', '$750K for intrastate for-hire carriers. Form E filing.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- NORTH DAKOTA +-- ═══════════════════════════════════════════════════════════════════════ +('ND', + TRUE, 'North Dakota DOT', 'https://www.dot.nd.gov/motor-vehicle/international-registration-plans-ifta-irp-and-ucr', + TRUE, 'North Dakota DOT', 'https://www.dot.nd.gov/motor-vehicle/international-registration-plans-ifta-irp-and-ucr', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- OHIO +-- ═══════════════════════════════════════════════════════════════════════ +('OH', + TRUE, 'Ohio Bureau of Motor Vehicles', 'https://www.bmv.ohio.gov/', + TRUE, 'Ohio Department of Taxation', 'https://tax.ohio.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'CPCN', 'Public Utilities Commission of Ohio', 'https://puco.ohio.gov/', 'For-hire intrastate carriers must obtain CPCN from PUCO. Household goods carriers have additional requirements.', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + TRUE, 75000000, 'Public Utilities Commission of Ohio', 'https://puco.ohio.gov/', '$750K minimum for intrastate for-hire property carriers. Form E filing with PUCO.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- OKLAHOMA +-- ═══════════════════════════════════════════════════════════════════════ +('OK', + TRUE, 'Oklahoma Corporation Commission', 'https://oklahoma.gov/occ/divisions/transportation.html', + TRUE, 'Oklahoma Tax Commission', 'https://oklahoma.gov/tax.html', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Intrastate License', 'Oklahoma Corporation Commission', 'https://oklahoma.gov/occ/divisions/transportation/trucking.html', 'For-hire and private intrastate carriers must obtain OCC license', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- OREGON +-- ═══════════════════════════════════════════════════════════════════════ +('OR', + TRUE, 'Oregon DMV / ODOT', 'https://www.oregon.gov/odot/mct/Pages/index.aspx', + TRUE, 'Oregon Department of Transportation', 'https://www.oregon.gov/odot/mct/Pages/index.aspx', + TRUE, 'Weight-Mile Tax', 'Oregon Department of Transportation', 'https://www.oregon.gov/odot/mct/pages/weight-mile-tax-program-enrollment.aspx', 26001, 'All carriers with vehicles >26,000 lbs combined weight. Tax rate varies by weight bracket. No fuel tax for trucks; weight-mile tax replaces it. File via Oregon Trucking Online.', + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'Oregon Department of Environmental Quality', 'https://www.oregon.gov/deq/', 'ACT rule effective 2025 model year. Enforcement paused/delayed.', + TRUE, 'Certificate of Authority', 'Oregon Department of Transportation', 'https://www.oregon.gov/odot/mct/', 'For-hire intrastate carriers must register with ODOT', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Weight-Mile Tax is unique — Oregon has NO diesel fuel tax for trucks. WMT replaces IFTA fuel tax for OR miles.'), + +-- ═══════════════════════════════════════════════════════════════════════ +-- PENNSYLVANIA +-- ═══════════════════════════════════════════════════════════════════════ +('PA', + TRUE, 'Pennsylvania Department of Transportation', 'https://www.penndot.pa.gov/', + TRUE, 'Pennsylvania Department of Revenue', 'https://www.revenue.pa.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Public Convenience', 'Pennsylvania Public Utility Commission', 'https://www.puc.pa.gov/', 'For-hire intrastate carriers must obtain PUC authority. Household goods carriers have additional requirements.', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs. Intrastate fuel decals required.', + TRUE, 75000000, 'Pennsylvania Public Utility Commission', 'https://www.puc.pa.gov/', '$750K for intrastate for-hire property carriers. Form E filing. Intrastate fuel permits required.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- RHODE ISLAND +-- ═══════════════════════════════════════════════════════════════════════ +('RI', + TRUE, 'Rhode Island Division of Motor Vehicles', 'https://dmv.ri.gov/', + TRUE, 'Rhode Island Division of Taxation', 'https://tax.ri.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'Rhode Island DEM', 'https://dem.ri.gov/', 'ACT rule adopted; effective 2027 model year.', + TRUE, 'Certificate of Authority', 'Rhode Island Public Utilities Commission', 'https://ripuc.ri.gov/', 'For-hire intrastate carriers must register with RI PUC', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- SOUTH CAROLINA +-- ═══════════════════════════════════════════════════════════════════════ +('SC', + TRUE, 'South Carolina Department of Motor Vehicles', 'https://www.scdmvonline.com/', + TRUE, 'South Carolina Department of Revenue', 'https://dor.sc.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'South Carolina Public Service Commission', 'https://www.psc.sc.gov/', 'For-hire intrastate carriers must obtain PSC authority', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- SOUTH DAKOTA +-- ═══════════════════════════════════════════════════════════════════════ +('SD', + TRUE, 'South Dakota Department of Revenue', 'https://dor.sd.gov/businesses/motor-vehicle/motor-carrier-services/', + TRUE, 'South Dakota Department of Revenue', 'https://dor.sd.gov/businesses/motor-vehicle/motor-carrier-services/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- TENNESSEE +-- ═══════════════════════════════════════════════════════════════════════ +('TN', + TRUE, 'Tennessee Department of Revenue', 'https://www.tn.gov/revenue.html', + TRUE, 'Tennessee Department of Revenue', 'https://www.tn.gov/revenue.html', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Tennessee Regulatory Authority', 'https://www.tn.gov/tra.html', 'For-hire intrastate carriers must register with TRA', + FALSE, NULL, NULL, NULL, NULL, + TRUE, 75000000, 'Tennessee Regulatory Authority', 'https://www.tn.gov/tra.html', '$750K for intrastate for-hire property carriers.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- TEXAS +-- ═══════════════════════════════════════════════════════════════════════ +('TX', + TRUE, 'Texas Department of Motor Vehicles', 'https://www.txdmv.gov/motor-carriers', + TRUE, 'Texas Comptroller of Public Accounts', 'https://comptroller.texas.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + TRUE, 'TxDMV Number / Intrastate Operating Authority', 'Texas Department of Motor Vehicles', 'https://www.txdmv.gov/motor-carriers', 'Required for all intrastate CMV operators. TxDMV number is state-specific.', + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Intrastate Operating Authority', 'Texas Department of Motor Vehicles', 'https://www.txdmv.gov/motor-carriers', 'Motor carriers operating intrastate CMVs must obtain TxDMV number and intrastate authority', + TRUE, 'TxDMV Number', 'Texas Department of Motor Vehicles', 'https://www.txdmv.gov/motor-carriers', 'State-specific number required for intrastate CMV operations. Applied via TxFLEET portal.', + TRUE, 50000000, 'Texas Department of Motor Vehicles', 'https://www.txdmv.gov/motor-carriers', '$500K for intrastate non-hazmat. $1M for hazmat. Form E filing with TxDMV. UM/UIM coverage mandatory.', + TRUE, 'TxDMV number + intrastate authority + UCR registration all handled by TxDMV.'), + +-- ═══════════════════════════════════════════════════════════════════════ +-- UTAH +-- ═══════════════════════════════════════════════════════════════════════ +('UT', + TRUE, 'Utah Department of Transportation', 'https://www.udot.utah.gov/connect/business/motor-carriers/', + TRUE, 'Utah State Tax Commission', 'https://tax.utah.gov/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, 'Utah does not require separate intrastate authority for property carriers', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs. Intrastate fuel decals required.', + FALSE, NULL, NULL, NULL, 'Intrastate fuel permit/decals required.', + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- VERMONT +-- ═══════════════════════════════════════════════════════════════════════ +('VT', + TRUE, 'Vermont Department of Motor Vehicles', 'https://dmv.vermont.gov/CVO/international-registration-plan-irp', + TRUE, 'Vermont Department of Motor Vehicles', 'https://dmv.vermont.gov/CVO/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'Vermont Agency of Natural Resources', 'https://anr.vermont.gov/', 'ACT rule effective 2026 model year. Enforcement may be delayed.', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- VIRGINIA +-- ═══════════════════════════════════════════════════════════════════════ +('VA', + TRUE, 'Virginia DMV', 'https://www.dmv.virginia.gov/vehicles/motor-carrier-services', + TRUE, 'Virginia DMV', 'https://www.dmv.virginia.gov/vehicles/motor-carrier-services', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Virginia Department of Motor Vehicles', 'https://www.dmv.virginia.gov/vehicles/motor-carrier-services', 'For-hire intrastate carriers must obtain DMV authority', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- WASHINGTON +-- ═══════════════════════════════════════════════════════════════════════ +('WA', + TRUE, 'Washington Department of Licensing', 'https://dol.wa.gov/vehicles-and-boats/prorate-and-fuel-tax/international-registration-plan-prorate/', + TRUE, 'Washington Department of Licensing', 'https://dol.wa.gov/vehicles-and-boats/prorate-and-fuel-tax/', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Advanced Clean Trucks (adopted)', 'Washington Department of Ecology', 'https://ecology.wa.gov/', 'ACT rule effective 2025 model year.', + TRUE, 'Permit', 'Washington Utilities and Transportation Commission', 'https://www.utc.wa.gov/regulated-industries/transportation', 'For-hire intrastate carriers must obtain WUTC permit', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- WEST VIRGINIA +-- ═══════════════════════════════════════════════════════════════════════ +('WV', + TRUE, 'West Virginia Division of Motor Vehicles', 'https://transportation.wv.gov/DMV/Motor-Carriers/Pages/IRP-IFTA.aspx', + TRUE, 'West Virginia Division of Motor Vehicles', 'https://transportation.wv.gov/DMV/Motor-Carriers/Pages/IRP-IFTA.aspx', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'West Virginia Public Service Commission', 'https://www.psc.state.wv.us/', 'For-hire intrastate carriers must obtain PSC authority. Intrastate fuel decals required.', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs. Intrastate fuel decals required.', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- WISCONSIN +-- ═══════════════════════════════════════════════════════════════════════ +('WI', + TRUE, 'Wisconsin Department of Transportation', 'https://wisconsindot.gov/pages/dmv/com-drv-vehs/mtr-car-trkr/irp.aspx', + TRUE, 'Wisconsin Department of Transportation', 'https://wisconsindot.gov/pages/dmv/com-drv-vehs/mtr-car-trkr/ifta.aspx', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Wisconsin Department of Transportation', 'https://wisconsindot.gov/', 'For-hire intrastate carriers must register with WisDOT', + FALSE, NULL, NULL, NULL, 'USDOT number required for intrastate CMVs', + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL), + +-- ═══════════════════════════════════════════════════════════════════════ +-- WYOMING +-- ═══════════════════════════════════════════════════════════════════════ +('WY', + TRUE, 'Wyoming Department of Transportation', 'https://www.dot.state.wy.us/home/trucking_commercial_vehicles.html', + TRUE, 'Wyoming Department of Transportation', 'https://www.dot.state.wy.us/home/trucking_commercial_vehicles.html', + FALSE, NULL, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, 'Certificate of Authority', 'Wyoming Department of Transportation', 'https://www.dot.state.wy.us/', 'For-hire intrastate carriers must register with WYDOT', + FALSE, NULL, NULL, NULL, NULL, + FALSE, NULL, NULL, NULL, NULL, + TRUE, NULL) + +ON CONFLICT (state_code) DO NOTHING; + +COMMIT; diff --git a/api/migrations/080_carrier_operating_states.sql b/api/migrations/080_carrier_operating_states.sql new file mode 100644 index 0000000..68a608a --- /dev/null +++ b/api/migrations/080_carrier_operating_states.sql @@ -0,0 +1,27 @@ +-- 080_carrier_operating_states.sql +-- +-- Track which states a carrier operates in. Populated from: +-- - Intake forms (customer self-reports operating states) +-- - FMCSA census (phy_state as base state) +-- - Inferred from order history +-- +-- Used by the DOT compliance checker to show state-specific requirements +-- and by the deficiency flagger for state-targeted campaigns. + +BEGIN; + +CREATE TABLE IF NOT EXISTS carrier_operating_states ( + id SERIAL PRIMARY KEY, + dot_number TEXT NOT NULL, + state_code CHAR(2) NOT NULL, + is_base_state BOOLEAN NOT NULL DEFAULT FALSE, + source TEXT NOT NULL DEFAULT 'intake', -- 'intake', 'census', 'inferred' + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE (dot_number, state_code) +); + +CREATE INDEX IF NOT EXISTS idx_carrier_ops_dot ON carrier_operating_states(dot_number); +CREATE INDEX IF NOT EXISTS idx_carrier_ops_state ON carrier_operating_states(state_code); +CREATE INDEX IF NOT EXISTS idx_carrier_ops_base ON carrier_operating_states(is_base_state) WHERE is_base_state = TRUE; + +COMMIT; diff --git a/api/src/routes/checkout.ts b/api/src/routes/checkout.ts index 87c24d5..05107b4 100644 --- a/api/src/routes/checkout.ts +++ b/api/src/routes/checkout.ts @@ -2038,8 +2038,23 @@ async function sendComplianceIntakeEmail(

` : ""; - // Build intake form links for each service - const intakeLinks = orders.map(o => { + // DOT services are admin-assisted — no intake form needed + const DOT_SLUGS = new Set([ + "mcs150-update", "boc3-filing", "ucr-registration", "dot-registration", + "mc-authority", "dot-drug-alcohol", "dot-audit-prep", "dot-full-compliance", + // State-level trucking + "irp-registration", "ifta-application", "ifta-quarterly", + "or-weight-mile-tax", "ny-hut-registration", "ky-kyu-registration", + "nm-weight-distance", "ct-highway-use-fee", "ca-mcp-carb", + "state-dot-registration", "intrastate-authority", "osow-permit", + "state-trucking-bundle", + ]); + const dotOrders = orders.filter(o => DOT_SLUGS.has(o.service_slug as string)); + const fccOrders = orders.filter(o => !DOT_SLUGS.has(o.service_slug as string)); + const isDotOnly = fccOrders.length === 0; + + // Build intake form links for FCC services only + const intakeLinks = fccOrders.map(o => { const slug = o.service_slug as string; const orderNum = o.order_number as string; const name = o.service_name as string; @@ -2047,7 +2062,7 @@ async function sendComplianceIntakeEmail( return `
  • ${name}
  • `; }).join("\n"); - const intakeSection = ` + const intakeSection = fccOrders.length > 0 ? `

    Action Required: Complete Your Intake Form

    @@ -2055,12 +2070,26 @@ async function sendComplianceIntakeEmail(

    This usually takes 2-5 minutes. We cannot begin your filing until the intake form is complete.

    -
    `; + ` : ""; + + const dotSection = dotOrders.length > 0 ? ` +
    +

    We're Working On It

    +

    + The following services are being processed by our team. No further action is needed from you. +

    + +

    You'll receive a confirmation email when your filing is complete, typically within 1 business day.

    +
    ` : ""; const { sendEmail } = await import("../email.js"); await sendEmail({ to: customerEmail, - subject: `Action Required — ${entityName || "Your"} FCC Compliance Order`, + subject: isDotOnly + ? `Order Confirmed — ${entityName || "Your"} DOT Compliance Order` + : `Action Required — ${entityName || "Your"} Compliance Order`, html: ` @@ -2093,14 +2122,22 @@ async function sendComplianceIntakeEmail( ${usacSection} + ${dotSection} + ${intakeSection}

    What to Expect

    + ${isDotOnly ? ` +

    1. Our team is already working on your filing.

    +

    2. Most DOT filings are completed within 1 business day.

    +

    3. You will receive a confirmation email when everything is filed.

    + ` : `

    1. Complete the intake form above so we have the details we need.

    2. We will prepare your filing within 3-7 business days.

    3. You will receive the document for review and electronic signature.

    -

    4. Once signed, we file it with the FCC and send you confirmation.

    - ${has499 ? `

    4. For 499-A filings, complete the USAC delegation above and click the confirmation button.

    ` : ""} +

    4. Once signed, we file it and send you confirmation.

    + ${has499 ? `

    5. For 499-A filings, complete the USAC delegation above and click the confirmation button.

    ` : ""} + `}

    Questions? Contact us at diff --git a/api/src/routes/compliance-orders.ts b/api/src/routes/compliance-orders.ts index f775be7..2bcabd4 100644 --- a/api/src/routes/compliance-orders.ts +++ b/api/src/routes/compliance-orders.ts @@ -269,6 +269,85 @@ const COMPLIANCE_SERVICES: Record< erpnext_item: "DOT-FULL-COMPLIANCE", discountable: true, }, + // ── State-Level Trucking Compliance ────────────────────────────────── + "irp-registration": { + name: "IRP Registration Assistance", + price_cents: 19900, + erpnext_item: "IRP-REGISTRATION", + discountable: true, + }, + "ifta-application": { + name: "IFTA Application + Decals", + price_cents: 14900, + erpnext_item: "IFTA-APPLICATION", + discountable: true, + }, + "ifta-quarterly": { + name: "IFTA Quarterly Filing", + price_cents: 9900, + erpnext_item: "IFTA-QUARTERLY", + discountable: true, + }, + "or-weight-mile-tax": { + name: "Oregon Weight-Mile Tax Setup", + price_cents: 19900, + erpnext_item: "OR-WEIGHT-MILE-TAX", + discountable: true, + }, + "ny-hut-registration": { + name: "NY Highway Use Tax Registration", + price_cents: 19900, + erpnext_item: "NY-HUT-REGISTRATION", + discountable: true, + }, + "ky-kyu-registration": { + name: "KY Weight-Distance Tax Setup", + price_cents: 19900, + erpnext_item: "KY-KYU-REGISTRATION", + discountable: true, + }, + "nm-weight-distance": { + name: "NM Weight-Distance Tax Setup", + price_cents: 19900, + erpnext_item: "NM-WEIGHT-DISTANCE", + discountable: true, + }, + "ct-highway-use-fee": { + name: "CT Highway Use Fee Setup", + price_cents: 19900, + erpnext_item: "CT-HIGHWAY-USE-FEE", + discountable: true, + }, + "ca-mcp-carb": { + name: "California MCP + CARB Compliance", + price_cents: 34900, + erpnext_item: "CA-MCP-CARB", + discountable: true, + }, + "state-dot-registration": { + name: "State DOT Registration", + price_cents: 14900, + erpnext_item: "STATE-DOT-REGISTRATION", + discountable: true, + }, + "intrastate-authority": { + name: "Intrastate Operating Authority", + price_cents: 24900, + erpnext_item: "INTRASTATE-AUTHORITY", + discountable: true, + }, + "osow-permit": { + name: "Oversize/Overweight Permit", + price_cents: 9900, + erpnext_item: "OSOW-PERMIT", + discountable: true, + }, + "state-trucking-bundle": { + name: "State Compliance Bundle", + price_cents: 59900, + erpnext_item: "STATE-TRUCKING-BUNDLE", + discountable: true, + }, }; // ── Intake validation map ───────────────────────────────────────────── diff --git a/api/src/routes/dot-lookup.ts b/api/src/routes/dot-lookup.ts index 0363fb6..461a903 100644 --- a/api/src/routes/dot-lookup.ts +++ b/api/src/routes/dot-lookup.ts @@ -304,6 +304,109 @@ router.get("/api/v1/dot/lookup", async (req, res) => { } } + // ── State-Level Compliance Checks ────────────────────────────── + const phyState = (carrier?.phyState || census?.phy_state || "").toUpperCase(); + const isInterstate = carrier + ? (carrier.censusTypeId?.censusTypeDesc || "").toLowerCase().includes("interstate") + : (census?.carrier_operation || "").toLowerCase().includes("interstate"); + const isForHireCarrier = census?.authorized_for_hire || false; + + if (phyState && phyState.length === 2) { + try { + const stReq = await pool.query( + "SELECT * FROM state_trucking_requirements WHERE state_code = $1", + [phyState], + ); + const st = stReq.rows[0]; + if (st) { + // Check 8: IRP + if (st.irp_member && isInterstate) { + checks.push({ + id: "irp", + label: "IRP (Apportioned Registration)", + status: "yellow", + detail: `Interstate carriers based in ${phyState} must register under the International Registration Plan (IRP) through ${st.irp_agency || "their state DMV"}.`, + action_url: st.irp_url || null, + }); + } + + // Check 9: IFTA + if (st.ifta_member && isInterstate) { + checks.push({ + id: "ifta", + label: "IFTA (Fuel Tax)", + status: "yellow", + detail: `Interstate carriers must file quarterly IFTA fuel tax returns through ${st.ifta_agency || "their base state"}.`, + action_url: st.ifta_url || null, + }); + } + + // Check 10: Weight/Distance Tax + if (st.weight_distance_tax) { + checks.push({ + id: "weight_distance_tax", + label: st.weight_distance_tax_name || "Weight-Distance Tax", + status: "yellow", + detail: `${phyState} requires a ${st.weight_distance_tax_name || "weight-distance tax"} for commercial vehicles${st.weight_distance_threshold_lbs ? ` over ${st.weight_distance_threshold_lbs.toLocaleString()} lbs` : ""}.` + + (st.weight_distance_notes ? ` ${st.weight_distance_notes}` : ""), + action_url: st.weight_distance_url || null, + }); + } + + // Check 11: State Motor Carrier Permit (CA MCP, etc.) + if (st.state_carrier_permit) { + checks.push({ + id: "state_carrier_permit", + label: st.state_carrier_permit_name || "State Carrier Permit", + status: "yellow", + detail: `${phyState} requires a ${st.state_carrier_permit_name || "state motor carrier permit"}.` + + (st.state_carrier_permit_notes ? ` ${st.state_carrier_permit_notes}` : ""), + action_url: st.state_carrier_permit_url || null, + }); + } + + // Check 12: Emissions (CARB, ACT) + if (st.emissions_program) { + checks.push({ + id: "emissions", + label: st.emissions_program_name || "Emissions Compliance", + status: "yellow", + detail: `${phyState} has emissions requirements for commercial vehicles: ${st.emissions_program_name || "state emissions program"}.` + + (st.emissions_notes ? ` ${st.emissions_notes}` : ""), + action_url: st.emissions_url || null, + }); + } + + // Check 13: Intrastate Authority + if (st.intrastate_authority_required && isForHireCarrier) { + checks.push({ + id: "intrastate_authority", + label: "Intrastate Operating Authority", + status: "yellow", + detail: `For-hire intrastate carriers in ${phyState} need ${st.intrastate_authority_name || "state operating authority"} from ${st.intrastate_authority_agency || "the state PUC/PSC"}.` + + (st.intrastate_authority_notes ? ` ${st.intrastate_authority_notes}` : ""), + action_url: st.intrastate_authority_url || null, + }); + } + + // Check 14: State DOT Number + if (st.state_dot_required) { + checks.push({ + id: "state_dot", + label: st.state_dot_number_name || "State DOT Registration", + status: "yellow", + detail: `${phyState} requires a ${st.state_dot_number_name || "state DOT number"} in addition to your federal USDOT number.` + + (st.state_dot_notes ? ` ${st.state_dot_notes}` : ""), + action_url: st.state_dot_url || null, + }); + } + } + } catch (stErr) { + // Table may not exist yet — skip state checks silently + console.warn("[dot-lookup] State checks skipped:", (stErr as Error).message); + } + } + // Build response const redCount = checks.filter(c => c.status === "red").length; const yellowCount = checks.filter(c => c.status === "yellow").length; @@ -416,4 +519,87 @@ router.get("/api/v1/dot/search", async (req, res) => { } }); +// ── State Requirements Lookup ────────────────────────────────────── + +router.get("/api/v1/dot/state-requirements", async (req, res) => { + const baseState = ((req.query.base_state as string) || "").toUpperCase().trim(); + const opStates = ((req.query.operating_states as string) || "") + .split(",") + .map(s => s.toUpperCase().trim()) + .filter(s => s.length === 2); + + // Include base_state in the lookup set + const allStates = [...new Set([baseState, ...opStates].filter(Boolean))]; + if (!allStates.length) { + res.status(400).json({ error: "Provide base_state and/or operating_states." }); + return; + } + + try { + const result = await pool.query( + "SELECT * FROM state_trucking_requirements WHERE state_code = ANY($1::char(2)[])", + [allStates], + ); + + const requirements: Record = {}; + const recommended: Array<{ slug: string; name: string; price_cents: number; reason: string }> = []; + let needsIrp = false; + let needsIfta = false; + + for (const st of result.rows) { + const code = st.state_code; + const reqs: string[] = []; + + if (st.irp_member) { reqs.push("IRP"); needsIrp = true; } + if (st.ifta_member) { reqs.push("IFTA"); needsIfta = true; } + if (st.weight_distance_tax) { + reqs.push(st.weight_distance_tax_name || "Weight-Distance Tax"); + const slugMap: Record = { OR: "or-weight-mile-tax", NY: "ny-hut-registration", KY: "ky-kyu-registration", NM: "nm-weight-distance", CT: "ct-highway-use-fee" }; + if (slugMap[code]) { + recommended.push({ slug: slugMap[code], name: st.weight_distance_tax_name, price_cents: 19900, reason: `${code} ${st.weight_distance_tax_name} required` }); + } + } + if (st.state_carrier_permit) { + reqs.push(st.state_carrier_permit_name || "State Carrier Permit"); + if (code === "CA") recommended.push({ slug: "ca-mcp-carb", name: "California MCP + CARB Compliance", price_cents: 34900, reason: "CA Motor Carrier Permit + CARB required" }); + } + if (st.emissions_program) reqs.push(st.emissions_program_name || "Emissions"); + if (st.intrastate_authority_required) { + reqs.push("Intrastate Authority"); + recommended.push({ slug: "intrastate-authority", name: "Intrastate Operating Authority", price_cents: 24900, reason: `${code} requires state operating authority` }); + } + if (st.state_dot_required) reqs.push(st.state_dot_number_name || "State DOT Number"); + + requirements[code] = { ...st, requirement_summary: reqs }; + } + + // Add IRP/IFTA recommendations if any state requires them + if (needsIrp && allStates.length > 1) { + recommended.unshift({ slug: "irp-registration", name: "IRP Registration Assistance", price_cents: 19900, reason: "IRP required for interstate operation" }); + } + if (needsIfta && allStates.length > 1) { + recommended.splice(1, 0, { slug: "ifta-application", name: "IFTA Application + Decals", price_cents: 14900, reason: "IFTA required for interstate fuel tax" }); + } + + // Deduplicate recommendations by slug + const seen = new Set(); + const uniqueRecs = recommended.filter(r => { if (seen.has(r.slug)) return false; seen.add(r.slug); return true; }); + + // Add bundle if 3+ recommendations + if (uniqueRecs.length >= 3) { + uniqueRecs.push({ slug: "state-trucking-bundle", name: "State Compliance Bundle", price_cents: 59900, reason: "Bundle saves vs. individual services" }); + } + + res.json({ + base_state: baseState || null, + operating_states: opStates, + requirements, + recommended_services: uniqueRecs, + }); + } catch (err) { + console.error("[dot-state-requirements] Error:", err); + res.status(500).json({ error: "State requirements lookup failed." }); + } +}); + export default router; diff --git a/scripts/workers/services/__init__.py b/scripts/workers/services/__init__.py index c923003..7bd2f99 100644 --- a/scripts/workers/services/__init__.py +++ b/scripts/workers/services/__init__.py @@ -48,6 +48,8 @@ from .fcc_carrier_registration import FCCCarrierRegistrationHandler # DOT / FMCSA Motor Carrier Services from .mcs150_update import MCS150UpdateHandler from .boc3_filing import BOC3FilingHandler +# State-level trucking compliance (IRP, IFTA, weight taxes, MCP, etc.) +from .state_trucking import StateTruckingHandler SERVICE_HANDLERS: dict[str, type] = { "flsa-audit": FLSAAuditHandler, @@ -103,6 +105,20 @@ SERVICE_HANDLERS: dict[str, type] = { "dot-drug-alcohol": MCS150UpdateHandler, # admin-assisted (partner enrollment) "dot-audit-prep": MCS150UpdateHandler, # admin-assisted (document prep) "dot-full-compliance": MCS150UpdateHandler, # fans out to individual services + # ── State-Level Trucking Compliance ─────────────────────────────── + "irp-registration": StateTruckingHandler, + "ifta-application": StateTruckingHandler, + "ifta-quarterly": StateTruckingHandler, + "or-weight-mile-tax": StateTruckingHandler, + "ny-hut-registration": StateTruckingHandler, + "ky-kyu-registration": StateTruckingHandler, + "nm-weight-distance": StateTruckingHandler, + "ct-highway-use-fee": StateTruckingHandler, + "ca-mcp-carb": StateTruckingHandler, + "state-dot-registration": StateTruckingHandler, + "intrastate-authority": StateTruckingHandler, + "osow-permit": StateTruckingHandler, + "state-trucking-bundle": StateTruckingHandler, } # Service slugs that operate on a telecom entity — used by job_server.py diff --git a/scripts/workers/services/boc3_filing.py b/scripts/workers/services/boc3_filing.py index 0c01b50..99942d3 100644 --- a/scripts/workers/services/boc3_filing.py +++ b/scripts/workers/services/boc3_filing.py @@ -42,11 +42,14 @@ from datetime import datetime LOG = logging.getLogger("workers.services.boc3_filing") -# Process agent partner details — update when partnership is established +# Process agent partner details +# NWRA (Northwest Registered Agent) confirmed they no longer offer BOC-3. +# Registered Agents Inc is the replacement vendor (contract pending). +# Wholesale cost: ~$25 or less. Manual fulfillment until API is available. PROCESS_AGENT_PARTNER = { - "name": "TBD — NWRA or similar", - "contact_email": "", - "api_endpoint": None, # Will be set when partner API is available + "name": "Registered Agents Inc", + "contact_email": "", # Update when contract is executed + "api_endpoint": None, # Will be set when RAI API is available } @@ -56,6 +59,11 @@ class BOC3FilingHandler: SERVICE_SLUG = "boc3-filing" SERVICE_NAME = "BOC-3 Process Agent Filing" + async def process(self, order_data: dict) -> list[str]: + """Entry point called by job_server. Delegates to handle().""" + order_number = order_data.get("order_number", order_data.get("name", "")) + return self.handle(order_data, order_number) + def handle(self, order_data: dict, order_number: str) -> list[str]: """ Process a BOC-3 filing order. diff --git a/scripts/workers/services/mcs150_update.py b/scripts/workers/services/mcs150_update.py index 8c76110..bb987d6 100644 --- a/scripts/workers/services/mcs150_update.py +++ b/scripts/workers/services/mcs150_update.py @@ -56,6 +56,11 @@ class MCS150UpdateHandler: SERVICE_SLUG = "mcs150-update" SERVICE_NAME = "MCS-150 Biennial Update" + async def process(self, order_data: dict) -> list[str]: + """Entry point called by job_server. Delegates to handle().""" + order_number = order_data.get("order_number", order_data.get("name", "")) + return self.handle(order_data, order_number) + def handle(self, order_data: dict, order_number: str) -> list[str]: """ Process an MCS-150 update order. diff --git a/scripts/workers/services/state_trucking.py b/scripts/workers/services/state_trucking.py new file mode 100644 index 0000000..2e43a9c --- /dev/null +++ b/scripts/workers/services/state_trucking.py @@ -0,0 +1,377 @@ +""" +State-Level Trucking Compliance Service Handler. + +Handles all state-specific motor carrier compliance services: + - IRP Registration Assistance + - IFTA Application + Decals + - IFTA Quarterly Filing + - Oregon Weight-Mile Tax Setup + - NY Highway Use Tax Registration + - KY Weight-Distance Tax Setup + - NM Weight-Distance Tax Setup + - CT Highway Use Fee Setup + - California MCP + CARB Compliance + - State DOT Registration + - Intrastate Operating Authority + - Oversize/Overweight Permit + - State Compliance Bundle + +All are admin-assisted: we create a todo with state-specific filing +instructions. The state_trucking_requirements table (migration 079) +provides agency names, portal URLs, and requirement details. + +Pricing: $99-$599 depending on service. +""" + +from __future__ import annotations + +import json +import logging +import os +from datetime import datetime + +LOG = logging.getLogger("workers.services.state_trucking") + +# Map service slugs to human-readable names and filing instructions +SERVICE_INFO = { + "irp-registration": { + "name": "IRP Registration Assistance", + "category": "irp", + "steps": [ + "1. Verify carrier's base state and operating states", + "2. Determine vehicle types and weights for apportionment", + "3. File IRP application through base state's IRP office", + "4. Submit cab card documentation for each power unit", + "5. Pay apportioned fees to each jurisdiction", + "6. Send confirmation + cab cards to client", + ], + }, + "ifta-application": { + "name": "IFTA Application + Decals", + "category": "ifta", + "steps": [ + "1. Verify carrier's base state for IFTA", + "2. File IFTA license application through base state", + "3. Order IFTA decals (2 per qualifying vehicle)", + "4. Set up quarterly filing schedule", + "5. Send IFTA license + decals to client", + ], + }, + "ifta-quarterly": { + "name": "IFTA Quarterly Filing", + "category": "ifta", + "steps": [ + "1. Collect mileage records for the quarter by jurisdiction", + "2. Collect fuel purchase records for the quarter", + "3. Calculate net tax/credit per jurisdiction", + "4. File quarterly return through base state's IFTA portal", + "5. Pay any taxes due or process credits", + "6. Send confirmation to client", + ], + }, + "or-weight-mile-tax": { + "name": "Oregon Weight-Mile Tax Setup", + "category": "weight_distance", + "steps": [ + "1. Register carrier with Oregon DOT for Weight-Mile Tax", + "2. Set up Oregon Trucking Online (OTO) account", + "3. File for weight receipt / temporary pass if needed", + "4. Configure monthly/quarterly reporting schedule", + "5. File first weight-mile tax report", + "6. Send account credentials and confirmation to client", + ], + }, + "ny-hut-registration": { + "name": "NY Highway Use Tax Registration", + "category": "weight_distance", + "steps": [ + "1. Register carrier with NY Department of Tax and Finance", + "2. File Form TMT-1 (Highway Use Tax Return) registration", + "3. Obtain NYHUT certificate of registration", + "4. Set up quarterly filing schedule", + "5. Send certificate and filing instructions to client", + ], + }, + "ky-kyu-registration": { + "name": "KY Weight-Distance Tax Setup", + "category": "weight_distance", + "steps": [ + "1. Register carrier with Kentucky Department of Revenue", + "2. Obtain KYU number", + "3. Set up quarterly reporting on KY E-file system", + "4. File first weight-distance tax return", + "5. Send KYU number and confirmation to client", + ], + }, + "nm-weight-distance": { + "name": "NM Weight-Distance Tax Setup", + "category": "weight_distance", + "steps": [ + "1. Register carrier with NM Motor Vehicle Division", + "2. Obtain annual weight-distance tax permit (per vehicle)", + "3. Set up e-permit account", + "4. Send permits and confirmation to client", + ], + }, + "ct-highway-use-fee": { + "name": "CT Highway Use Fee Setup", + "category": "weight_distance", + "steps": [ + "1. Register carrier with CT Department of Revenue Services", + "2. Set up myconneCT portal account", + "3. File initial Highway Use Fee registration", + "4. Set up quarterly filing schedule", + "5. Send registration confirmation to client", + ], + }, + "ca-mcp-carb": { + "name": "California MCP + CARB Compliance", + "category": "state_permit", + "steps": [ + "1. Obtain CA Number from California Highway Patrol (CHP)", + "2. Apply for Motor Carrier Permit (MCP) through CA DMV", + "3. Verify vehicle fleet meets CARB Truck & Bus Rule requirements", + "4. File CARB compliance documentation if needed", + "5. Set up annual MCP renewal reminders", + "6. Send CA Number, MCP, and CARB compliance status to client", + ], + }, + "state-dot-registration": { + "name": "State DOT Registration", + "category": "state_dot", + "steps": [ + "1. Determine which state requires separate DOT registration", + "2. File registration application with state DOT/DMV", + "3. Submit required documentation (insurance, USDOT, etc.)", + "4. Obtain state registration number", + "5. Send registration confirmation to client", + ], + }, + "intrastate-authority": { + "name": "Intrastate Operating Authority", + "category": "intrastate", + "steps": [ + "1. Determine state-specific authority type (COA, CPCN, etc.)", + "2. File application with state PUC/PSC/DOT", + "3. Submit required documentation (insurance, BOC-3, financials)", + "4. Pay state filing fees", + "5. Monitor application status", + "6. Send authority certificate to client when issued", + ], + }, + "osow-permit": { + "name": "Oversize/Overweight Permit", + "category": "osow", + "steps": [ + "1. Determine permit type (single trip vs annual)", + "2. Collect load specifications (dimensions, weight, route)", + "3. File permit application with state DOT", + "4. Pay permit fees", + "5. Obtain and verify permit conditions/restrictions", + "6. Send permit to client", + ], + }, + "state-trucking-bundle": { + "name": "State Compliance Bundle", + "category": "bundle", + "steps": [ + "1. Review carrier's base state and operating states", + "2. Identify all state-level obligations (IRP, IFTA, weight tax, permits)", + "3. File IRP registration through base state", + "4. File IFTA application through base state", + "5. Register for any applicable weight-distance taxes", + "6. Apply for state carrier permits where required", + "7. Send all registrations and confirmations to client", + ], + }, +} + + +class StateTruckingHandler: + """Handle all state-level trucking compliance orders.""" + + SERVICE_SLUG = "state-trucking" + SERVICE_NAME = "State Trucking Compliance" + + async def process(self, order_data: dict) -> list[str]: + """Entry point called by job_server. Delegates to handle().""" + order_number = order_data.get("order_number", order_data.get("name", "")) + return self.handle(order_data, order_number) + + def handle(self, order_data: dict, order_number: str) -> list[str]: + """Process a state trucking compliance order.""" + # Resolve the service slug — job_server may store it in order_data, + # or we can look it up from the DB via order_number. + service_slug = order_data.get("service_slug", "") + if not service_slug and order_number: + service_slug = self._resolve_slug(order_number) + info = SERVICE_INFO.get(service_slug, {}) + service_name = info.get("name", service_slug) + + LOG.info("[%s] Processing %s order", order_number, service_name) + + intake = order_data.get("intake_data") or {} + if isinstance(intake, str): + intake = json.loads(intake) + + dot_number = intake.get("dot_number", "") + entity_name = intake.get("entity_name", order_data.get("customer_name", "")) + customer_email = order_data.get("customer_email", "") + base_state = intake.get("base_state", intake.get("phy_state", "")) + operating_states = intake.get("operating_states", []) + + # Look up state requirements if we have a base state + state_reqs = None + if base_state: + state_reqs = self._get_state_requirements(base_state) + + # Build the admin todo + steps = info.get("steps", ["1. Review order and fulfill manually"]) + + # Enrich steps with state-specific agency info if available + if state_reqs: + agency_info = self._get_agency_info(info.get("category", ""), state_reqs) + if agency_info: + steps = steps + [f"Agency: {agency_info['agency']}", f"Portal: {agency_info['url']}"] + + todo_data = { + "order_number": order_number, + "service": service_name, + "service_slug": service_slug, + "dot_number": dot_number, + "entity_name": entity_name, + "customer_email": customer_email, + "base_state": base_state, + "operating_states": operating_states, + "intake_data": intake, + "state_requirements": state_reqs, + "steps": steps, + } + + try: + import psycopg2 + conn = psycopg2.connect(os.environ.get("DATABASE_URL", "")) + try: + with conn.cursor() as cur: + cur.execute(""" + INSERT INTO admin_todos ( + title, category, priority, order_number, service_slug, + description, data, status + ) VALUES (%s, %s, %s, %s, %s, %s, %s, 'pending') + """, ( + f"{service_name} — {entity_name} (DOT {dot_number})" + if dot_number else f"{service_name} — {entity_name}", + "filing", + "high" if service_slug in ("ca-mcp-carb", "state-trucking-bundle") else "normal", + order_number, + service_slug, + f"Service: {service_name}\n" + f"DOT: {dot_number}\n" + f"Base state: {base_state}\n" + f"Operating states: {', '.join(operating_states) if operating_states else 'N/A'}\n" + f"Customer: {customer_email}\n\n" + f"Steps:\n" + "\n".join(steps), + json.dumps(todo_data), + )) + conn.commit() + finally: + conn.close() + LOG.info("[%s] Admin todo created for %s", order_number, service_name) + except Exception as exc: + LOG.error("[%s] Failed to create admin todo: %s", order_number, exc) + + # Send status email + self._send_status_email( + order_number, service_name, entity_name, dot_number, customer_email + ) + + return [] + + def _resolve_slug(self, order_number: str) -> str: + """Look up the service_slug from compliance_orders by order_number.""" + try: + import psycopg2 + conn = psycopg2.connect(os.environ.get("DATABASE_URL", "")) + try: + with conn.cursor() as cur: + cur.execute( + "SELECT service_slug FROM compliance_orders WHERE order_number = %s", + (order_number,), + ) + row = cur.fetchone() + return row[0] if row else "" + finally: + conn.close() + except Exception as exc: + LOG.warning("Could not resolve slug for %s: %s", order_number, exc) + return "" + + def _get_state_requirements(self, state_code: str) -> dict | None: + """Fetch state trucking requirements from database.""" + try: + import psycopg2 + conn = psycopg2.connect(os.environ.get("DATABASE_URL", "")) + try: + with conn.cursor() as cur: + cur.execute( + "SELECT * FROM state_trucking_requirements WHERE state_code = %s", + (state_code.upper(),), + ) + cols = [d[0] for d in cur.description] + row = cur.fetchone() + if row: + return dict(zip(cols, row)) + finally: + conn.close() + except Exception as exc: + LOG.warning("Could not fetch state requirements for %s: %s", state_code, exc) + return None + + def _get_agency_info(self, category: str, reqs: dict) -> dict | None: + """Extract the relevant agency name and URL for a service category.""" + mapping = { + "irp": ("irp_agency", "irp_url"), + "ifta": ("ifta_agency", "ifta_url"), + "weight_distance": ("weight_distance_agency", "weight_distance_url"), + "state_permit": ("state_carrier_permit_agency", "state_carrier_permit_url"), + "state_dot": ("state_dot_agency", "state_dot_url"), + "intrastate": ("intrastate_authority_agency", "intrastate_authority_url"), + } + keys = mapping.get(category) + if keys and reqs.get(keys[0]): + return {"agency": reqs[keys[0]], "url": reqs.get(keys[1], "")} + return None + + def _send_status_email(self, order_number, service_name, entity_name, dot_number, customer_email): + """Send client a status email.""" + if not customer_email: + return + try: + import smtplib + from email.mime.text import MIMEText + + dot_line = f" (DOT# {dot_number})" if dot_number else "" + body = ( + f"Hi,\n\n" + f"We've received your {service_name} order for " + f"{entity_name}{dot_line}.\n\n" + f"Order: {order_number}\n\n" + f"Our team is reviewing your information and will complete " + f"the filing typically within 1-2 business days. We'll send " + f"you a confirmation email when everything is done.\n\n" + f"Questions? Reply to this email or call (888) 411-0383.\n\n" + f"Performance West Inc.\n" + f"DOT Compliance Services\n" + ) + + msg = MIMEText(body) + msg["Subject"] = f"{service_name} In Progress — {entity_name}{dot_line}" + msg["From"] = "noreply@performancewest.net" + msg["To"] = customer_email + + with smtplib.SMTP("localhost", 25) as s: + s.sendmail(msg["From"], [customer_email], msg.as_string()) + + LOG.info("[%s] Status email sent to %s", order_number, customer_email) + except Exception as exc: + LOG.warning("[%s] Failed to send status email: %s", order_number, exc) diff --git a/site/public/order/dot-compliance/index.html b/site/public/order/dot-compliance/index.html index c8bf2e8..f46adf4 100644 --- a/site/public/order/dot-compliance/index.html +++ b/site/public/order/dot-compliance/index.html @@ -169,6 +169,140 @@ +

    + @@ -272,6 +406,23 @@ if (dot) { if (emailFromUrl) { var e = document.getElementById("pw-email"); if (e) e.value = emailFromUrl; } if (promoFromUrl) { var p = document.getElementById("pw-promo"); if (p) { p.value = promoFromUrl.toUpperCase(); p.readOnly = true; p.style.background = "#fff7ed"; p.style.borderColor = "#f97316"; } } +// Show state compliance services section — always visible so users can add them +var stateSection = document.getElementById("pw-state-services"); +if (stateSection) stateSection.style.display = "block"; + +// If ?state=XX, highlight relevant state services +var stateParam = (params.get("state") || "").toUpperCase(); +if (stateParam && dot) { + fetch(API + "/api/v1/dot/state-requirements?base_state=" + stateParam).then(function(r) { return r.json(); }).then(function(d) { + if (d.recommended_services) { + d.recommended_services.forEach(function(svc) { + var cb = document.querySelector('input[data-slug="' + svc.slug + '"]'); + if (cb) { cb.checked = true; cb.dispatchEvent(new Event("change", { bubbles: true })); } + }); + } + }).catch(function() {}); +} + // Checkbox change → update total var checkboxes = document.querySelectorAll("input[data-slug]"); var totalSection = document.getElementById("pw-total-section"); diff --git a/site/public/services/trucking/california/index.html b/site/public/services/trucking/california/index.html new file mode 100644 index 0000000..0876db7 --- /dev/null +++ b/site/public/services/trucking/california/index.html @@ -0,0 +1,233 @@ + + + + + + + +California Trucking Compliance | MCP, CARB, IRP, IFTA | Performance West Inc. + + + + + + + + + + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + California Compliance +
    +

    California Trucking Compliance

    +

    MCP, CARB, CA Number, IRP, IFTA -- everything California carriers need to stay legal on the road.

    + +
    +
    + + +
    +
    +

    California-Specific Requirements

    +

    California has some of the strictest trucking regulations in the country. Here is what every carrier operating in the state needs to know.

    +
    + + +
    +
    + +
    +

    CA Number (CHP)

    +

    Issued by the California Highway Patrol. Required for all commercial motor vehicles operating in California. Must be obtained before applying for an MCP.

    +

    Prerequisite for MCP

    +
    + + +
    +
    + +
    +

    Motor Carrier Permit (MCP)

    +

    Issued by the CA DMV. Required for all for-hire carriers and vehicles over 10,001 lbs GVWR. Must be renewed annually. Penalties for operating without an MCP are steep.

    +

    Annual Renewal Required

    +
    + + +
    +
    + +
    +

    CARB Truck & Bus Rule

    +

    All diesel vehicles over 14,000 lbs GVWR operating in California must have a 2010 or newer model year engine. Non-compliant trucks face fines and impoundment.

    +

    2010+ Engine Required

    +
    + + +
    +
    + +
    +

    IRP Registration

    +

    International Registration Plan through the CA DMV for interstate carriers. Apportioned plates based on miles traveled in each jurisdiction. Required for vehicles over 26,000 lbs.

    +

    Interstate Carriers

    +
    + + +
    +
    + +
    +

    IFTA License

    +

    International Fuel Tax Agreement license through the CA BOE. Simplifies fuel tax reporting for carriers operating across state lines. Quarterly returns required.

    +

    Quarterly Returns

    +
    + +
    +
    +
    + + +
    +
    +

    Our California Services

    +

    We handle the paperwork so you can focus on the road. Every service includes filing preparation, submission, and follow-up.

    +
    + + +
    +

    California MCP + CARB Compliance

    +

    Full Motor Carrier Permit application or renewal, plus CARB Truck & Bus Rule compliance verification. Includes CA Number assistance if needed.

    +
    +

    $349

    + Order Now +
    +
    + + +
    +

    IRP Registration Assistance

    +

    International Registration Plan application through the CA DMV. We prepare your mileage schedules, handle the application, and track your cab cards.

    +
    +

    $199

    + Order Now +
    +
    + + +
    +

    IFTA Application + Decals

    +

    IFTA license application through the CA BOE. Includes initial decal order, quarterly return setup guidance, and ongoing filing support.

    +
    +

    $149

    + Order Now +
    +
    + + +
    +
    BEST VALUE
    +

    State Compliance Bundle

    +

    MCP + CARB + IRP + IFTA -- everything you need to operate in and through California. Save $98 vs ordering each service individually.

    +
    +

    $599

    + Order Now +
    +
    + +
    +
    +
    + + +
    +
    +

    Not sure where you stand?

    +

    Run our free DOT compliance check. Enter your USDOT number and we will show you exactly which filings are current, overdue, or missing -- including California-specific requirements.

    + + + Run Free Compliance Check + +
    +
    + + +
    +
    +

    Why Performance West

    +
    +
    +
    + +
    +

    Nationwide Service

    +

    We handle compliance in all 50 states, with deep expertise in California's unique regulatory landscape.

    +
    +
    +
    + +
    +

    1 Business Day Turnaround

    +

    Most filings are prepared and submitted within one business day of receiving your information.

    +
    +
    +
    + +
    +

    Dedicated Support

    +

    A real person answers your questions. No chatbots, no ticket queues -- just straightforward help when you need it.

    +
    +
    +
    +
    + + + + + + diff --git a/site/public/tools/dot-compliance-check/index.html b/site/public/tools/dot-compliance-check/index.html index 57e8eea..5e43e1f 100644 --- a/site/public/tools/dot-compliance-check/index.html +++ b/site/public/tools/dot-compliance-check/index.html @@ -7,11 +7,11 @@ })(); DOT Compliance Check — Free Motor Carrier Filing Status | Performance West Inc.

    DOT / FMCSA Compliance Check

    Look up any motor carrier by USDOT number or name to instantly check MCS-150 status, insurance, operating authority, and safety rating.

    Disclaimer: This tool queries publicly available FMCSA data and is for informational purposes only. Always confirm directly with FMCSA. This is not legal or compliance advice.

    @@ -27,7 +27,7 @@ Join Mailing List I agree to receive compliance updates and service announcements from Performance West Inc. I can unsubscribe at any time. We never share your email.

    How can we help?

    Choose a category and tell us what you need.

    How can we help?

    Choose a category and tell us what you need.

    + + diff --git a/site/src/pages/order/dot-audit-prep.astro b/site/src/pages/order/dot-audit-prep.astro index f79f5ee..152f306 100644 --- a/site/src/pages/order/dot-audit-prep.astro +++ b/site/src/pages/order/dot-audit-prep.astro @@ -20,3 +20,11 @@ const description = "Prepare for your 18-month FMCSA safety audit.";
    + + diff --git a/site/src/pages/order/dot-drug-alcohol.astro b/site/src/pages/order/dot-drug-alcohol.astro index d502f4f..cf489dc 100644 --- a/site/src/pages/order/dot-drug-alcohol.astro +++ b/site/src/pages/order/dot-drug-alcohol.astro @@ -20,3 +20,11 @@ const description = "Consortium enrollment, written policy, and DER designation. + + diff --git a/site/src/pages/order/dot-full-compliance.astro b/site/src/pages/order/dot-full-compliance.astro index a7ef4ac..f5a7dc9 100644 --- a/site/src/pages/order/dot-full-compliance.astro +++ b/site/src/pages/order/dot-full-compliance.astro @@ -20,3 +20,11 @@ const description = "MCS-150 + BOC-3 + UCR + Drug & Alcohol + Audit Prep."; + + diff --git a/site/src/pages/order/dot-registration.astro b/site/src/pages/order/dot-registration.astro index 10944a9..eae9c40 100644 --- a/site/src/pages/order/dot-registration.astro +++ b/site/src/pages/order/dot-registration.astro @@ -20,3 +20,11 @@ const description = "Register a new USDOT number with FMCSA."; + + diff --git a/site/src/pages/order/mc-authority.astro b/site/src/pages/order/mc-authority.astro index ee1fa34..91510c9 100644 --- a/site/src/pages/order/mc-authority.astro +++ b/site/src/pages/order/mc-authority.astro @@ -20,3 +20,11 @@ const description = "Apply for common or contract carrier operating authority."; + + diff --git a/site/src/pages/order/mcs150-update.astro b/site/src/pages/order/mcs150-update.astro index 2635c66..8ab8a5a 100644 --- a/site/src/pages/order/mcs150-update.astro +++ b/site/src/pages/order/mcs150-update.astro @@ -20,3 +20,11 @@ const description = "FMCSA biennial update of company profile, fleet size, and m + + diff --git a/site/src/pages/order/ucr-registration.astro b/site/src/pages/order/ucr-registration.astro index 94f650a..6b33c26 100644 --- a/site/src/pages/order/ucr-registration.astro +++ b/site/src/pages/order/ucr-registration.astro @@ -20,3 +20,11 @@ const description = "Unified Carrier Registration for interstate carriers."; + +