Skip to content

Commit

Permalink
rename dto to OverridableAssumptions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Nov 21, 2024
1 parent 5d1c442 commit b890217
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
IsEnum,
IsNotEmpty,
IsNumber,
IsOptional,
IsString,
Length,
Validate,
Expand All @@ -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';
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IsNumber } from 'class-validator';

export class CustomProjectAssumptionsDto {
export class OverridableAssumptions {
@IsNumber()
verificationFrequency: number;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -38,8 +38,7 @@ export class ConservationProjectInput {

costInputs: CostInputs = new CostInputs();

modelAssumptions: CustomProjectAssumptionsDto =
new CustomProjectAssumptionsDto();
modelAssumptions: OverridableAssumptions = new OverridableAssumptions();

setLossRate(
parameters: ConservationProjectParamDto,
Expand Down Expand Up @@ -71,7 +70,7 @@ export class ConservationProjectInput {
return this;
}

setModelAssumptions(modelAssumptions: CustomProjectAssumptionsDto): this {
setModelAssumptions(modelAssumptions: OverridableAssumptions): this {
this.modelAssumptions = modelAssumptions;
return this;
}
Expand Down

0 comments on commit b890217

Please sign in to comment.