Currently, when showing spending notifications to users we use the UsageService.ListUsage
RPC and we sum up all the records. This is suboptimal, but more importantly it is the wrong data. Instead, we need to be looking at the current value of an Invoice (unpaid).
To that end, we want to add a new RPC to the BillingService
. The RPC should be able to do the following:
- Given a UserID, or TeamID, it find details about the latest invoice and retrieves the current value of that invoce (along with more info if needed)