new-site/scripts/workers/services
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
..
telecom fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
__init__.py mcs150: enrich intake from FMCSA carrier census before PDF fill 2026-06-10 12:35:52 -05:00
base_handler.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
bdc_filing.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
boc3_filing.py fix: worker emails (localhost:25 -> SMTP relay) + create ERPNext SO on webhook payment 2026-06-09 14:40:46 -05:00
boc3_playwright.py BOC-3: use relay_integration.load_card_from_erpnext() for proper card matching 2026-05-30 22:46:52 -05:00
breach_response.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
calea_ssi.py Fix MinioStorage.upload_file → .upload + suppress instant delivery during eSign pause 2026-05-04 10:59:45 -05:00
campaign_review.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
canada_crtc.py crtc: remove Canadian accountant/accounting-setup service (no longer offered) 2026-06-10 16:51:33 -05:00
carrier_closeout.py Wire fulfillment alerts to Telegram + surface order progress in portal + even out ERPNext sync 2026-06-07 03:17:46 -05:00
ccpa_audit.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_analysis.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cdr_storage_tier.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
consent_audit.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
contractor_review.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cores_frn_registration.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
cpni_certification.py Fix MinioStorage.upload_file → .upload + suppress instant delivery during eSign pause 2026-05-04 10:59:45 -05:00
dc_agent.py Fix MinioStorage.upload_file → .upload + suppress instant delivery during eSign pause 2026-05-04 10:59:45 -05:00
dnc_review.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
dot_drug_alcohol.py DOT D&A binder: add driver enrollment guidance + Form G roster 2026-06-02 21:39:50 -05:00
dot_esign.py fix: worker emails (localhost:25 -> SMTP relay) + create ERPNext SO on webhook payment 2026-06-09 14:40:46 -05:00
ein_application.py Wire fulfillment alerts to Telegram + surface order progress in portal + even out ERPNext sync 2026-06-07 03:17:46 -05:00
esign_stamp.py trucking: stamp e-signature exactly on form signature lines + state authorization gate 2026-06-02 16:44:19 -05:00
fcc_carrier_registration.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
fcc_compliance_checkup.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fcc_full_compliance.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
flowroute.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
flsa_audit.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fmcsa_web_submitter.py add dev mode guards: skip FMCSA submission, fax, and web filing in non-production environments 2026-05-30 22:28:59 -05:00
foreign_carrier_affiliation.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
foreign_qualification.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
form_499_initial.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
form_499a.py Fix MinioStorage.upload_file → .upload + suppress instant delivery during eSign pause 2026-05-04 10:59:45 -05:00
form_499a_discontinuance.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
form_499q.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
gov_fee.py feat(sc-coc): SCDMV Certificate of Compliance PDF filler + correct $25 state fee 2026-06-16 09:08:50 -05:00
handbook_review.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
hazmat_phmsa.py fix: worker emails (localhost:25 -> SMTP relay) + create ERPNext SO on webhook payment 2026-06-09 14:40:46 -05:00
ink_signature_plotter.py mcs150: enrich intake from FMCSA carrier census before PDF fill 2026-06-10 12:35:52 -05:00
intrastate_filing.py feat(intrastate): automate state PUC/PSC authority filing (email + invoice + auto-bill) 2026-06-16 07:57:57 -05:00
irp_filing.py feat(intrastate): automate state PUC/PSC authority filing (email + invoice + auto-bill) 2026-06-16 07:57:57 -05:00
mailbox_setup.py fix: worker emails (localhost:25 -> SMTP relay) + create ERPNext SO on webhook payment 2026-06-09 14:40:46 -05:00
mcs150_update.py fix(mcs150): point intake email to per-slug wizard (not sales page) + add Trailers field 2026-06-16 16:21:57 -05:00
new_carrier_bundle.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
npi_provider.py feat(healthcare): OIG/SAM exclusion screening as $79/mo Stripe Subscription 2026-06-18 07:54:38 -05:00
ocn_registration.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
porkbun.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
privacy_policy.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
renewal_handler.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
rmd_filing.py fix(email): add text/plain part to every transactional + telecom email 2026-06-17 21:07:40 -05:00
sc_coc_filing.py tweak(sc-coc): tell carrier to check with insurer before answering + Reply-To info@ 2026-06-16 09:35:13 -05:00
signature_stamper.py trucking: stamp e-signature exactly on form signature lines + state authorization gate 2026-06-02 16:44:19 -05:00
state_puc_filing.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
state_trucking.py feat(sc-coc): SC intrastate Certificate of Compliance flow (insurance gate -> $25 fee -> file) 2026-06-16 09:15:55 -05:00
state_trucking_authorization.py trucking: stamp e-signature exactly on form signature lines + state authorization gate 2026-06-02 16:44:19 -05:00
stir_shaken.py Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
ucr_playwright.py feat(ucr): Playwright auto-filing for UCR registration on approval 2026-06-16 03:29:05 -05:00