From e8f453e14b05446e028257baff3517bcd2629238 Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 28 May 2026 23:47:29 -0500 Subject: [PATCH] Fix: separate insurance checks by type + inline styles for visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API: Split "Insurance Filing" into separate checks: - Liability Insurance (BIPD) — BMC-91/91X - Cargo Insurance — household goods - Broker Bond / Trust Fund — BMC-84/85 ($75K minimum) Each has its own clear label and specific remediation detail. Frontend: Convert CTA box, insurance lead capture, and "looking good" box from Tailwind classes to inline styles (Tailwind classes not in Astro compiled CSS for static public/ files). Co-Authored-By: Claude Opus 4.6 (1M context) --- api/src/routes/dot-lookup.ts | 45 +++++++++++++------ .../tools/dot-compliance-check/index.html | 36 +++++++-------- 2 files changed, 50 insertions(+), 31 deletions(-) diff --git a/api/src/routes/dot-lookup.ts b/api/src/routes/dot-lookup.ts index 7a0a205..2d6af02 100644 --- a/api/src/routes/dot-lookup.ts +++ b/api/src/routes/dot-lookup.ts @@ -140,24 +140,43 @@ router.get("/api/v1/dot/lookup", async (req, res) => { const bondRequired = carrier.bondInsuranceRequired === "Y"; const bondOnFile = carrier.bondInsuranceOnFile !== null && carrier.bondInsuranceOnFile !== "0"; - const issues: string[] = []; - if (bipdRequired && !bipdOnFile) issues.push("Liability (BIPD) insurance required but not on file"); - if (cargoRequired && !cargoOnFile) issues.push("Cargo insurance required but not on file"); - if (bondRequired && !bondOnFile) issues.push("Bond/trust fund required but not on file"); - - if (issues.length > 0) { + // Check each type separately for clearer reporting + if (bipdRequired) { checks.push({ - id: "insurance", - label: "Insurance Filing", - status: "red", - detail: issues.join(". ") + ". Operating without required insurance can result in immediate out-of-service order and operating authority revocation.", + id: "insurance_bipd", + label: "Liability Insurance (BIPD)", + status: bipdOnFile ? "green" : "red", + detail: bipdOnFile + ? "Bodily injury and property damage liability insurance is on file with FMCSA." + : "Liability insurance (BIPD) is REQUIRED but not on file. You cannot legally operate without this coverage. Your insurer must file a BMC-91/91X with FMCSA.", }); - } else if (bipdRequired || cargoRequired) { + } + if (cargoRequired) { + checks.push({ + id: "insurance_cargo", + label: "Cargo Insurance", + status: cargoOnFile ? "green" : "red", + detail: cargoOnFile + ? "Cargo insurance is on file with FMCSA." + : "Cargo insurance is REQUIRED but not on file. Required for household goods carriers. Your insurer must file proof with FMCSA.", + }); + } + if (bondRequired) { + checks.push({ + id: "insurance_bond", + label: "Broker Bond / Trust Fund", + status: bondOnFile ? "green" : "red", + detail: bondOnFile + ? "Broker surety bond or trust fund (BMC-84/85) is on file with FMCSA." + : "Broker surety bond or trust fund (BMC-84/85) is REQUIRED but not on file. Required for freight brokers and freight forwarders. Must be at least $75,000.", + }); + } + if (!bipdRequired && !cargoRequired && !bondRequired && (bipdOnFile || cargoOnFile || bondOnFile)) { checks.push({ id: "insurance", - label: "Insurance Filing", + label: "Insurance / Financial Responsibility", status: "green", - detail: "Required insurance is on file with FMCSA.", + detail: "Insurance filings are on file with FMCSA.", }); } } diff --git a/site/public/tools/dot-compliance-check/index.html b/site/public/tools/dot-compliance-check/index.html index 198b479..912fd55 100644 --- a/site/public/tools/dot-compliance-check/index.html +++ b/site/public/tools/dot-compliance-check/index.html @@ -232,22 +232,22 @@ Send reset link // Insurance lead capture — auto-checked if insurance issue found var hasInsuranceIssue = (data.checks || []).some(function(c) { - return c.id === "insurance" && c.status === "red"; + return (c.id === "insurance" || c.id === "insurance_bipd" || c.id === "insurance_cargo" || c.id === "insurance_bond") && c.status === "red"; }); if (hasInsuranceIssue) { - html += '
'; - html += '