BREAKING main #5 / 43
aaronrene · 4 days ago · Jun 3, 2026 · Diff

Add admin billing repair endpoint with 7-tier tests

POST /api/v1/admin/billing/repair lets an admin directly write tier and Stripe linkage fields to the billing DB, recovering from missed or unprocessable Stripe webhook deliveries (e.g. webhook pointed at old URL, checkout session never recorded user_id, billing DB empty on new deploy).

Auth: Bearer JWT + HUB_ADMIN_USER_IDS allowlist. Accepts tier, stripe_subscription_id, stripe_customer_id. Logs before→after.

Also adds MONTHLY_INCLUDED_CENTS_BY_TIER import and try/catch around mutateBillingDb to prevent Express from hanging on concurrent write errors.

28 tests across all 7 tiers: unit, integration, e2e, stress, data-integrity, performance, security.

sha256:75b9b3ba09df2ea3ca5f64ae1b823c3b157771ef12447a0fc89b806d9e9ea050 sha
+8 symbols
2 changed · 708 in snapshot files
sha256:d129b1cca6cfb948d17d574a3658cf0701f7c7c74ca64abd2e2d3c27bbd3c014 snapshot
+8
symbols added
2
files changed
708
files in snapshot
0
dead code introduced
Semantic Changes 8 symbols
+ adminToken function function adminToken L38–38
+ createGateway function async_function createGateway L60–71
+ get function async_function get L126–143
+ makeJwt function function makeJwt L28–36
+ memberToken function function memberToken L39–39
+ post function async_function post L74–97
+ postClose function async_function postClose L100–124
+ startServer function function startServer L42–57
Files Changed
+1 ~1
708 in snapshot

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:75b9b3ba09df2ea3ca5f64ae1b823c3b157771ef12447a0fc89b806d9e9ea050 --body "your comment"