corp-check tool: show annual-report-overdue for active-but-overdue entities

The tool treated any ACTIVE entity as 'good standing, no action' - so an
overdue-but-active CT business (the CT campaign's target) saw a false all-clear.
Now: overdue-but-active -> 'REPORT OVERDUE' badge + past-due message with the
due date + days overdue + cost-to-fix, matching the corp-status API signal.
This commit is contained in:
justin 2026-07-01 08:42:13 -05:00
parent 42a7beb655
commit d40458057b

View file

@ -164,8 +164,11 @@ function doCheck() {
function renderResult(data, state) {
var status = (data.status || "UNKNOWN").toUpperCase();
var isGood = status === "ACTIVE";
var isBad = status === "DELINQUENT" || status === "SUSPENDED" || status === "DISSOLVED" || status === "INACTIVE";
// An entity's annual report can be past due even while the state still lists it
// ACTIVE (e.g. CT). Treat overdue-but-active as "needs action", not good standing.
var overdue = !!data.annual_report_overdue;
var isGood = status === "ACTIVE" && !overdue;
var isBad = status === "DELINQUENT" || status === "SUSPENDED" || status === "DISSOLVED" || status === "INACTIVE" || (status === "ACTIVE" && overdue);
var borderColor = isGood ? "border-green-200" : isBad ? "border-red-200" : "border-gray-200";
var bgColor = isGood ? "bg-green-50" : isBad ? "bg-red-50" : "bg-gray-50";
@ -179,7 +182,7 @@ function renderResult(data, state) {
if (data.entity_number) html += '<p class="text-xs text-gray-400 font-mono mt-1">Filing #: ' + data.entity_number + '</p>';
if (data.formation_date) html += '<p class="text-xs text-gray-400 mt-0.5">Formed: ' + data.formation_date + '</p>';
html += '</div>';
html += '<span class="px-3 py-1 rounded-full text-sm font-bold ' + statusColor + '">' + status + '</span>';
html += '<span class="px-3 py-1 rounded-full text-sm font-bold ' + statusColor + '">' + ((status === "ACTIVE" && overdue) ? "REPORT OVERDUE" : status) + '</span>';
html += '</div>';
if (isGood) {
@ -192,12 +195,18 @@ function renderResult(data, state) {
html += '</div>';
} else if (isBad) {
html += '<div class="space-y-3">';
if (data.years_behind > 0) {
if (status === "ACTIVE" && overdue) {
var od = (data.annual_report_days_overdue != null) ? data.annual_report_days_overdue : null;
html += '<p class="text-sm text-red-800 font-medium">Your annual report is past due'
+ (data.annual_report_due_date ? ' (was due ' + data.annual_report_due_date + (od != null ? ', ' + od + ' days ago' : '') + ')' : '')
+ '.</p>';
html += '<p class="text-sm text-red-800">Your business is still active, but an unfiled annual report can cost you good standing and, if it keeps lapsing, lead to administrative dissolution. File it now to stay clear.</p>';
} else if (data.years_behind > 0) {
html += '<p class="text-sm text-red-800 font-medium">You are ' + data.years_behind + ' year' + (data.years_behind > 1 ? 's' : '') + ' behind on annual reports.</p>';
}
if (status === "DISSOLVED") {
html += '<p class="text-sm text-red-800">This entity has been administratively dissolved. Reinstatement is required to restore good standing.</p>';
} else {
} else if (!(status === "ACTIVE" && overdue)) {
html += '<p class="text-sm text-red-800">File your overdue annual report(s) to return to good standing before the state administratively dissolves your entity.</p>';
}