Browse Source

Refactoring

pull/4291/head
Thomas Kaul 7 months ago
parent
commit
564bff2ee2
  1. 8
      apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts

8
apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts

@ -15,7 +15,7 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
) { ) {
super(exchangeRateDataService, { super(exchangeRateDataService, {
key: RegionalMarketClusterRiskEmergingMarkets.name, key: RegionalMarketClusterRiskEmergingMarkets.name,
name: 'Emerging markets' name: 'Emerging Markets'
}); });
this.currentValueInBaseCurrency = currentValueInBaseCurrency; this.currentValueInBaseCurrency = currentValueInBaseCurrency;
@ -31,14 +31,14 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
if (emergingMarketsValueRatio > ruleSettings.thresholdMax) { if (emergingMarketsValueRatio > ruleSettings.thresholdMax) {
return { return {
evaluation: `The Emerging markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) exceeds ${( evaluation: `The Emerging Markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) exceeds ${(
ruleSettings.thresholdMax * 100 ruleSettings.thresholdMax * 100
).toPrecision(3)}%`, ).toPrecision(3)}%`,
value: false value: false
}; };
} else if (emergingMarketsValueRatio < ruleSettings.thresholdMin) { } else if (emergingMarketsValueRatio < ruleSettings.thresholdMin) {
return { return {
evaluation: `The Emerging markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) is below ${( evaluation: `The Emerging Markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) is below ${(
ruleSettings.thresholdMin * 100 ruleSettings.thresholdMin * 100
).toPrecision(3)}%`, ).toPrecision(3)}%`,
value: false value: false
@ -46,7 +46,7 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
} }
return { return {
evaluation: `The Emerging markets contribution of your current investment (${(emergingMarketsValueRatio * 100).toPrecision(3)}%) 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 ruleSettings.thresholdMin * 100
).toPrecision( ).toPrecision(
3 3

Loading…
Cancel
Save