diff --git a/api/src/routes/dot-lookup.ts b/api/src/routes/dot-lookup.ts index 461a903..cc43360 100644 --- a/api/src/routes/dot-lookup.ts +++ b/api/src/routes/dot-lookup.ts @@ -306,9 +306,11 @@ router.get("/api/v1/dot/lookup", async (req, res) => { // ── State-Level Compliance Checks ────────────────────────────── const phyState = (carrier?.phyState || census?.phy_state || "").toUpperCase(); + // carrier_operation: A = Interstate, B = Intrastate Hazmat, C = Intrastate Non-Hazmat const isInterstate = carrier - ? (carrier.censusTypeId?.censusTypeDesc || "").toLowerCase().includes("interstate") - : (census?.carrier_operation || "").toLowerCase().includes("interstate"); + ? (carrier.censusTypeId?.censusTypeDesc || "").toLowerCase().includes("interstate") || + (carrier.carrierOperation?.carrierOperationCode === "A") + : (census?.carrier_operation || "").toUpperCase() === "A"; const isForHireCarrier = census?.authorized_for_hire || false; if (phyState && phyState.length === 2) { diff --git a/scripts/workers/fmcsa_deficiency_flagger.py b/scripts/workers/fmcsa_deficiency_flagger.py index 7cd7040..5d3f27a 100644 --- a/scripts/workers/fmcsa_deficiency_flagger.py +++ b/scripts/workers/fmcsa_deficiency_flagger.py @@ -163,7 +163,8 @@ def flag_carriers(dry_run: bool = False) -> dict: stats["zero_fleet"] += 1 # State-level flags based on carrier's physical state - is_interstate = carrier_op and "interstate" in (carrier_op or "").lower() + # carrier_operation: A = Interstate, B = Intrastate Hazmat, C = Intrastate Non-Hazmat + is_interstate = (carrier_op or "").upper() == "A" sr = state_reqs.get(state) if state else None if sr: # Interstate carriers need IRP and IFTA