From a471f26bb94818d45f499f3c1fdb1d4933d83050 Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 28 May 2026 23:55:19 -0500 Subject: [PATCH] Fix 4 bugs from trucking code review 1. Insurance "on file" check: undefined !== null was true, falsely showing green. Changed to !!field && field !== "0". 2. Insurance lead ticket: filtered for c.id === "insurance" but actual IDs are insurance_bipd/cargo/bond. Fixed to match prefix. 3. Bundle pricing: was $499 for $376 of services (MORE than individual). Now includes Safety Audit Prep ($399), making individual total $775 and bundle saves $276. 4. Order page submit button: inline styles for visibility (bg-orange-500 not in Astro CSS). UCR $46 gov fee confirmed correct for 2026 (fees stayed flat). Co-Authored-By: Claude Opus 4.6 (1M context) --- api/src/routes/dot-lookup.ts | 6 +++--- site/public/order/dot-compliance/index.html | 6 +++--- site/public/services/trucking/index.html | 4 ++-- site/public/tools/dot-compliance-check/index.html | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/src/routes/dot-lookup.ts b/api/src/routes/dot-lookup.ts index f043f43..733142e 100644 --- a/api/src/routes/dot-lookup.ts +++ b/api/src/routes/dot-lookup.ts @@ -134,11 +134,11 @@ router.get("/api/v1/dot/lookup", async (req, res) => { // ── Check 3: Insurance ── if (carrier) { const bipdRequired = carrier.bipdInsuranceRequired === "Y"; - const bipdOnFile = carrier.bipdInsuranceOnFile !== null && carrier.bipdInsuranceOnFile !== "0"; + const bipdOnFile = !!carrier.bipdInsuranceOnFile && carrier.bipdInsuranceOnFile !== "0"; const cargoRequired = carrier.cargoInsuranceRequired === "Y"; - const cargoOnFile = carrier.cargoInsuranceOnFile !== null && carrier.cargoInsuranceOnFile !== "0"; + const cargoOnFile = !!carrier.cargoInsuranceOnFile && carrier.cargoInsuranceOnFile !== "0"; const bondRequired = carrier.bondInsuranceRequired === "Y"; - const bondOnFile = carrier.bondInsuranceOnFile !== null && carrier.bondInsuranceOnFile !== "0"; + const bondOnFile = !!carrier.bondInsuranceOnFile && carrier.bondInsuranceOnFile !== "0"; // Check each type separately for clearer reporting if (bipdRequired) { diff --git a/site/public/order/dot-compliance/index.html b/site/public/order/dot-compliance/index.html index 4b9aaf4..d596a3f 100644 --- a/site/public/order/dot-compliance/index.html +++ b/site/public/order/dot-compliance/index.html @@ -162,9 +162,9 @@
DOT Full Compliance Bundle - $499 Save $175+ + $499 Save $276
-

MCS-150 + BOC-3 + UCR + Drug & Alcohol Program — everything you need to stay compliant. Best value.

+

MCS-150 + BOC-3 + UCR + Drug & Alcohol Program + Safety Audit Prep — everything you need. Best value.

@@ -202,7 +202,7 @@ - + diff --git a/site/public/services/trucking/index.html b/site/public/services/trucking/index.html index bfa5a1e..1b81412 100644 --- a/site/public/services/trucking/index.html +++ b/site/public/services/trucking/index.html @@ -121,8 +121,8 @@

DOT Full Compliance Bundle — $499

-

MCS-150 + BOC-3 + UCR + Drug & Alcohol Program — everything you need.

-

Save $175+ vs ordering separately

+

MCS-150 + BOC-3 + UCR + Drug & Alcohol Program + Safety Audit Prep — everything you need.

+

Save $276 vs ordering separately

Get the Full Bundle → diff --git a/site/public/tools/dot-compliance-check/index.html b/site/public/tools/dot-compliance-check/index.html index 912fd55..c89c149 100644 --- a/site/public/tools/dot-compliance-check/index.html +++ b/site/public/tools/dot-compliance-check/index.html @@ -307,7 +307,7 @@ Send reset link "Fleet: " + (data.fleet ? data.fleet.power_units + " trucks, " + data.fleet.drivers + " drivers" : "unknown"), "Phone: " + (phone || data.telephone || "not provided"), "", - "Insurance deficiency: " + ((data.checks || []).filter(function(c) { return c.id === "insurance"; })[0] || {}).detail, + "Insurance deficiency: " + ((data.checks || []).filter(function(c) { return c.id && c.id.indexOf("insurance") === 0 && c.status === "red"; }).map(function(c) { return c.label + " - " + c.detail; }).join("; ") || "See compliance check results"), "", "Contact: " + name, "Email: " + email,