Skip to content

Commit

Permalink
first prototype sequestration-rate.calculator.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Nov 4, 2024
1 parent 649690f commit 2e944f9
Show file tree
Hide file tree
Showing 7 changed files with 412 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/src/modules/calculations/conservation-cost.calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { DEFAULT_STUFF } from '@api/modules/custom-projects/project-config.inter
import { CostCalculator } from '@api/modules/calculations/cost.calculator';
import { BaseIncrease } from '@shared/entities/base-increase.entity';
import { BaseSize } from '@shared/entities/base-size.entity';
import { SequestrationCreditsCalculator } from '@api/modules/calculations/sequestration-rate.calculator';
import { RESTORATION_ACTIVITY_SUBTYPE } from '@shared/entities/projects.entity';
import { ACTIVITY } from '@shared/entities/activity.enum';

export class ConservationCostCalculator extends CostCalculator {
project: ConservationProject;
Expand All @@ -25,6 +28,7 @@ export class ConservationCostCalculator extends CostCalculator {
totalNPV: number;
baseIncrease: BaseIncrease;
baseSize: BaseSize;
sequestrationCreditsCalculator: SequestrationCreditsCalculator;
constructor(
project: ConservationProject,
baseIncrease: BaseIncrease,
Expand Down Expand Up @@ -52,6 +56,13 @@ export class ConservationCostCalculator extends CostCalculator {
this.discountRate,
);
this.totalNPV = this.totalCapexNPV + this.totalOpexNPV;
this.sequestrationCreditsCalculator = new SequestrationCreditsCalculator(
project,
this.conservationProjectLength,
this.defaultProjectLength,
ACTIVITY.CONSERVATION,
RESTORATION_ACTIVITY_SUBTYPE.PLANTING,
);
}

private initializeCostPlan(): { [year: number]: number } {
Expand Down
1 change: 1 addition & 0 deletions api/src/modules/calculations/revenue-profit.calculators.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export class RevenueProfitCalculator {}
Loading

0 comments on commit 2e944f9

Please sign in to comment.