Fix: separate insurance checks by type + inline styles for visibility

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) <noreply@anthropic.com>
This commit is contained in:
justin 2026-05-28 23:47:29 -05:00
parent 8e6888ff6e
commit e8f453e14b
2 changed files with 50 additions and 31 deletions

View file

@ -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.",
});
}
}