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) <noreply@anthropic.com>
This commit is contained in:
parent
54d3ec6fb2
commit
a471f26bb9
4 changed files with 9 additions and 9 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -162,9 +162,9 @@
|
|||
<div class="flex-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="font-semibold text-gray-900">DOT Full Compliance Bundle</span>
|
||||
<span class="text-sm font-bold text-orange-600">$499 <span class="text-xs font-normal text-green-600 ml-1">Save $175+</span></span>
|
||||
<span class="text-sm font-bold text-orange-600">$499 <span class="text-xs font-normal text-green-600 ml-1">Save $276</span></span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 mt-1">MCS-150 + BOC-3 + UCR + Drug & Alcohol Program — everything you need to stay compliant. Best value.</p>
|
||||
<p class="text-xs text-gray-500 mt-1">MCS-150 + BOC-3 + UCR + Drug & Alcohol Program + Safety Audit Prep — everything you need. Best value.</p>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
|
|
@ -202,7 +202,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<label class="flex items-start gap-2 p-3 rounded-lg border border-gray-200 text-xs text-gray-600"><input type="checkbox" id="pw-engage" required class="mt-0.5"><span>I authorize Performance West to prepare and file on my behalf. <a href="/terms" target="_blank" class="text-orange-600 underline">Terms</a></span></label>
|
||||
<button type="submit" id="pw-submit" class="w-full py-3 rounded-lg bg-orange-500 text-white font-bold text-base hover:bg-orange-600 transition-colors disabled:bg-gray-400 shadow-lg">Continue to Secure Payment →</button>
|
||||
<button type="submit" id="pw-submit" style="width:100%;padding:12px;border-radius:8px;background:#f97316;color:#fff;font-weight:700;font-size:16px;border:none;cursor:pointer;box-shadow:0 4px 14px rgba(249,115,22,0.4)">Continue to Secure Payment →</button>
|
||||
<p id="pw-err" class="text-sm text-red-700 mt-1" hidden></p>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@
|
|||
<section class="py-12 bg-gradient-to-br from-orange-50 to-amber-50 border-y border-orange-100">
|
||||
<div class="max-w-3xl mx-auto px-4 text-center">
|
||||
<h2 class="text-2xl font-bold text-gray-900 mb-3">DOT Full Compliance Bundle — $499</h2>
|
||||
<p class="text-gray-600 mb-2">MCS-150 + BOC-3 + UCR + Drug & Alcohol Program — everything you need.</p>
|
||||
<p class="text-sm text-green-700 font-semibold mb-6">Save $175+ vs ordering separately</p>
|
||||
<p class="text-gray-600 mb-2">MCS-150 + BOC-3 + UCR + Drug & Alcohol Program + Safety Audit Prep — everything you need.</p>
|
||||
<p class="text-sm text-green-700 font-semibold mb-6">Save $276 vs ordering separately</p>
|
||||
<a href="/order/dot-compliance?services=dot-full-compliance" class="inline-flex items-center gap-2 bg-orange-500 text-white font-bold px-8 py-3 rounded-lg hover:bg-orange-600 transition-colors shadow-lg">
|
||||
Get the Full Bundle →
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue