GetUpcomingInvoice for BillingService (2) #12377
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements
GetLatestInvoice
GetUpcomingInvoice
. The rename is done intentionally, to a) align with terminology used in stripe, and b) to distinguish between the next invoice and an already paid invoice. The upcoming invoice contains the the amount of credits currently used (🤞🏻 after discounts), which can be compared with the spending limit configured.Related Issue(s)
Fixes #11692
How to test
Setup UBB in for a team and lower the spending limit to 1 or 2 credits for a simple test, then start a workspace or two to hit that limit. After a while, cannot tell it precisely, you'll need to reload the dashboard to refresh the spending limit checks. In the
server
component you'll find a log message on spending limit events, and the known dashboard notification should be visible:Release Notes
Werft options: