feat(billing): make metering formula admin-configurable #44

Merged
tkmind merged 1 commits from feature/billing-formula-admin-config into main 2026-08-06 09:00:06 +00:00
Owner

Summary

  • Add billing-admin-config service backed by h5_billing_admin_config (admin-db > env).
  • Portal billSessionUsage and tkmind-proxy cost estimate path read effective config at charge time.
  • Supports memind_adm「计量公式」UI; lock with H5_BILLING_CONFIG_SOURCE=env if needed.

Test plan

  • Run node --test billing-admin-config.test.mjs billing.test.mjs billing-token-state.test.mjs.
  • With no DB row, effective config matches env (H5_MARGIN_MULTIPLIER=1.2).
  • After admin save, charge path uses new margin without Portal restart.
  • With H5_BILLING_CONFIG_SOURCE=env, admin update is rejected.
## Summary - Add `billing-admin-config` service backed by `h5_billing_admin_config` (admin-db > env). - Portal `billSessionUsage` and tkmind-proxy cost estimate path read effective config at charge time. - Supports memind_adm「计量公式」UI; lock with `H5_BILLING_CONFIG_SOURCE=env` if needed. ## Test plan - [ ] Run `node --test billing-admin-config.test.mjs billing.test.mjs billing-token-state.test.mjs`. - [ ] With no DB row, effective config matches env (`H5_MARGIN_MULTIPLIER=1.2`). - [ ] After admin save, charge path uses new margin without Portal restart. - [ ] With `H5_BILLING_CONFIG_SOURCE=env`, admin update is rejected.
tkmind added 1 commit 2026-08-06 08:56:05 +00:00
feat(billing): make metering formula admin-configurable
Memind CI / Test, build, and release guards (pull_request) Failing after 1m29s
391ba0b705
Allow margin/FX/cost-mode knobs to be overridden via h5_billing_admin_config so memind_adm can adjust DeepSeek billing without editing env.

Co-authored-by: Cursor <cursoragent@cursor.com>
tkmind merged commit 8e4fc09cb5 into main 2026-08-06 09:00:06 +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#44