Skip to content

Clarify lifecycle / required API poll time #39

@forsberg

Description

@forsberg

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 varying Tariff.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.product for 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 toExcluding 2026-01-01, when at the latest can an API consumer expect to get a reply that contains information about the replacement tariff with fromIncluding 2026-01-01? This also determines how often an API consumer needs to poll each API in order to always have valid information per Tariff.product available.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions