feat(healthcare): OIG/SAM exclusion screening as $79/mo Stripe Subscription

Convert OIG/SAM from one-time $299/yr to recurring $79/month (card+ACH only) -
the first real recurring-billing product in the system. Exclusion screening is
a *monthly* federal obligation, so recurring monitoring fits the requirement and
is the biggest valuation lever (vs a one-time annual run).

Catalog (single source of truth):
- service-catalog.ts: add billing_interval + allowed_methods to ComplianceService;
  oig-sam-screening -> 7900c, billing_interval:"month", allowed_methods:[card,ach],
  name "(Monthly Monitoring)".
- gen-service-catalog.py + check-service-catalog-drift.py: carry/guard the two new
  fields; regenerate site catalog.

Checkout (api/src/routes/checkout.ts):
- mode:"subscription" with recurring price_data when billing_interval is set;
  surcharge absorbed for recurring (clean $79/mo); server-side METHOD_NOT_ALLOWED
  re-validation against allowed_methods.
- ensureColumns + migration 100: compliance_orders.stripe_subscription_id,
  bundle_upsell_sent_at (+ subscription index).

Webhooks (api/src/routes/webhooks.ts):
- record stripe_subscription_id on checkout.session.completed (subscription mode).
- invoice.paid (subscription_cycle only) -> re-dispatch screening for the cycle;
  invoice.payment_failed -> admin alert + first-failure customer nudge;
  customer.subscription.deleted -> mark order cancelled. (API 2026-03-25 moved the
  subscription link to invoice.parent.subscription_details.subscription.)

Fulfillment:
- job_server.py: pass recurring_cycle/invoice_id into the order.
- npi_provider.py: OIG handler labels renewal cycles "[Monthly cycle]" + re-screen
  note; bundle action runs only the FIRST screening + flags the $79/mo upsell.

Bundle land-and-expand:
- Provider Compliance Bundle now includes only the first OIG/SAM screening (was
  giving away $948/yr of monitoring inside an $899 bundle).
- new worker scripts/workers/bundle_upsell.py (+ pw-bundle-upsell timer): ~3 weeks
  after a paid bundle, emails the customer to continue $79/mo monitoring; dedup via
  bundle_upsell_sent_at; skips customers who already have an OIG/SAM order.

Surfaces updated to $79/mo: PaymentStep (filters methods, "Billed every month,
cancel anytime"), order pages, healthcare index, npi-compliance-check tool (also
fixed stale $699 bundle drift -> $899), hc_oig_screening + hc_compliance_bundle
emails.

Docs: billing.md gains a "Stripe-native Subscriptions" section + a reality-check
banner (Adyen/ERPNext-gateway model documented there is NOT live; Stripe is the
real rail). Fixed run-migrations.yml container name bug
(performancewest-postgres-1 -> performancewest-api-postgres-1, overridable).

Tests: api/tests/recurring-subscription.test.ts (28 assertions) covers catalog
gating, method validation, surcharge suppression, recurring line-item build,
invoiceSubscriptionId extraction, renewal-cycle gating. tsc clean; site build
clean; catalog drift OK.

Manual deploy step: enable invoice.paid, invoice.payment_failed,
customer.subscription.deleted on the Stripe webhook endpoint.
This commit is contained in:
justin 2026-06-18 07:54:38 -05:00
parent f481a1d13c
commit cf021e2f91
21 changed files with 820 additions and 69 deletions

View file

