feat(billing): use credit product title as overdraft invoice line item name#1753
feat(billing): use credit product title as overdraft invoice line item name#1753rohilsurana wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughCredit overdraft invoice item descriptions now derive from the configured product title, with a default fallback. The service stores this title during initialization, logs it, uses it during invoice generation, and tests both configured and fallback behavior. ChangesCredit overdraft invoice naming
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for CI Build 29261425709Coverage increased (+0.005%) to 44.881%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
billing/invoice/service_test.go (1)
154-178: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover the production wiring, not only the helper.
This test validates
overdraftItemName()in isolation, so it would still pass ifService.Initstopped copyingcreditProduct.TitleorGenerateForCreditsstopped using the resolver. Add a focused test that verifies the generated credit-overdraft item receives both the configured title and the fallback name.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1cf7a45a-f141-4fc3-9943-1648309e23a1
📒 Files selected for processing (2)
billing/invoice/service.gobilling/invoice/service_test.go
What this changes
The monthly credit overdraft invoice shows a hardcoded line item text: "Credit Overdraft".
This PR changes it to use the title of the configured credit overdraft product. If the title is empty, it falls back to "Credit Overdraft" as before.
Why
The finance team wants a proper service description on the invoice line. The token purchase invoice already prints the product title (Stripe uses the product name as the line text). With this change, the overdraft invoice reads from the same field. Operators can then set the wording once, in the product config.
How it works
Initalready loads the overdraft product for its price. It now also stores the product title.GenerateForCreditsuses that title as the invoice item name.CreateInProvider.Notes
Deploy order
A downstream consumer matches invoice line names against the literal string "Credit Overdraft", so it must be updated first: