-
Notifications
You must be signed in to change notification settings - Fork 4
Description
With #9 closed, the Tariff.product field became a persistent identifier that together with Tariff.validPeriod can be used to identify the same tariff over time.
What's still unclear to me is what to expect in the API response when it comes to historical and future tariffs. Will the response contain all previous tariffs for each product? When will a new version of a product become available?
In our use case, we will store which tariff a specific customer have in a database (see #38 for considations). We use this information to optimize the energy usage for our customers. We therefore need to ensure that there's always a valid tariff information available for the customer, i.e one where validPeriod matches the time of compute ("Today" or "Tomorrow").
I think the API specification need to clarify:
- Generally that it is expected that there will be multiple Tariff objects per
Tariff.product, with varyingTariff.validPeriod. - How much of historical Tariff objects should be available in the API? Ideally, it should be possible to retrieve historical Tariffs for each
Tariff.productfor some time in the past, as that allows calculating historical cost. - At what point in time is it required for the API to reply with information about a future Tariff. I.e, if we have a Tariff that has a
toExcluding2026-01-01, when at the latest can an API consumer expect to get a reply that contains information about the replacement tariff withfromIncluding2026-01-01? This also determines how often an API consumer needs to poll each API in order to always have valid information perTariff.productavailable.
From a resilience point of view, the earlier the better when it comes to future Tariff availability - having more time to poll for new info means the uptime requirements on the Tariff API endpoints are less stringent.