Skip to content

app/: one plan catalogue and one credit ledger (billing tidy-up) - #133

Merged
ndbroadbent merged 1 commit into
mainfrom
billing-dedupe
Dec 3, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
billing-dedupe

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

The plans, the credit pack and add_purchased_credits were defined in both app/src/billing/mod.rs and app/src/domain/credits.rs, left over from the port.

  • billing holds the catalogue (Plan, CreditPack, FREE/TEAM/STAFF, PLANS, CREDIT_PACK, MAX_AUTO_RELOAD_PACKS, plan_by_id) and Stripe.
  • domain::credits holds the ledger, spending and usage, and the single add_purchased_credits (the check-then-insert one, with the unique index as the backstop), which the webhook now calls.
  • Callers in processing.rs and mcp/mod.rs use billing::plan_by_id. No re-exports, no behaviour changes.

Checked on docspring-dev: cargo fmt --check, cargo clippy --locked --all-targets -D warnings, and the billing, credits, mcp and emails tests (41 pass). Nathan asked for this tidy-up so the repo reads cleanly as a starter kit.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…dits

Plan, CreditPack, the plans, CREDIT_PACK and MAX_AUTO_RELOAD_PACKS were defined in both modules, and
add_purchased_credits had two implementations, left over from the port. billing now holds the catalogue (with PLANS)
and Stripe; domain::credits holds the ledger, spending and usage, and the one add_purchased_credits, which the webhook
calls. No behaviour changes.
@ndbroadbent
ndbroadbent merged commit b3f8fd6 into main Dec 3, 2026
14 checks passed
@ndbroadbent
ndbroadbent deleted the billing-dedupe branch December 3, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant