Repository navigation
Support flat fee invoice line delete overrides - #4586
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughUpdates charge guidance, changes credit-then-invoice deletion to create deleted override intents when needed, routes mutable invoice-line deletes through shared cleanup, and adds subscription-sync coverage for gathering and standard invoice manual deletions. ChangesCredit-then-invoice manual delete flow
Sequence Diagram(s)sequenceDiagram
participant OnMutableInvoiceLinesEditedViaAPI
participant DeleteCharge as CreditThenInvoiceStateMachine.DeleteCharge
participant CreateChargeOverride as Adapter.CreateChargeOverride
participant handleManualDeleteInvoicePatches
participant cleanupDeletedStandardLines
OnMutableInvoiceLinesEditedViaAPI->>DeleteCharge: meta.TriggerDelete for deleted lines
DeleteCharge->>CreateChargeOverride: create deleted override intent when no override layer exists
DeleteCharge-->>OnMutableInvoiceLinesEditedViaAPI: drained invoice patches
OnMutableInvoiceLinesEditedViaAPI->>handleManualDeleteInvoicePatches: dispatch patch operations
handleManualDeleteInvoicePatches->>cleanupDeletedStandardLines: clean up standard-line deletes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 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 |
Greptile SummaryThis PR adds manual delete support for flat-fee invoice-line overrides. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "feat: support flat fee invoice line dele..." | Re-trigger Greptile |
0a8d4c4 to
a708fe2
Compare
Summary
This PR extends the flat-fee invoice-line override flow so manual API deletes are handled through the same charge-owned state-machine and line-engine boundary as manual edits.
When a customer deletes a mutable charge-backed invoice line, the flat-fee state machine records the delete on the override layer and emits invoice patches. The line engine consumes those patches locally, validates that they only affect the edited line, and reuses the standard-line deletion cleanup path for standard invoices so credit corrections, charge-owned detailed-line cleanup, and realization-run deletion remain consistent.
The PR also adds subscription-sync coverage for gathering-line and standard-line delete behavior, including promotional-credit ledger expectations for standard invoices, and updates the charges skill with the shared flat-fee/usage-based line-engine rules.
Validation
Summary by CodeRabbit