Browse Source
Bugfix/handling of zero buying power in static portfolio analysis rules (#5474)
* Improve handling of 0 buying power
* Update changelog
pull/5471/merge
Thomas Kaul
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
20 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/models/rules/asset-class-cluster-risk/equity.ts
-
apps/api/src/models/rules/asset-class-cluster-risk/fixed-income.ts
-
apps/api/src/models/rules/liquidity/buying-power.ts
-
apps/client/src/app/pages/i18n/i18n-page.html
|
|
@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Improved the handling of `0` buying power in the static portfolio analysis rule: _Liquidity_ (Buying Power) |
|
|
|
- Fixed an issue related to the error handling in the data provider status component |
|
|
|
|
|
|
|
## 2.196.0 - 2025-09-04 |
|
|
|
|
|
@ -67,6 +67,7 @@ export class AssetClassClusterRiskEquity extends Rule<Settings> { |
|
|
|
value: false |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
evaluation: this.i18nService.getTranslation({ |
|
|
|
id: 'rule.assetClassClusterRiskEquity.true', |
|
|
|
|
|
@ -67,6 +67,7 @@ export class AssetClassClusterRiskFixedIncome extends Rule<Settings> { |
|
|
|
value: false |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
evaluation: this.i18nService.getTranslation({ |
|
|
|
id: 'rule.assetClassClusterRiskFixedIncome.true', |
|
|
|
|
|
@ -22,10 +22,21 @@ export class BuyingPower extends Rule<Settings> { |
|
|
|
} |
|
|
|
|
|
|
|
public evaluate(ruleSettings: Settings) { |
|
|
|
if (this.buyingPower < ruleSettings.thresholdMin) { |
|
|
|
if (this.buyingPower === 0) { |
|
|
|
return { |
|
|
|
evaluation: this.i18nService.getTranslation({ |
|
|
|
id: 'rule.liquidityBuyingPower.false', |
|
|
|
id: 'rule.liquidityBuyingPower.false.zero', |
|
|
|
languageCode: this.getLanguageCode(), |
|
|
|
placeholders: { |
|
|
|
baseCurrency: ruleSettings.baseCurrency |
|
|
|
} |
|
|
|
}), |
|
|
|
value: false |
|
|
|
}; |
|
|
|
} else if (this.buyingPower < ruleSettings.thresholdMin) { |
|
|
|
return { |
|
|
|
evaluation: this.i18nService.getTranslation({ |
|
|
|
id: 'rule.liquidityBuyingPower.false.min', |
|
|
|
languageCode: this.getLanguageCode(), |
|
|
|
placeholders: { |
|
|
|
baseCurrency: ruleSettings.baseCurrency, |
|
|
|
|
|
@ -69,10 +69,13 @@ |
|
|
|
</li> |
|
|
|
<li i18n="@@rule.liquidity.category">Liquidity</li> |
|
|
|
<li i18n="@@rule.liquidityBuyingPower">Buying Power</li> |
|
|
|
<li i18n="@@rule.liquidityBuyingPower.false"> |
|
|
|
<li i18n="@@rule.liquidityBuyingPower.false.min"> |
|
|
|
Your buying power is below ${thresholdMin} |
|
|
|
${baseCurrency} |
|
|
|
</li> |
|
|
|
<li i18n="@@rule.liquidityBuyingPower.false.zero"> |
|
|
|
Your buying power is 0 ${baseCurrency} |
|
|
|
</li> |
|
|
|
<li i18n="@@rule.liquidityBuyingPower.true"> |
|
|
|
Your buying power exceeds ${thresholdMin} |
|
|
|
${baseCurrency} |
|
|
|