Skip to content

Update calculatedTotalEmissions to handle multiple units, in cases where tCO2e, tCO2 and other units need to be combined #534

@Greenheart

Description

@Greenheart

As a consequence of #533, we should likely make the API return the unit(s) clearly for the calculated total. This would be most correct.

How we handle units of the partial emission numbers also affects calculatedTotalEmissions which needs to make sure all numbers use the same unit, e.g. tCO2e. If garbo finds another unit, we either have to convert tCO2 into tCO2e, or disclose the total as an array of calculatedTotalEmissions, one number per unit found in scope1, scope2, scope3, statedTotalEmissions, scope1And2 and all their nested emission numbers.

For example, we could update calculatedTotalEmissions to return something like this:

{
  "calculatedTotalEmissions": [
    {
      "total": 5600,
      "unit": "tCO2e"
    },
    {
      "total": 32800,
      "unit": "tCO2"
    },
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions