Rework 499-A questions into two-step flow

Step 1: "Did ENTITY provide and bill for telecom services?"
  - Yes → red, filing required for each missed year
  - No → Step 2 follow-up

Step 2: "Does ENTITY plan to provide telecom services going forward?"
  - Yes, keep active → yellow, zero-revenue 499-A filings needed
  - No, cancel → yellow, catch-up filings + USAC cancellation

Fixes: white-on-red button visibility, removes confusing 3-way
choice, uses inline styles for button colors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-04-27 20:52:03 -05:00
parent edf81765ac
commit 1a27fd7913

View file

@ -506,12 +506,11 @@ import Base from "../../layouts/Base.astro";
// 499-A special — ask qualifying questions when past due // 499-A special — ask qualifying questions when past due
if (check.id === "form_499a" && (status === "red" || status === "yellow")) { if (check.id === "form_499a" && (status === "red" || status === "yellow")) {
inner += `<div class="mt-3 border-t border-red-200 pt-3"> inner += `<div class="mt-3 border-t border-red-200 pt-3 f499-q1">
<p class="text-sm font-medium ${c.textColor} mb-2">Did ${eName} provide and bill customers for voice or data telecom services during the overdue filing period(s)?</p> <p class="text-sm font-medium ${c.textColor} mb-2">Did ${eName} provide and bill customers for voice or data telecom services during the overdue filing period(s)?</p>
<div class="flex gap-2 flex-wrap"> <div class="flex gap-2">
<button class="f499-yes bg-red-500 hover:bg-red-600 text-white text-sm font-semibold px-4 py-1.5 rounded-lg transition">Yes — need to file</button> <button class="f499-yes" style="background:#ef4444;color:#fff;font-weight:600;padding:6px 16px;border-radius:8px;border:none;cursor:pointer;font-size:13px;">Yes — had telecom revenue</button>
<button class="f499-no bg-amber-500 hover:bg-amber-600 text-white text-sm font-semibold px-4 py-1.5 rounded-lg transition">No — no telecom revenue</button> <button class="f499-no" style="background:#f59e0b;color:#fff;font-weight:600;padding:6px 16px;border-radius:8px;border:none;cursor:pointer;font-size:13px;">No — no telecom revenue</button>
<button class="f499-cancel bg-gray-500 hover:bg-gray-600 text-white text-sm font-semibold px-4 py-1.5 rounded-lg transition">Cancel 499 registration</button>
</div> </div>
</div>`; </div>`;
} }
@ -606,58 +605,67 @@ import Base from "../../layouts/Base.astro";
// 499-A button handlers // 499-A button handlers
if (check.id === "form_499a" && (status === "red" || status === "yellow")) { if (check.id === "form_499a" && (status === "red" || status === "yellow")) {
function setF499Status(action) { function resetF499() {
const c = action === "file" ? colorMap.red : (action === "zero" ? colorMap.yellow : colorMap.yellow); check.status = status;
card.className = `${c.bg} ${c.border} border rounded-xl p-4 flex items-start gap-3`;
if (action === "file") {
// Keep red — they need to file
card.innerHTML = `<div class="${c.iconColor} mt-0.5 flex-shrink-0">${icons.red}</div>
<div class="flex-1">
<p class="font-semibold ${c.textColor}">${check.label}</p>
<p class="text-sm ${c.textColor} mt-1">${check.detail}</p>
<p class="text-sm ${c.textColor} mt-1 font-medium">${eName} had telecom revenue — filing is required for each missed year.</p>
<button class="f499-undo text-xs underline ${c.textColor} mt-1 opacity-75">Change answer</button>
</div>`;
} else if (action === "zero") {
// Had no revenue — still need to file a zero-revenue 499-A
check.status = "yellow";
const cy = colorMap.yellow;
card.className = `${cy.bg} ${cy.border} border rounded-xl p-4 flex items-start gap-3`;
card.innerHTML = `<div class="${cy.iconColor} mt-0.5 flex-shrink-0">${icons.yellow}</div>
<div class="flex-1">
<p class="font-semibold ${cy.textColor}">${check.label}</p>
<p class="text-sm ${cy.textColor} mt-1">Even with zero telecom revenue, a 499-A must be filed for each year you held an active filer ID. We can file zero-revenue returns for you.</p>
<button class="f499-undo text-xs underline ${cy.textColor} mt-1 opacity-75">Change answer</button>
</div>`;
} else if (action === "cancel") {
// Wants to cancel registration
check.status = "yellow";
const cy = colorMap.yellow;
card.className = `${cy.bg} ${cy.border} border rounded-xl p-4 flex items-start gap-3`;
card.innerHTML = `<div class="${cy.iconColor} mt-0.5 flex-shrink-0">${icons.yellow}</div>
<div class="flex-1">
<p class="font-semibold ${cy.textColor}">${check.label}</p>
<p class="text-sm ${cy.textColor} mt-1">To cancel your USAC filer registration, all outstanding 499-A filings must be current first (including zero-revenue returns). We can handle the catch-up filings and submit the cancellation request to USAC on your behalf.</p>
<button class="f499-undo text-xs underline ${cy.textColor} mt-1 opacity-75">Change answer</button>
</div>`;
}
card.querySelector(".f499-undo")?.addEventListener("click", () => {
check.status = status; // restore original
const cr = colorMap[status]; const cr = colorMap[status];
card.className = `${cr.bg} ${cr.border} border rounded-xl p-4 flex items-start gap-3`; card.className = `${cr.bg} ${cr.border} border rounded-xl p-4 flex items-start gap-3`;
card.innerHTML = inner; card.innerHTML = inner;
card.querySelector(".f499-yes")?.addEventListener("click", () => setF499Status("file")); attachF499Handlers();
card.querySelector(".f499-no")?.addEventListener("click", () => setF499Status("zero"));
card.querySelector(".f499-cancel")?.addEventListener("click", () => setF499Status("cancel"));
renderCta(lastData);
});
renderCta(lastData); renderCta(lastData);
} }
card.querySelector(".f499-yes")?.addEventListener("click", () => setF499Status("file"));
card.querySelector(".f499-no")?.addEventListener("click", () => setF499Status("zero")); function showF499Result(msg, newStatus) {
card.querySelector(".f499-cancel")?.addEventListener("click", () => setF499Status("cancel")); check.status = newStatus;
const cm = colorMap[newStatus];
card.className = `${cm.bg} ${cm.border} border rounded-xl p-4 flex items-start gap-3`;
card.innerHTML = `<div class="${cm.iconColor} mt-0.5 flex-shrink-0">${icons[newStatus]}</div>
<div class="flex-1">
<p class="font-semibold ${cm.textColor}">${check.label}</p>
<p class="text-sm ${cm.textColor} mt-1">${msg}</p>
<button class="f499-undo text-xs underline ${cm.textColor} mt-1 opacity-75">Change answer</button>
</div>`;
card.querySelector(".f499-undo")?.addEventListener("click", resetF499);
renderCta(lastData);
}
function showFollowUp() {
// Follow-up: do they plan to provide telecom services going forward?
const q1 = card.querySelector(".f499-q1");
if (q1) q1.style.display = "none";
const followUp = document.createElement("div");
followUp.className = "mt-3 border-t border-amber-200 pt-3";
followUp.innerHTML = `
<p class="text-sm font-medium text-amber-800 mb-2">Does ${eName} plan to provide telecom services going forward?</p>
<div class="flex gap-2">
<button class="f499-keep" style="background:#f59e0b;color:#fff;font-weight:600;padding:6px 16px;border-radius:8px;border:none;cursor:pointer;font-size:13px;">Yes — keep registration active</button>
<button class="f499-deregister" style="background:#6b7280;color:#fff;font-weight:600;padding:6px 16px;border-radius:8px;border:none;cursor:pointer;font-size:13px;">No — cancel registration</button>
</div>`;
card.querySelector(".flex-1")?.appendChild(followUp);
followUp.querySelector(".f499-keep")?.addEventListener("click", () => {
showF499Result(
`${eName} had no telecom revenue but wants to keep the filer registration active. A zero-revenue 499-A must be filed for each year with an active filer ID. We can file these for you.`,
"yellow"
);
});
followUp.querySelector(".f499-deregister")?.addEventListener("click", () => {
showF499Result(
`${eName} wants to cancel the USAC filer registration. All outstanding 499-A filings must be current first (including zero-revenue returns). We can handle the catch-up filings and submit the cancellation request to USAC on your behalf.`,
"yellow"
);
});
}
function attachF499Handlers() {
card.querySelector(".f499-yes")?.addEventListener("click", () => {
showF499Result(
`${check.detail}\n${eName} had telecom revenue — filing is required for each missed year.`,
"red"
);
});
card.querySelector(".f499-no")?.addEventListener("click", showFollowUp);
}
attachF499Handlers();
} }
checksContainer.appendChild(card); checksContainer.appendChild(card);