Repository navigation
app/: one plan catalogue and one credit ledger (billing tidy-up) - #133
Merged
Merged
Conversation
ndbroadbent
force-pushed
the
billing-dedupe
branch
from
December 3, 2026 13:02
506fdce to
a360b6f
Compare
…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
force-pushed
the
billing-dedupe
branch
from
December 3, 2026 13:43
a360b6f to
3431934
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The plans, the credit pack and
add_purchased_creditswere defined in bothapp/src/billing/mod.rsandapp/src/domain/credits.rs, left over from the port.billingholds the catalogue (Plan,CreditPack,FREE/TEAM/STAFF,PLANS,CREDIT_PACK,MAX_AUTO_RELOAD_PACKS,plan_by_id) and Stripe.domain::creditsholds the ledger, spending and usage, and the singleadd_purchased_credits(the check-then-insert one, with the unique index as the backstop), which the webhook now calls.processing.rsandmcp/mod.rsusebilling::plan_by_id. No re-exports, no behaviour changes.Checked on docspring-dev:
cargo fmt --check,cargo clippy --locked --all-targets -D warnings, and thebilling,credits,mcpandemailstests (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-botwith what you need.