From f2d0a072f514f6b333eb438f9d8fa3d5d1ec8954 Mon Sep 17 00:00:00 2001 From: alexeh Date: Sat, 14 Dec 2024 06:03:29 +0100 Subject: [PATCH] Add WGUWU indicator value computing --- .../services/impact-calculator.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/src/modules/indicator-records/services/impact-calculator.service.ts b/api/src/modules/indicator-records/services/impact-calculator.service.ts index 2075a5a05..5df283802 100644 --- a/api/src/modules/indicator-records/services/impact-calculator.service.ts +++ b/api/src/modules/indicator-records/services/impact-calculator.service.ts @@ -388,6 +388,14 @@ export class ImpactCalculator { [INDICATOR_NAME_CODES.WC]: () => { return rawData[INDICATOR_NAME_CODES.WC] * tonnage || 0; }, + [INDICATOR_NAME_CODES.WGUWU]: () => { + const waterWithdrawalValue: number = + rawData[INDICATOR_NAME_CODES.WW] * tonnage || 0; + return ( + (rawData[INDICATOR_NAME_CODES.WGUWU] * waterWithdrawalValue) / + (100 * rawData.production) || 0 + ); + }, }; for (const [key, value] of Object.entries(calculations)) {