Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ProgressiveBilling) - automated CreditNote generation at the periodic invoice if needed #2475

Merged
merged 5 commits into from
Aug 26, 2024

Conversation

nudded
Copy link
Contributor

@nudded nudded commented Aug 23, 2024

Context

AI companies want their users to pay before the end of a period if usage skyrockets. The problem being that self-serve companies can overuse their API without paying, triggering lots of costs on their side.

Description

Whenever we credit already invoiced progressive billing invoices at the periodic invoice, we could end up in a situation that leaves more to credit than invoicable. At that point we'll create credit notes for past progressive billing invoices.

This adds a CreditNotes::CreateFromProgressiveBillingInvoice service that will take care of distributing the amount to credit over all fees.

Also updates debug gem and allows for remote debugging when ENV['RUBY_DEBUG_PORT'] is set

@nudded nudded changed the title Feat prog billing create credit note feat(ProgressiveBilling) - automated creditnote generation at the periodic invoice if needed Aug 23, 2024
@nudded nudded force-pushed the feat-prog-billing-create-credit-note branch from c8e1b87 to 1c848c5 Compare August 26, 2024 08:16
@nudded nudded marked this pull request as ready for review August 26, 2024 08:17
@nudded nudded force-pushed the feat-prog-billing-create-credit-note branch from 1c848c5 to 6a68113 Compare August 26, 2024 08:17
@nudded nudded force-pushed the feat-prog-billing-create-credit-note branch 2 times, most recently from 78e2247 to 09a85b8 Compare August 26, 2024 12:32
@nudded nudded force-pushed the feat-prog-billing-create-credit-note branch from 09a85b8 to 406533e Compare August 26, 2024 12:42
@nudded nudded changed the title feat(ProgressiveBilling) - automated creditnote generation at the periodic invoice if needed feat(ProgressiveBilling) - automated CreditNote generation at the periodic invoice if needed Aug 26, 2024
@nudded nudded merged commit 09cd187 into main Aug 26, 2024
6 checks passed
@nudded nudded deleted the feat-prog-billing-create-credit-note branch August 26, 2024 13:23
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.

2 participants