new-site/api/src/routes
justin 8af2685d07 fix(webhooks): read invoice.subscription in both API shapes (acacia + dahlia)
The live Stripe webhook endpoint has NO pinned api_version, so it follows the
account default (currently 2024-12-18.acacia), which delivers the subscription
link as the top-level invoice.subscription. The code only read the new
2026-03-25.dahlia shape (invoice.parent.subscription_details.subscription), so
recurring renewal/payment-failed events would have returned a null subscription
id and silently failed to fulfill once the events were enabled.

invoiceSubscriptionId() now reads the modern shape first, then falls back to the
legacy top-level field. All other invoice fields used by the handlers
(amount_due, attempt_count, hosted_invoice_url, id) are stable across both
versions. +5 tests (legacy string/object, modern-preferred-over-legacy).
2026-06-18 08:42:29 -05:00
..
admin-crypto.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
admin.ts admin: mark-filed action to advance manual/admin-assisted orders to completed 2026-06-16 03:12:57 -05:00
agents.ts Allow multiple referral codes per sales agent 2026-06-02 14:44:22 -05:00
amb-locations.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
bundles.ts Rename 'IPES & ISP Registrations' to 'FCC Carrier / ISP Registration' 2026-04-29 08:06:47 -05:00
canada-crtc.ts CRTC: ERPNext as portal source of truth + harden discount expiry + carrier guide PDF 2026-06-17 23:34:13 -05:00
cdr.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
checkout.ts feat(healthcare): OIG/SAM exclusion screening as $79/mo Stripe Subscription 2026-06-18 07:54:38 -05:00
compliance-orders.ts feat(sc-coc): SC intrastate Certificate of Compliance flow (insurance gate -> $25 fee -> file) 2026-06-16 09:15:55 -05:00
corp-status.ts Fix corp search LIMIT type: cast to int 2026-04-28 23:05:43 -05:00
discounts.ts Fix: add allowed_emails to DiscountCode TypeScript interface 2026-05-22 01:19:12 -05:00
dot-lookup.ts mcs150: census-prefilled intake-completion flow + completeness gate 2026-06-10 14:03:28 -05:00
entities.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
esign-sign-consent.ts esign: make signing copy fully generic - remove all ink references from website/API 2026-06-07 05:06:26 -05:00
fcc-carrier-registration.ts Add referral/discount code to FCC carrier page + REF-JAYK05 agent 2026-06-02 14:31:22 -05:00
fcc-filings.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fcc-lookup.ts Fix: FCC errors now fall through to local DB fallback 2026-05-22 00:42:43 -05:00
foreign-qualification.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
formations.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
health.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
icc.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
id-upload.ts add blur detection + Ollama ID validation + corporate check for all carriers 2026-05-30 19:17:31 -05:00
identity.ts Fix 6 bugs found in compliance and checkout flows 2026-04-27 09:56:12 -05:00
ifta.ts ucr: annual-renewal reminder campaign + order-alert campaign source 2026-06-14 00:30:23 -05:00
lnpa-regions.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
npi-lookup.ts feat(healthcare): prove revalidation is real via official CMS data + self-verify 2026-06-07 23:54:01 -05:00
order-timeline-status.ts Wire fulfillment alerts to Telegram + surface order progress in portal + even out ERPNext sync 2026-06-07 03:17:46 -05:00
order-timeline.ts esign: make signing copy fully generic - remove all ink references from website/API 2026-06-07 05:06:26 -05:00
payment-methods.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
paypal.ts Fix PayPal capture for compliance orders + MCS-150 form generator 2026-05-30 11:34:16 -05:00
portal-auth.ts auth: make ERPNext the single source of truth for customer passwords 2026-06-17 10:09:32 -05:00
portal-esign-generic.ts esign: make signing copy fully generic - remove all ink references from website/API 2026-06-07 05:06:26 -05:00
portal-esign.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
portal-rmd-review.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
portal-setup.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
portal.ts Wire fulfillment alerts to Telegram + surface order progress in portal + even out ERPNext sync 2026-06-07 03:17:46 -05:00
puc.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
quotes.ts Add Telegram notifications for tickets, quotes, and insurance leads 2026-05-30 16:35:11 -05:00
refunds.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
reseller-certs.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
subscribe.ts Add interest field to mailing list subscribe (telecom/trucking/formation) 2026-05-29 12:50:27 -05:00
survey.ts post-completion flow: survey, referral program, review ask 2026-05-30 21:22:14 -05:00
telecom-entities.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
tickets.ts trucking wrap-up: close-out becomes a paid order + workflow 2026-05-31 01:01:02 -05:00
webhooks.ts fix(webhooks): read invoice.subscription in both API shapes (acacia + dahlia) 2026-06-18 08:42:29 -05:00