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): Bill current usage #2461

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

vincent-pochet
Copy link
Collaborator

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

This PR refactors the Invoices::ProgressiveBillingService to create current usage fees, instead of a single progressive billings one per threshold.

Note: The logic to apply progressive billing credits to the invoice in order to avoid double billing will be handled in a separate pull request as the current one is already complex. The PDF template will also be adapted separatly

@vincent-pochet vincent-pochet force-pushed the feat-progressive-billing-fixes branch from 3b91911 to ae60257 Compare August 22, 2024 12:26
@vincent-pochet vincent-pochet force-pushed the feat-progressive-billing-fixes branch from ae60257 to 8dfd783 Compare August 22, 2024 13:34
@vincent-pochet vincent-pochet merged commit 534e226 into main Aug 22, 2024
6 checks passed
@vincent-pochet vincent-pochet deleted the feat-progressive-billing-fixes branch August 22, 2024 13:43
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