-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
373 additions
and
1,307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 9 additions & 49 deletions
58
api/src/modules/indicator-coefficients/dto/indicator-coefficients.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,60 @@ | ||
import { | ||
INDICATOR_TYPES, | ||
INDICATOR_TYPES_NEW, | ||
} from 'modules/indicators/indicator.entity'; | ||
import { INDICATOR_TYPES } from 'modules/indicators/indicator.entity'; | ||
import { IsNotEmpty, IsNumber, IsOptional, Max, Min } from 'class-validator'; | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { ApiPropertyOptional } from '@nestjs/swagger'; | ||
|
||
export class IndicatorCoefficientsDto { | ||
@ApiProperty() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES.DEFORESTATION]: number; | ||
|
||
@ApiProperty() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES.UNSUSTAINABLE_WATER_USE]: number; | ||
|
||
@ApiProperty() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES.BIODIVERSITY_LOSS]: number; | ||
|
||
@ApiProperty() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES.CARBON_EMISSIONS]: number; | ||
|
||
@ApiProperty() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES.CARBON_EMISSIONS]: number; | ||
} | ||
|
||
export class IndicatorCoefficientsDtoV2 { | ||
@ApiPropertyOptional() | ||
@IsOptional() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNumber() | ||
[INDICATOR_TYPES_NEW.WATER_USE]: number; | ||
[INDICATOR_TYPES.WATER_USE]: number; | ||
|
||
@ApiPropertyOptional() | ||
@IsOptional() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES_NEW.UNSUSTAINABLE_WATER_USE]: number; | ||
[INDICATOR_TYPES.UNSUSTAINABLE_WATER_USE]: number; | ||
|
||
@ApiPropertyOptional() | ||
@IsOptional() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES_NEW.CLIMATE_RISK]: number; | ||
[INDICATOR_TYPES.CLIMATE_RISK]: number; | ||
|
||
@ApiPropertyOptional() | ||
@IsOptional() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES_NEW.DEFORESTATION_RISK]: number; | ||
[INDICATOR_TYPES.DEFORESTATION_RISK]: number; | ||
|
||
@ApiPropertyOptional() | ||
@IsOptional() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES_NEW.LAND_USE]: number; | ||
[INDICATOR_TYPES.LAND_USE]: number; | ||
|
||
@ApiPropertyOptional() | ||
@IsOptional() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES_NEW.SATELLIGENCE_DEFORESTATION]: number; | ||
[INDICATOR_TYPES.SATELLIGENCE_DEFORESTATION]: number; | ||
|
||
@ApiPropertyOptional() | ||
@IsOptional() | ||
@Max(1000000) | ||
@Min(0) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
[INDICATOR_TYPES_NEW.SATELLIGENCE_DEFORESTATION_RISK]: number; | ||
[INDICATOR_TYPES.SATELLIGENCE_DEFORESTATION_RISK]: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.