From ada9e013212c046b557bb71da8829656ae9ea656 Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 8 Jun 2026 00:36:41 -0500 Subject: [PATCH] checkout(healthcare): collapse + reposition surrogate how-to when not granted The order confirmation asked providers to optionally grant CMS I&A Surrogate access, then showed the full how-to to everyone high up. Now it respects their intake answer: - Granted (surrogate_access=yes): keep the how-to prominent up top so they can complete the step they chose. - Not granted / undecided: top block just confirms 'we're handling it, nothing else to do' (no nagging); the speed-it-up how-to moves lower and is collapsed behind a 'Show me how'
expander (still available, just out of the way). --- api/src/routes/checkout.ts | 69 ++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 17 deletions(-) diff --git a/api/src/routes/checkout.ts b/api/src/routes/checkout.ts index b1bd421..7afae6d 100644 --- a/api/src/routes/checkout.ts +++ b/api/src/routes/checkout.ts @@ -2271,21 +2271,14 @@ export async function sendComplianceIntakeEmail( // us (fewer steps, lets us bulk-file). We never ask for their password. const npiConfirmUrl = `${SITE_DOMAIN}/order/success?action=ia_surrogacy&order_id=${orderId}`; - const npiSection = hasNpiAccess ? ` -
-

We're handling your filing

-

- You're all set — we prepare and submit your filing and track it to - confirmation. The only thing we may need from you is a quick signature on - a secure link we'll send. Nothing to set up. -

-

Optional: speed it up

-

- If you can electronically grant us CMS I&A Surrogate access, - we can file faster — it cuts steps on our end and lets us process your - filing right away. You never share your password; you simply authorize us - as a Surrogate for your NPI. -

+ // Did the provider opt in to granting CMS I&A Surrogate access on the intake + // form? If yes, surface the how-to prominently (it confirms the step they + // committed to). If no / undecided, we still make it available, but collapsed + // behind a "Show me how" expander and placed lower so it doesn't nag someone + // who already chose to let us handle everything. + const grantedSurrogate = String(intake.surrogate_access || "").toLowerCase() === "yes"; + + const surrogateSteps = `
  1. Log in to CMS Identity & Access (I&A)
  2. Go to My Connections → Add Surrogate
  3. @@ -2296,11 +2289,51 @@ export async function sendComplianceIntakeEmail( I've granted surrogate access → +

    `; + + const npiSection = !hasNpiAccess ? "" : grantedSurrogate ? ` +
    +

    We're handling your filing

    +

    + You're all set — we prepare and submit your filing and track it to + confirmation. The only thing we may need from you is a quick signature on + a secure link we'll send.

    +

    You chose to grant Surrogate access — here's how (takes ~2 minutes)

    +

    + This lets us file faster. You never share your password; you simply + authorize us as a Surrogate for your NPI. +

    + ${surrogateSteps}

    - Can't do this step? No problem — we'll handle your filing without it. - There's nothing else you need to do. + Changed your mind? No problem — we'll handle your filing without it.

    +
    ` : ` +
    +

    We're handling your filing

    +

    + You're all set — we prepare and submit your filing and track it to + confirmation. The only thing we may need from you is a quick signature on + a secure link we'll send. Nothing else to do. +

    +
    `; + + // Optional speed-up block, shown lower in the email ONLY when they didn't + // already grant access. Collapsed behind a "Show me how" expander. + const npiSpeedupSection = (hasNpiAccess && !grantedSurrogate) ? ` +
    +

    Optional: want it filed even faster?

    +

    + If you can electronically grant us CMS I&A Surrogate access, + we can process your filing right away. It's never required — we'll file + it for you either way, at the same price. You never share your password. +

    +
    + Show me how → +
    + ${surrogateSteps} +
    +
    ` : ""; // Fully admin-assisted services with NO customer intake form. State-level @@ -2388,6 +2421,8 @@ export async function sendComplianceIntakeEmail( ${intakeSection} + ${npiSpeedupSection} +

    What to Expect

    ${isDotOnly ? `

    1. Our team is already working on your filing.