From 2b8e2cf7eaf866f4ca57adabfa352df33a5c0164 Mon Sep 17 00:00:00 2001 From: justin Date: Sat, 30 May 2026 20:39:28 -0500 Subject: [PATCH] fix: inactive carriers show yellow warning instead of green, even if FMCSA says 'allowed' --- api/src/routes/dot-lookup.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/src/routes/dot-lookup.ts b/api/src/routes/dot-lookup.ts index 6d042ff..c7f3271 100644 --- a/api/src/routes/dot-lookup.ts +++ b/api/src/routes/dot-lookup.ts @@ -98,12 +98,16 @@ router.get("/api/v1/dot/lookup", async (req, res) => { C: "Cancelled", }; const statusLabel = statusLabels[statusCode] || statusCode; + const isInactive = statusCode === "I" || statusCode === "S" || statusCode === "C"; + const effectiveStatus = allowed && !isInactive ? "green" : isInactive && allowed ? "yellow" : "red"; checks.push({ id: "operating_status", label: "Operating Status", - status: allowed ? "green" : "red", - detail: allowed - ? `Authorized to operate (${statusLabel}).` + status: effectiveStatus, + detail: effectiveStatus === "green" + ? `Active and authorized to operate.` + : effectiveStatus === "yellow" + ? `USDOT status is ${statusLabel}, but FMCSA still shows as authorized. This may indicate your registration needs to be updated or reactivated. Contact FMCSA at (800) 832-5660 if this is incorrect.` : `NOT authorized to operate — ${statusLabel}. ${ statusCode === "I" ? "This USDOT number is inactive. You may need to reactivate it before operating." : statusCode === "N" ? "This carrier is not authorized. Operating authority may be required."