validate step for amibiguity resolution

This commit is contained in:
2026-05-29 16:29:40 +05:30
parent 08057f370c
commit baffd11a49

View File

@@ -65,7 +65,7 @@ function statusToActiveStep(status: FetchRequestStatus): number {
case "paused": return 2; case "paused": return 2;
case "raw_expenses_done": return 2; case "raw_expenses_done": return 2;
case "enriched_done": return 3; case "enriched_done": return 3;
case "completed": return 4; case "completed": return stepLabels.length;
case "failed": return 0; case "failed": return 0;
default: return -1; default: return -1;
} }
@@ -110,17 +110,15 @@ export default function FetchRequestDetail() {
const dicts = source?.txn_dicts ?? []; const dicts = source?.txn_dicts ?? [];
const blockCount = typeof blocks === "object" const blockCount = typeof blocks === "object"
? Object.keys(blocks).length : Array.isArray(blocks) ? blocks.length : 0; ? Object.keys(blocks).length : Array.isArray(blocks) ? blocks.length : 0;
if (blockCount || dicts.length) { if (blockCount)
const parts: string[] = []; msgs[1] = `${blockCount} blocks`;
if (blockCount) parts.push(`${blockCount} blocks`); if (dicts.length)
if (dicts.length) parts.push(`${dicts.length} dicts`); msgs[2] = `${dicts.length} dicts`;
msgs[1] = parts.join(" · ");
}
if (["enriched_done", "completed"].includes((fetchRequest as any)?.status)) if (["enriched_done", "completed"].includes((fetchRequest as any)?.status))
msgs[2] = "done"; msgs[3] = "done";
if ((fetchRequest as any)?.status === "completed") if ((fetchRequest as any)?.status === "completed")
msgs[3] = (fetchRequest as any)?.completed_at msgs[4] = (fetchRequest as any)?.completed_at
? new Date((fetchRequest as any).completed_at).toLocaleString() : "done"; ? new Date((fetchRequest as any).completed_at).toLocaleString() : "done";
return msgs; return msgs;