diff --git a/api/src/routes/admin.ts b/api/src/routes/admin.ts index 4a3b2e6..1fa0fad 100644 --- a/api/src/routes/admin.ts +++ b/api/src/routes/admin.ts @@ -611,6 +611,18 @@ router.post("/api/v1/admin/compliance-orders/:order_number/rearm-intake", requir const WORKER_URL_ADMIN = process.env.WORKER_URL || "http://workers:8090"; +// Slugs that actually generate an MCS-150 PDF (mirrors MCS150_FORM_SLUGS in +// scripts/workers/services/mcs150_update.py). Other admin-assisted DOT services +// routed to the same handler (UCR, MC authority, audit prep, ETA, etc.) never +// produce that form, even though the shared filing_status carries a phantom +// pdf_minio_path. +const FORM_PRODUCING_SLUGS = new Set([ + "mcs150-update", + "dot-registration", + "usdot-reactivation", + "dot-full-compliance", +]); + /** Ask the worker for a presigned (internal minio:9000) GET URL. */ async function presignInternal(key: string): Promise { if (!key) return null; @@ -641,16 +653,24 @@ async function collectOrderDocuments(orderNumber: string): Promise; const fs = (intake.filing_status && typeof intake.filing_status === "object" ? intake.filing_status : {}) as Record; - add("Prepared filing PDF", fs.pdf_minio_path); - add("Attested PDF (faxed)", fs.attested_pdf); + // The shared dot-compliance-remediation pipeline seeds a filing_status with a + // template pdf_minio_path on EVERY order in a batch, but only services that + // actually produce an MCS-150 form ever generate that PDF. For admin-assisted + // services (UCR, MC authority, audit prep, etc.) it's a phantom that never + // exists, so only surface the prepared-filing artifacts for form producers. + if (FORM_PRODUCING_SLUGS.has(slug)) { + add("Prepared filing PDF", fs.pdf_minio_path); + add("Attested PDF (faxed)", fs.attested_pdf); + } add("Confirmation screenshot", fs.screenshot_path); if (fs.evidence && typeof fs.evidence === "object") { for (const [k, v] of Object.entries(fs.evidence as Record)) { diff --git a/site/public/admin/compliance-orders/index.html b/site/public/admin/compliance-orders/index.html index 9eb946b..4c9abd2 100644 --- a/site/public/admin/compliance-orders/index.html +++ b/site/public/admin/compliance-orders/index.html @@ -393,7 +393,7 @@ try { const { documents } = await api("/api/v1/admin/compliance-orders/" + encodeURIComponent(orderNumber) + "/documents"); if (!documents || !documents.length) { - box.innerHTML = '
No documents on file yet.
'; + box.innerHTML = '
No documents on file. Admin-assisted services (e.g. UCR, MC authority) are filed manually and have no generated form; form-based filings appear here once intake is complete.
'; return; } // Stream endpoint takes the JWT via ?token= so it opens in a new tab.