From 44c972952eac6a6c98c0b79170e0381746722326 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:08:31 +0200 Subject: [PATCH] Reordering --- .../emerging-markets.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/apps/api/src/models/rules/allocation-cluster-risk/emerging-markets.ts b/apps/api/src/models/rules/allocation-cluster-risk/emerging-markets.ts index 8ec13f232..e7c107510 100644 --- a/apps/api/src/models/rules/allocation-cluster-risk/emerging-markets.ts +++ b/apps/api/src/models/rules/allocation-cluster-risk/emerging-markets.ts @@ -17,9 +17,9 @@ export class AllocationClusterRiskEmergingMarkets extends Rule { name: 'Emerging Markets' }); + this.currentValueInBaseCurrency = currentValueInBaseCurrency; this.emergingMarketsValueInBaseCurrency = emergingMarketsValueInBaseCurrency; - this.currentValueInBaseCurrency = currentValueInBaseCurrency; } public evaluate(ruleSettings: Settings) { @@ -30,30 +30,26 @@ export class AllocationClusterRiskEmergingMarkets extends Rule { if (emergingMarketsValueRatio > ruleSettings.thresholdMax) { return { - evaluation: `The emerging markets contribution exceeds ${( + evaluation: `The emerging markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) exceeds ${( ruleSettings.thresholdMax * 100 - ).toPrecision( - 3 - )}% of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%)`, + ).toPrecision(3)}%`, value: false }; } else if (emergingMarketsValueRatio < ruleSettings.thresholdMin) { return { - evaluation: `The emerging markets contribution is below ${( + evaluation: `The emerging markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) is below ${( ruleSettings.thresholdMin * 100 - ).toPrecision( - 3 - )}% of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%)`, + ).toPrecision(3)}%`, value: false }; } return { - evaluation: `The emerging markets contribution is within the range of ${( + evaluation: `The emerging markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) is within the range of ${( ruleSettings.thresholdMin * 100 ).toPrecision( 3 - )}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}% of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%)`, + )}% and ${(ruleSettings.thresholdMax * 100).toPrecision(3)}%`, value: true }; }