From 3d4c72f259c07e89508114a4fa902bb437245060 Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 29 May 2026 00:12:28 -0500 Subject: [PATCH] Insurance referral on order page + fix MCS-150 date display - Order page: insurance referral checkbox (pre-checked) shown when ?ins=1 from checker or carrier has insurance gap. Flag stored in intake_data.insurance_referral_requested. - Checker CTA passes &ins=1 when insurance issues found. - MCS-150: use mcs150Outdated=N from FMCSA API to show green even without exact date. Fixes "Filing date not available" for carriers not in local census. Co-Authored-By: Claude Opus 4.6 (1M context) --- api/src/routes/dot-lookup.ts | 17 +++++++--- site/public/order/dot-compliance/index.html | 32 ++++++++++++++++++- .../tools/dot-compliance-check/index.html | 1 + 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/api/src/routes/dot-lookup.ts b/api/src/routes/dot-lookup.ts index 733142e..0363fb6 100644 --- a/api/src/routes/dot-lookup.ts +++ b/api/src/routes/dot-lookup.ts @@ -109,10 +109,17 @@ router.get("/api/v1/dot/lookup", async (req, res) => { id: "mcs150", label: "MCS-150 Biennial Update", status: "red", - detail: `OVERDUE — last filed ${mcs150Date || "unknown date"}. The MCS-150 must be updated every 2 years. ` - + `Failure to update can result in USDOT deactivation and fines up to $1,000/day (capped at $10,000). ` - + `File at: https://safer.fmcsa.dot.gov/CompanyUpdateSearch.aspx`, - action_url: "https://safer.fmcsa.dot.gov/CompanyUpdateSearch.aspx", + detail: `OVERDUE${mcs150Date ? " — last filed " + mcs150Date : ""}. The MCS-150 must be updated every 2 years. ` + + `Failure to update can result in USDOT deactivation and fines up to $1,000/day (capped at $10,000).`, + action_url: "https://portal.fmcsa.dot.gov/login", + }); + } else if (carrier && carrier.mcs150Outdated === "N") { + // API confirms not outdated — show green even without exact date + checks.push({ + id: "mcs150", + label: "MCS-150 Biennial Update", + status: "green", + detail: `Current${mcs150Date ? " — last filed " + mcs150Date : ""}.`, }); } else if (mcs150Date) { checks.push({ @@ -126,7 +133,7 @@ router.get("/api/v1/dot/lookup", async (req, res) => { id: "mcs150", label: "MCS-150 Biennial Update", status: "unknown", - detail: "Filing date not available. Verify at SAFER.", + detail: "Could not determine MCS-150 status. Verify at the FMCSA Portal.", }); } } diff --git a/site/public/order/dot-compliance/index.html b/site/public/order/dot-compliance/index.html index 807b874..c8bf2e8 100644 --- a/site/public/order/dot-compliance/index.html +++ b/site/public/order/dot-compliance/index.html @@ -171,6 +171,19 @@ + + +