@ -7,6 +7,21 @@ import { SERVICE_META, formatUSD, slugVertical } from "../../../lib/intake_manif
import CheckoutTrustBand from "../../CheckoutTrustBand.astro";
const meta = SERVICE_META[service_slug];
const vertical = slugVertical(service_slug);
// Recurring services (billing_interval) bill on a cycle and restrict methods to
// those that support off-session charges (allowed_methods). Filter the picker so
// customers never select a method the server will reject.
const ALL_METHODS = [
{ value: "card", label: "Credit / Debit card" },
{ value: "ach", label: "ACH (US bank)" },
{ value: "paypal", label: "PayPal" },
{ value: "klarna", label: "Klarna (pay over time)" },
{ value: "crypto", label: "Cryptocurrency" },
];
const allowed = meta?.allowed_methods;
const methods = allowed ? ALL_METHODS.filter(m => allowed.includes(m.value as any)) : ALL_METHODS;
const interval = meta?.billing_interval;
const intervalLabel = interval === "month" ? "month" : interval === "year" ? "year" : null;
---
<div class="pw-step" data-slug={service_slug}>
@ -23,17 +38,17 @@ const vertical = slugVertical(service_slug);
<span>Service</span><strong>{meta?.name ?? service_slug}</strong>
</div>
<div class="pw-total-line">
<span>Total</span><strong>{meta ? formatUSD(meta.price_cents) : "—"}</strong>
<span>{intervalLabel ? "Price" : "Total"}</span>
<strong>{meta ? (intervalLabel ? `${formatUSD(meta.price_cents)} / ${intervalLabel}` : formatUSD(meta.price_cents)) : "—"}</strong>
</div>
{intervalLabel && (
<p class="pw-recurring-note">Billed every {intervalLabel}. Cancel anytime.</p>
)}
</div>
<label class="pw-field">Payment method</label>
<select id="pw-pay-method" class="pw-input">
<option value="card">Credit / Debit card</option>
<option value="ach">ACH (US bank)</option>
<option value="paypal">PayPal</option>
<option value="klarna">Klarna (pay over time)</option>
<option value="crypto">Cryptocurrency</option>
{methods.map(m => <option value={m.value}>{m.label}</option>)}
</select>
<p class="pw-method-note">Click <strong>Finish</strong> below to continue with the selected method.</p>
@ -46,6 +61,7 @@ const vertical = slugVertical(service_slug);
.pw-help { color: #64748b; font-size: 0.9rem; margin-bottom: 1rem; }
.pw-total-box { background: #ecfdf5; border-left: 4px solid #059669; padding: 1rem 1.25rem; border-radius: 0 8px 8px 0; margin-bottom: 1.5rem; }
.pw-total-line { display: flex; justify-content: space-between; padding: 0.25rem 0; font-size: 1rem; }
.pw-recurring-note { margin: 0.4rem 0 0; color: #047857; font-size: 0.82rem; }
.pw-field { display: block; font-weight: 600; margin: 0.6rem 0 0.2rem; font-size: 0.88rem; }
.pw-input { width: 100%; padding: 0.5rem 0.7rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.93rem; }
.pw-method-note { margin: 0.75rem 0 0; color: #64748b; font-size: 0.9rem; }

View file

@ -12,6 +12,8 @@ export interface ServiceMeta {
name: string;
price_cents: number;
gov_fee_label?: string;
billing_interval?: "month" | "year";
allowed_methods?: ("card" | "ach" | "paypal" | "klarna" | "crypto")[];
}
export const SERVICE_META: Record<string, ServiceMeta> = {
@ -73,7 +75,7 @@ export const SERVICE_META: Record<string, ServiceMeta> = {
"nppes-update": { name: "NPPES Data Update / Attestation", price_cents: 34900 },
"ny-hut-registration": { name: "NY Highway Use Tax Registration", price_cents: 10900, gov_fee_label: "NY HUT certificate & decal fees (state, billed at cost)" },
"ocn-registration": { name: "NECA OCN + Sponsoring CLEC Agreement", price_cents: 265000 },
"oig-sam-screening": { name: "OIG/SAM Exclusion Screening (Annual)", price_cents: 29900 },
"oig-sam-screening": { name: "OIG/SAM Exclusion Screening (Monthly Monitoring)", price_cents: 7900, billing_interval: "month", allowed_methods: ["card", "ach"] },
"or-weight-mile-tax": { name: "Oregon Weight-Mile Tax Setup", price_cents: 10900, gov_fee_label: "Oregon weight-mile tax account & bond/deposit (state, billed at cost)" },
"osow-permit": { name: "Oversize/Overweight Permit", price_cents: 10900, gov_fee_label: "State oversize/overweight permit fees (per trip/route, billed at cost)" },
"provider-compliance-bundle": { name: "Provider Compliance Bundle (Annual)", price_cents: 89900 },

View file

@ -9,7 +9,7 @@ const slug = "oig-sam-screening";
const steps = INTAKE_MANIFEST[slug];
const meta = SERVICE_META[slug];
const title = meta ? `Order ${meta.name}` : "Order";
const description = "Annual OIG LEIE and SAM exclusion screening for you and your staff, with a compliance certificate.";
const description = "Monthly OIG LEIE and SAM exclusion screening for you and your staff, with an audit-ready compliance certificate each month. $79/month, cancel anytime.";
---
<Base title={title} description={description}>

View file

@ -9,7 +9,7 @@ const slug = "provider-compliance-bundle";
const steps = INTAKE_MANIFEST[slug];
const meta = SERVICE_META[slug];
const title = meta ? `Order ${meta.name}` : "Order";
const description = "Annual provider compliance bundle: revalidation monitoring, OIG/SAM screening, and NPPES upkeep in one package.";
const description = "Annual provider compliance bundle: revalidation monitoring & filing, NPPES upkeep, and your first OIG/SAM exclusion screening in one package.";
---
<Base title={title} description={description}>

View file

@ -40,13 +40,13 @@ const description = "We handle the federal paperwork that keeps providers billab
</a>
<a class="pw-card" href="/order/oig-sam-screening">
<h3>OIG / SAM Exclusion Screening</h3>
<p class="pw-card-price">$299 / year</p>
<p>Annual OIG LEIE and SAM exclusion screening for you and your staff, with a compliance certificate.</p>
<p class="pw-card-price">$79 / month</p>
<p>Monthly OIG LEIE and SAM exclusion screening for you and your staff, with an audit-ready certificate each cycle. Cancel anytime.</p>
</a>
<a class="pw-card" href="/order/provider-compliance-bundle">
<h3>Provider Compliance Bundle</h3>
<p class="pw-card-price">$899 / year</p>
<p>Revalidation monitoring, OIG/SAM screening, and NPPES upkeep in one annual package.</p>
<p>Revalidation monitoring, NPPES upkeep, and your first OIG/SAM screening in one annual package.</p>
</a>
</div>
</section>

View file

@ -120,7 +120,7 @@ import Base from "../../layouts/Base.astro";
const SERVICE_MAP = {
"npi-active": { name: "NPI Reactivation", price: 249, url: "/order/npi-reactivation" },
"revalidation": { name: "Medicare Revalidation Filing", price: 399, url: "/order/npi-revalidation" },
"exclusion": { name: "OIG/SAM Exclusion Screening", price: 99, url: "/order/oig-sam-screening" },
"exclusion": { name: "OIG/SAM Exclusion Screening", price: 79, suffix: "/mo", url: "/order/oig-sam-screening" },
"nppes-fresh": { name: "NPPES Data Update", price: 149, url: "/order/nppes-update" },
"optout": { name: "Medicare Enrollment (PECOS)", price: 499, url: "/order/medicare-enrollment" },
};
@ -329,22 +329,22 @@ import Base from "../../layouts/Base.astro";
for (const svc of services) {
html += `<a href="${svc.url}?npi=${npi}" class="flex items-center justify-between gap-3 p-3 rounded-lg border border-gray-200 hover:bg-teal-50 hover:border-teal-300 transition cursor-pointer" style="text-decoration:none;color:inherit;">
<span class="font-medium text-gray-900">${svc.name}</span>
<span class="font-semibold text-teal-700 whitespace-nowrap">$${svc.price} &rarr;</span>
<span class="font-semibold text-teal-700 whitespace-nowrap">$${svc.price}${svc.suffix || ""} &rarr;</span>
</a>`;
}
html += `</div>`;
html += `<div class="mt-5 text-center">
<a href="/order/provider-compliance-bundle?npi=${npi}" style="background:#0f766e;color:#fff;font-weight:700;padding:12px 28px;border-radius:8px;display:inline-block;font-size:15px;text-decoration:none;">
Get the Provider Compliance Bundle ($699/yr) &rarr;
Get the Provider Compliance Bundle ($899/yr) &rarr;
</a>
<p style="font-size:11px;color:#6b7280;margin-top:8px;">Revalidation monitoring, screening, and NPPES upkeep in one package.</p>
<p style="font-size:11px;color:#6b7280;margin-top:8px;">Revalidation monitoring, NPPES upkeep, and your first OIG/SAM screening in one package.</p>
</div>`;
ctaContent.innerHTML = html;
} else {
ctaContent.innerHTML = `<h3 class="text-lg font-bold text-green-800 mb-2">Looking good &mdash; all checks passed</h3>
<p class="text-sm text-gray-600 mb-4">Your NPI and Medicare records appear current. No action is needed right now.</p>
<a href="/order/oig-sam-screening?npi=${data.npi}" class="inline-block bg-teal-600 hover:bg-teal-700 text-white font-semibold px-5 py-2 rounded-lg text-sm transition" style="text-decoration:none;">
Add annual OIG/SAM screening &mdash; $99/yr
Add monthly OIG/SAM screening &mdash; $79/mo
</a>`;
}
}