feat(billing): record subscription-covered token usage #46

Merged
tkmind merged 1 commits from feature/subscription-usage-records into main 2026-08-06 10:52:56 +00:00
Owner

Summary

  • Write h5_usage_records when an active subscription fully covers session token cost (billing_source=subscription, cost_cents=0)
  • Add billing_source column migration in db.mjs / schema.sql
  • Keep wallet deductions unchanged (billing_source=wallet + ledger entry)

Test plan

  • node --test user-auth.test.mjs billing-session-concurrency.test.mjs
  • After Portal release: Pro user WeChat/H5 chat creates usage rows with 套餐额度 in admin
## Summary - Write h5_usage_records when an active subscription fully covers session token cost (billing_source=subscription, cost_cents=0) - Add billing_source column migration in db.mjs / schema.sql - Keep wallet deductions unchanged (billing_source=wallet + ledger entry) ## Test plan - [x] node --test user-auth.test.mjs billing-session-concurrency.test.mjs - [ ] After Portal release: Pro user WeChat/H5 chat creates usage rows with 套餐额度 in admin
tkmind added 1 commit 2026-08-06 10:52:43 +00:00
feat(billing): record subscription-covered token usage in usage records
Memind CI / Test, build, and release guards (pull_request) Successful in 4m8s
6b586e0951
Write h5_usage_records when plan quota fully covers a session bill so
WeChat and H5 consumption stays visible in admin usage history.

Co-authored-by: Cursor <cursoragent@cursor.com>
tkmind merged commit 49ff7c9bad into main 2026-08-06 10:52:56 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tkmind/memind#46