new-site/scripts/workers
justin cf021e2f91 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.
2026-06-18 07:54:38 -05:00
..
cdr_adapters Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_presets Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_transports Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
crypto_offramp Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
icc_adapters Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
services feat(healthcare): OIG/SAM exclusion screening as $79/mo Stripe Subscription 2026-06-18 07:54:38 -05:00
__init__.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
access_stim_monitor.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
amb_location_scraper.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
base_worker.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
binder_compiler.py Add Canadian Wholesale Vendor Reference Guide to CRTC binder 2026-05-27 11:11:47 -05:00
bundle_upsell.py feat(healthcare): OIG/SAM exclusion screening as $79/mo Stripe Subscription 2026-06-18 07:54:38 -05:00
business_days.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
campaign_helpers.py CRTC USF campaign: shared campaign_helpers + Q3 38.8% USF email builder 2026-06-17 23:40:01 -05:00
cdr_classifier.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_ingester.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_npa_importer.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_puller.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_retention_sweeper.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_sftpgo_provisioner.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_unlock_nudge.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
client_email_processor.py add FMCSA confirmation email monitor: IMAP watcher links confirmations to orders, Telegram notify 2026-05-30 19:01:42 -05:00
cold_wallet_sweeper.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
commission_worker.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
completion_emails.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
compliance_alert_list.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
conversation_monitor.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
convert_guides.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
create_campaigns.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
create_campaigns_p2.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
create_compliance_campaign.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
create_crtc_usf_campaign.py CRTC USF email: defensible framing + conversational-voice caveat 2026-06-18 00:20:44 -05:00
crypto_payment_worker.py chore(email): decommission SMTP2GO references — local MTA only 2026-06-17 22:46:59 -05:00
daily_paper_batch.py healthcare: verify CMS-10114 update path, correct NPI Enumerator address, build CMS-10114 filler 2026-06-07 02:04:41 -05:00
delivery_worker.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
deminimis_factor_check.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
email_verifier.py fix(verifier): mx_unreachable was mislabeling live big-ISP mailboxes 2026-06-17 05:48:08 -05:00
entity_scraper.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
erpnext_client.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fax_sender.py add dev mode guards: skip FMCSA submission, fax, and web filing in non-production environments 2026-05-30 22:28:59 -05:00
fcc_499_filer_import.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fcc_499_filer_scraper.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fcc_cores_scraper.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fcc_rmd_auditor.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fcc_rmd_removed_scraper.py Fix long-running PG transactions in RMD scrapers 2026-05-03 04:13:33 -05:00
fcc_rmd_scraper.py Fix long-running PG transactions in RMD scrapers 2026-05-03 04:13:33 -05:00
fix_349.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fix_campaigns.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fl_entity_downloader.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
flag_outside_counsel.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fmcsa_census_downloader.py Fix census download crash at 100K: integer out of range 2026-05-30 13:41:24 -05:00
fmcsa_deficiency_flagger.py Fix state list import: use individual subscriber creates instead of bulk 2026-05-29 14:26:44 -05:00
fmcsa_enrichment.py FMCSA enrichment: OOS orders bulk download + authority/insurance API lookup 2026-05-30 14:46:40 -05:00
fmcsa_source_refresh.py trucking: weekly FMCSA source refresh so new non-compliant carriers are caught 2026-06-17 20:44:54 -05:00
gckey_provisioner.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
hestia_provisioner.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
icc_ingester.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
ink_signature_cli.py Add portable Line-us pen-arm support to ink-signature pipeline 2026-06-07 03:45:46 -05:00
intake_reminder.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
irp_invoice_poller.py feat(govfee): exact fees + agency processing fees; IRP email/invoice reconciliation 2026-06-16 04:58:14 -05:00
job_server.py feat(healthcare): OIG/SAM exclusion screening as $79/mo Stripe Subscription 2026-06-18 07:54:38 -05:00
listmonk_import.py legal: permanent do-not-contact for dataspindle.com + close re-import gap 2026-06-11 13:24:10 -05:00
mac_routing.py healthcare: verify CMS-10114 update path, correct NPI Enumerator address, build CMS-10114 filler 2026-06-07 02:04:41 -05:00
payment_reminder.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
pipeline_orchestrator.py fix(checkout): route dot-new-carrier-bundle on success page + worker pipeline 2026-06-08 23:48:56 -05:00
quarterly_499q_notify.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
relay_deposit_monitor.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
relay_integration.py fix(relay): logging.getenv -> crash on import (card loading was broken) 2026-06-16 03:30:40 -05:00
remove_adversary_subscribers.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
renewal_worker.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
rmd_deficiency_campaign.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
swap_discount_to_4pay.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
telegram_notify.py feat(telegram): include a presigned PDF view link in the admin-review alert 2026-06-10 12:13:43 -05:00
update_campaign_ctas.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
usac_audit_scraper.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
usac_import.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
usf_factor_monitor.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
worker_email.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
wy_entity_scraper.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00