Skip to content

Commit

Permalink
temporal workaround to missing column data: price-type, cost_per_tco2…
Browse files Browse the repository at this point in the history
…e npv and typo in abatement potential
  • Loading branch information
alexeh committed Nov 24, 2024
1 parent ba7c12a commit 2f2a8f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions api/src/modules/import/dtos/excel-projects.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ export type ExcelProjects = {
activity_type: RESTORATION_ACTIVITY_SUBTYPE;
project_size_ha: number;
project_size_filter: string;
aAbatement_potential: number;
total_cost_NPV: number;
abatement_potential: number;
total_cost_npv: number;
total_cost: number;
// TODO: This column has dissapeared from the excel sheet
'$/tCO2e (NPV)': number;
'$/tCO2e': number;
cost_per_tco2e: number;
initial_price_assumption: string;
price_type: PROJECT_PRICE_TYPE;
};
10 changes: 6 additions & 4 deletions api/src/modules/import/services/entity.preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,11 +1110,13 @@ export class EntityPreprocessor {
project.restorationActivity = row.activity_type;
project.projectSize = row.project_size_ha;
project.projectSizeFilter = row.project_size_filter;
project.abatementPotential = row.aAbatement_potential;
project.totalCostNPV = row.total_cost_NPV;
project.abatementPotential = row.abatement_potential;
project.totalCostNPV = row.total_cost_npv;
project.totalCost = row.total_cost;
project.costPerTCO2eNPV = row['$/tCO2e (NPV)'];
project.costPerTCO2e = row['$/tCO2e'];
// TODO: This has dissapeared from the excel file and it is required for filtering, setting a fake value for now
//project.costPerTCO2eNPV = row['$/tCO2e (NPV)'];
project.costPerTCO2eNPV = row.cost_per_tco2e;
project.costPerTCO2e = row.cost_per_tco2e;
project.initialPriceAssumption = row.initial_price_assumption;
project.priceType = row.price_type;

Expand Down

0 comments on commit 2f2a8f0

Please sign in to comment.