Skip to content

Commit

Permalink
Use initial carbon price assumption
Browse files Browse the repository at this point in the history
  • Loading branch information
catalin-oancea authored and alexeh committed Jan 30, 2025
1 parent f066990 commit 81ca10c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions api/src/modules/custom-projects/custom-projects.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export class CustomProjectsService extends AppBaseService<
ecosystem,
activity,
});
if (dto.initialCarbonPriceAssumption) {
additionalAssumptions.carbonPrice = dto.initialCarbonPriceAssumption;
}

const projectInput = this.customProjectFactory.createProjectInput(
dto,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ describe('Create Custom Projects - Setup', () => {

expect(response.status).toBe(201);
const responseData = response.body.data;
expect(responseData.totalCostNPV).toEqual(3619506.2162071504);
expect(responseData.totalCost).toEqual(5556541.947938656);
expect(responseData.totalCostNPV).toEqual(3092025.8572758473);
expect(responseData.totalCost).toEqual(4555908.877681957);
expect(responseData.breakevenTotalCost).toEqual(3750308.289753845);
expect(responseData.breakevenTotalCostNPV).toEqual(2667356.215719252);
const output = responseData.output;
Expand All @@ -83,6 +83,10 @@ describe('Create Custom Projects - Setup', () => {
for (const breakdown of yearlyBreakdown) {
expect(breakdown.costValues[0]).toBeUndefined();
}
expect(
responseData.output.initialCarbonPriceComputationOutput
.initialCarbonPrice,
).toEqual(20);
});
});
});

0 comments on commit 81ca10c

Please sign in to comment.