fix patch billing feat/phase-2g-bundle
AI Agent git-import/068377df · 111 days ago · Apr 6, 2026 · Diff

fix(billing): legacy pack consolidation backfill + portal redirect hardening

billing-logic.mjs: - inferPackConsolidationPassesFromIndexingTokenBalance() — greedy pack sizes + remainder at small-pack ratio. - pack_consolidation_legacy_inferred flag on user record (default false).

billing-http.mjs: - On GET /api/v1/billing/summary, one-time mutateBillingDb backfill when pack tokens > 0, pack consolidation passes == 0, and not yet inferred. Aligns UI with purchases made before webhook credited consolidation passes.

hub.js: - redirectToPortal throws if API omits url; message points to Stripe Customer portal setup. - Manage billing errors show in billing-panel-msg and scrollIntoView; clear stale errors on click.

tests: infer function cases + defaultUserRecord legacy flag.

sha256:0b83bac583c803f17c63e6f50c990c128324f5979c5f7f47338c4840e359e7cf sha
sha256:b9ba2e58d470dfb0d55fee34bd8fc1a7663cd8ac9bb80aa142fe39fe38a3eadf snapshot
← Older Oldest on feat/phase-2g-bundle
All commits
Newer → Latest on feat/phase-2g-bundle

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:0b83bac583c803f17c63e6f50c990c128324f5979c5f7f47338c4840e359e7cf --body "your comment"