Repository navigation
feat(billing): support usage-based invoice line creates - #4669
Conversation
|
@coderabbitai review |
✅ Action performedReview finished.
|
📝 WalkthroughWalkthroughThis PR adds manual creation of usage-based invoice lines through invoice APIs, persists ChangesManual usage-based line creation and state-machine refactor
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant InvoiceAPI
participant UsageBasedLineEngine
participant UsageBasedLineMapper
participant UsageBasedChargeService
participant ChargeStateMachine
InvoiceAPI->>UsageBasedLineEngine: Submit created invoice lines
UsageBasedLineEngine->>UsageBasedLineMapper: Build manual intent
UsageBasedLineMapper-->>UsageBasedLineEngine: Normalized usage-based intent
UsageBasedLineEngine->>UsageBasedChargeService: Create charge
UsageBasedChargeService-->>UsageBasedLineEngine: Created charge
UsageBasedLineEngine->>ChargeStateMachine: Attach line and advance charge
ChargeStateMachine-->>UsageBasedLineEngine: Realization state and patches
UsageBasedLineEngine-->>InvoiceAPI: Return created lines
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
f19ead9 to
063fc2c
Compare
063fc2c to
9d51d4e
Compare
Summary
two rules:
Summary by CodeRabbit
New Features
Bug Fixes
UnitConfigpropagation/usage so it’s preserved from intent through charge creation and metered quantity conversion.Documentation
Tests
Greptile Summary
This PR adds support for usage-based invoice line creates in billing. The main changes are:
Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Reviews (4): Last reviewed commit: "test(billing): cover manual usage line u..." | Re-trigger Greptile
Context used (3)