-
Story
-
Resolution: Done
-
Critical
-
None
-
None
-
False
-
-
False
-
BIZ-610 - ROSA-HCP
-
-
As a swatch developer, I want to simplify the calculation of tally values for billingCategory, so that I can avoid edge cases with retallies that make is impossible to provide a useful value.
First, applicable contract capacity should be fetched via the customer-facing capacity endpoint (/api/rhsm-subscriptions/v1/capacity/products/{product_id}/{metric_id} endpoint). This will require generation of a client to call the capacity API from TallyResource. (Implemented this way to avoid unnecessary coupling of tally and capacity API implementations). The client should re-use the x-rh-identity used to call TallyResource endpoints.
When billingCategory is prepaid, the value should be (pseudo-code):
min(snapshotValue, contractCapacity)
When billingCategory is on-demand, the value should be (pseudo-code):
max(snapshotValue - contractCapacity, 0)
QE automation work tracked in SWatch-1526