Klimatbyran/garbo

Ensure `totalBiogenic` is saved in the correct field

Opened this issue · 0 comments

Context from Discord:

Det har sparats fel. Ev. måste jag lägga till i OpenSearch mappings med. Eller så har garbo gjort något, jag vet inte exakt hur den här datan behandlas innan den sparas. I så fall måste det här finnas i exemplet så att garbo vet vart fältet totalBiogenic ska sparas.

Enligt koden ska totalBiogenic sparas under emissions[year].totalBiogenic (inte i emissions[year].scope3.totalBiogenic)

garbo/src/lib/facit.ts

Lines 15 to 52 in 99d586c

emissions: {
'2023': {
year: '2023',
scope1: {
emissions: parse(row['23_scope1']),
},
scope2: {
lb: parse(row['23_scope2LB']),
mb: parse(row['23_scope2MB']),
emissions: parse(row['23_scope2MB'] || row['23_scope2LB']),
},
scope3: {
emissions: parse(row['23_scope3']),
categories: {
'1_purchasedGoods': parse(row['23_scope3_1']),
'2_capitalGoods': parse(row['23_scope3_2']),
'3_fuelAndEnergyRelatedActivities': parse(row['23_scope3_3']),
'4_upstreamTransportationAndDistribution': parse(
row['23_scope3_4']
),
'5_wasteGeneratedInOperations': parse(row['23_scope3_5']),
'6_businessTravel': parse(row['23_scope3_6']),
'7_employeeCommuting': parse(row['23_scope3_7']),
'8_upstreamLeasedAssets': parse(row['23_scope3_8']),
'9_downstreamTransportationAndDistribution': parse(
row['23_scope3_9']
),
'10_processingOfSoldProducts': parse(row['23_scope3_10']),
'11_useOfSoldProducts': parse(row['23_scope3_11']),
'12_endOfLifeTreatmentOfSoldProducts': parse(row['23_scope3_12']),
'13_downstreamLeasedAssets': parse(row['23_scope3_13']),
'14_franchises': parse(row['23_scope3_14']),
'15_investments': parse(row['23_scope3_15']),
'16_other': parse(row['23_scope3_16']),
},
},
totalBiogenic: parse(row['23_biogenic']),
},

...men i API-datan så får vi tillbaka biogena utsläpp som en del av scope3 (see screenshot from Fortnox below):

image

This also happened for PostNord https://discord.com/channels/1049333222309371965/1255802803754893424:
image