Repository navigation
feat(billing): Define BillingAlert protos - #462
Conversation
Expose quota pricing output and publish it through an organization usage-evaluated event so spend notifications can evaluate the same result. Refs REVENG-611
|
The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).
|
Represent each finite contract budget with an explicit metric, target, unit, used value, and effective limit. Pass those normalized summaries through quota enforcement and the usage-evaluated event instead of exposing the raw pricing response. Refs REVENG-611
Return only quota configs from contract budget evaluation; usage notification events are emitted where pricing is computed. Refs REVENG-611
Replace the generic expression tree with an explicit budget kind and line-item scope. Reserved and PAYG percentages can now be derived from the existing rate card, contract caps, and usage pricer response. Refs REVENG-611
Define the line-item UID wrapper in the spend notification package instead of coupling the config to the contract-v1 parameter schema. Refs REVENG-611
Clarify that reserved versus PAYG selects the budget type, while the oneof selects the line-item target. Refs REVENG-611
Refs REVENG-611
Refs REVENG-611
Refs REVENG-611
Replace the priced-usage event with an empty request event scoped by organization metadata. Refs REVENG-611
Refs REVENG-611
|
|
||
| message ClaimSpendNotificationResponse { | ||
| bool claimed = 1; | ||
| uint64 claim_id = 2; |
There was a problem hiding this comment.
good catch. i used it for something at first, but we don't need it anymore
Refs REVENG-611
| message SpendNotification { | ||
| uint64 id = 1; | ||
| uint64 organization_id = 2; | ||
| SpendNotificationConfig config = 3; | ||
| bool is_enabled = 4; | ||
| } |
There was a problem hiding this comment.
This PR is a little confusing linguistically. When I imagine a "Notification" I am thinking of a message that goes to a recipient. However I'm looking at this struct and not seeing a message payload, but it does have a configuration. I would recommend some clarification in the naming
There was a problem hiding this comment.
I renamed it to BillingAlert
|
|
||
| // Configuration persisted as JSON by the spend notification data service. | ||
| message SpendNotificationConfig { | ||
| uint32 threshold = 1; |
There was a problem hiding this comment.
questions:
- why a 32 bit int?
- what is this threshold measured in? It's not clear from the code
There was a problem hiding this comment.
It's supposed to be a percent. I renamed the field to threshold_percent.
Require contract context and remove the unused enabled-state filter from the request. Refs REVENG-611
Use billing alert terminology for the service contract, evaluation event, and generated Rust bindings. Refs REVENG-611
Expose the alert threshold as a whole-number percentage in the proto contract. Refs REVENG-611
Defines the BillingAlert service contract and its get, upsert, and claim requests. BillingAlertConfig names the percentage unit explicitly as threshold_percent and supports reserved or PAYG budgets over specific line items or all items.
Also adds BillingAlertEvaluationRequested, published from the quota task so a downstream handler can fetch usage, evaluate BillingAlerts, and deliver notifications.
Refs REVENG-611