diff --git a/api/src/modules/custom-projects/dto/create-custom-project-dto.ts b/api/src/modules/custom-projects/dto/create-custom-project-dto.ts index 592a1085..3ff75875 100644 --- a/api/src/modules/custom-projects/dto/create-custom-project-dto.ts +++ b/api/src/modules/custom-projects/dto/create-custom-project-dto.ts @@ -2,7 +2,6 @@ import { IsEnum, IsNotEmpty, IsNumber, - IsOptional, IsString, Length, Validate, @@ -12,7 +11,7 @@ import { ACTIVITY } from '@shared/entities/activity.enum'; import { ECOSYSTEM } from '@shared/entities/ecosystem.enum'; import { ConservationProjectParamDto } from '@api/modules/custom-projects/dto/conservation-project-params.dto'; import { RestorationProjectParamsDto } from '@api/modules/custom-projects/dto/restoration-project-params.dto'; -import { CustomProjectAssumptionsDto } from '@api/modules/custom-projects/dto/project-assumptions.dto'; +import { OverridableAssumptions } from '@api/modules/custom-projects/dto/project-assumptions.dto'; import { CostInputs } from '@api/modules/custom-projects/dto/project-cost-inputs.dto'; import { ProjectParamsValidator } from '@api/modules/custom-projects/validation/project-params.validator'; import { Transform, Type } from 'class-transformer'; @@ -46,11 +45,11 @@ export class CreateCustomProjectDto { carbonRevenuesToCover: CARBON_REVENUES_TO_COVER; @ValidateNested() - @Type(() => CustomProjectAssumptionsDto) + @Type(() => OverridableAssumptions) @IsNotEmpty({ message: 'Assumptions are required to create a custom project', }) - assumptions: CustomProjectAssumptionsDto; + assumptions: OverridableAssumptions; @IsNotEmpty({ message: 'Cost inputs are required to create a custom project', diff --git a/api/src/modules/custom-projects/dto/project-assumptions.dto.ts b/api/src/modules/custom-projects/dto/project-assumptions.dto.ts index 2df8333c..7dcb0531 100644 --- a/api/src/modules/custom-projects/dto/project-assumptions.dto.ts +++ b/api/src/modules/custom-projects/dto/project-assumptions.dto.ts @@ -1,6 +1,6 @@ import { IsNumber } from 'class-validator'; -export class CustomProjectAssumptionsDto { +export class OverridableAssumptions { @IsNumber() verificationFrequency: number; diff --git a/api/src/modules/custom-projects/input-factory/conservation-project.input.ts b/api/src/modules/custom-projects/input-factory/conservation-project.input.ts index dc4369c3..39813b83 100644 --- a/api/src/modules/custom-projects/input-factory/conservation-project.input.ts +++ b/api/src/modules/custom-projects/input-factory/conservation-project.input.ts @@ -2,7 +2,7 @@ import { ACTIVITY } from '@shared/entities/activity.enum'; import { ECOSYSTEM } from '@shared/entities/ecosystem.enum'; import { CARBON_REVENUES_TO_COVER } from '@api/modules/custom-projects/dto/create-custom-project-dto'; import { CostInputs } from '@api/modules/custom-projects/dto/project-cost-inputs.dto'; -import { CustomProjectAssumptionsDto } from '@api/modules/custom-projects/dto/project-assumptions.dto'; +import { OverridableAssumptions } from '@api/modules/custom-projects/dto/project-assumptions.dto'; import { ConservationProjectParamDto, PROJECT_EMISSION_FACTORS, @@ -38,8 +38,7 @@ export class ConservationProjectInput { costInputs: CostInputs = new CostInputs(); - modelAssumptions: CustomProjectAssumptionsDto = - new CustomProjectAssumptionsDto(); + modelAssumptions: OverridableAssumptions = new OverridableAssumptions(); setLossRate( parameters: ConservationProjectParamDto, @@ -71,7 +70,7 @@ export class ConservationProjectInput { return this; } - setModelAssumptions(modelAssumptions: CustomProjectAssumptionsDto): this { + setModelAssumptions(modelAssumptions: OverridableAssumptions): this { this.modelAssumptions = modelAssumptions; return this; }