Open DanielTOsborne opened 6 months ago
The getAll endpoint already accomplishes this. You can pass in the level id and a start and end date. It will create a record with each effective date along with its value. It would be up to the client to ignore seasonal/timeseries levels. I could see an update that restructures the LocationLevels DTO to group all levels with the same id to remove redundant data.
For non-timeseries location levels, I'd like to specify a date range and see all the values it was set to within that date range.
For example... Assuming the levels table contains these:
Notice the LEVEL_DATE is different.
I'd like to supply a start and end date, and get a result like this:
For the regular single point-in-time query, I'd expect "constant-values" array to be empty, if present at all. At least if compatibility with the current version is desired. If not, making the entire thing an array even for a single result is fine with me. For compatibility, I left the current behavior in there as well, where it returns "constant-value" and "level-date", which is set to the most recent value in the date range requested. That can be changed if desired too.
I'm open to various output formats, I listed the above as an example. Personally, I'd prefer the unix epoch timestamp, like in timeseries, but this levels call already has its own date format. Though, the response doesn't include the timezone, so it's not round-trippable. That's a separate issue though.