From 4801b45a0bb2b3986d84fc7f32e50933ca5d16d3 Mon Sep 17 00:00:00 2001 From: alexeh Date: Sat, 14 Dec 2024 06:03:42 +0100 Subject: [PATCH] add WGUWU to indicator coefficients DTO --- .../dto/indicator-coefficients.dto.ts | 8 ++++++++ .../calculations/indicator-records.service.spec.ts | 1 + 2 files changed, 9 insertions(+) diff --git a/api/src/modules/indicator-coefficients/dto/indicator-coefficients.dto.ts b/api/src/modules/indicator-coefficients/dto/indicator-coefficients.dto.ts index 9503027e0..e4dc9c989 100644 --- a/api/src/modules/indicator-coefficients/dto/indicator-coefficients.dto.ts +++ b/api/src/modules/indicator-coefficients/dto/indicator-coefficients.dto.ts @@ -97,4 +97,12 @@ export class IndicatorCoefficientsDto { @IsNotEmpty() @IsNumber() [INDICATOR_NAME_CODES.WC]: number; + + @ApiPropertyOptional() + @IsOptional() + @Max(1000000) + @Min(0) + @IsNotEmpty() + @IsNumber() + [INDICATOR_NAME_CODES.WGUWU]: number; } diff --git a/api/test/integration/indicator-record/calculations/indicator-records.service.spec.ts b/api/test/integration/indicator-record/calculations/indicator-records.service.spec.ts index 6c2063cd7..05c653fa8 100644 --- a/api/test/integration/indicator-record/calculations/indicator-records.service.spec.ts +++ b/api/test/integration/indicator-record/calculations/indicator-records.service.spec.ts @@ -249,6 +249,7 @@ describe('Impact Calculator Tests', () => { [INDICATOR_NAME_CODES.GHG_FARM]: 0.2, [INDICATOR_NAME_CODES.WW]: 0.3, [INDICATOR_NAME_CODES.WC]: 0.4, + [INDICATOR_NAME_CODES.WGUWU]: 0.5, }; //ACT