-
Type:
New Feature
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: SolarQuery
-
None
A common requirement for supporting billing based on a meter reading captured by a node is to know what the meter reading was at both the start and end of a billing cycle. Given the node readings do not fall exactly on billing cycle dates, this means a query must find the readings closest to the date to be able to extrapolate what the reading was on the exact date.
As At the moment to find this out one must perform two queries per billing cycle date: one to find the first row before or on the billing cycle date and one to find the next row after the billing cycle date. Then the reading can be calculated using a time-weighted fraction between the two readings.
Add an API that can return this "reading at" data, given the following inputs:
- node ID(s)
- source ID(s)
- reading date, possibly two reading dates to support start/end readings
- maximum interval before/after reading date(s) to look for before/next readings
The results must contain results for each node, source, and date combination and include the calculation of the accumulating datum properties at each date. It might also be useful to include the raw previous/next datum rows in the result to aid with billing verification.
- relates to
-
JS-10 Add support for new /datum/reading endpoint
-
- Done
-