Browse Source
Bugfix/fix account cluster risk rules for no accounts (#5202)
* Handle no accounts
* Update changelog
pull/5205/head
Thomas Kaul
2 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
29 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/models/rules/account-cluster-risk/current-investment.ts
-
apps/api/src/models/rules/account-cluster-risk/single-account.ts
-
apps/client/src/app/pages/i18n/i18n-page.html
|
|
@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed the horizontal ellipsis icon in the accounts table component |
|
|
|
- Fixed the static portfolio analysis rule for no accounts: _Account Cluster Risks_ (Current Investment) |
|
|
|
- Fixed the static portfolio analysis rule for no accounts: _Account Cluster Risks_ (Single Account) |
|
|
|
|
|
|
|
## 2.182.0 - 2025-07-16 |
|
|
|
|
|
|
|
|
|
@ -37,6 +37,16 @@ export class AccountClusterRiskCurrentInvestment extends Rule<Settings> { |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
if (Object.keys(accounts).length === 0) { |
|
|
|
return { |
|
|
|
evaluation: this.i18nService.getTranslation({ |
|
|
|
id: 'rule.accountClusterRiskCurrentInvestment.false.invalid', |
|
|
|
languageCode: this.getLanguageCode() |
|
|
|
}), |
|
|
|
value: false |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
let maxAccount: (typeof accounts)[0]; |
|
|
|
let totalInvestment = 0; |
|
|
|
|
|
|
|
|
|
@ -22,9 +22,17 @@ export class AccountClusterRiskSingleAccount extends Rule<RuleSettings> { |
|
|
|
} |
|
|
|
|
|
|
|
public evaluate() { |
|
|
|
const accounts: string[] = Object.keys(this.accounts); |
|
|
|
const accountIds: string[] = Object.keys(this.accounts); |
|
|
|
|
|
|
|
if (accounts.length === 1) { |
|
|
|
if (accountIds.length === 0) { |
|
|
|
return { |
|
|
|
evaluation: this.i18nService.getTranslation({ |
|
|
|
id: 'rule.accountClusterRiskSingleAccount.false.invalid', |
|
|
|
languageCode: this.getLanguageCode() |
|
|
|
}), |
|
|
|
value: false |
|
|
|
}; |
|
|
|
} else if (accountIds.length === 1) { |
|
|
|
return { |
|
|
|
evaluation: this.i18nService.getTranslation({ |
|
|
|
id: 'rule.accountClusterRiskSingleAccount.false', |
|
|
@ -39,7 +47,7 @@ export class AccountClusterRiskSingleAccount extends Rule<RuleSettings> { |
|
|
|
id: 'rule.accountClusterRiskSingleAccount.true', |
|
|
|
languageCode: this.getLanguageCode(), |
|
|
|
placeholders: { |
|
|
|
accountsLength: accounts.length |
|
|
|
accountsLength: accountIds.length |
|
|
|
} |
|
|
|
}), |
|
|
|
value: true |
|
|
|
|
|
@ -17,6 +17,9 @@ |
|
|
|
Over ${thresholdMax}% of your current investment is at |
|
|
|
${maxAccountName} (${maxInvestmentRatio}%) |
|
|
|
</li> |
|
|
|
<li i18n="@@rule.accountClusterRiskCurrentInvestment.false.invalid"> |
|
|
|
No accounts have been set up |
|
|
|
</li> |
|
|
|
<li i18n="@@rule.accountClusterRiskCurrentInvestment.true"> |
|
|
|
The major part of your current investment is at |
|
|
|
${maxAccountName} (${maxInvestmentRatio}%) and does |
|
|
@ -26,6 +29,9 @@ |
|
|
|
<li i18n="@@rule.accountClusterRiskSingleAccount.false"> |
|
|
|
Your net worth is managed by a single account |
|
|
|
</li> |
|
|
|
<li i18n="@@rule.accountClusterRiskSingleAccount.false.invalid"> |
|
|
|
Your net worth is managed by 0 accounts |
|
|
|
</li> |
|
|
|
<li i18n="@@rule.accountClusterRiskSingleAccount.true"> |
|
|
|
Your net worth is managed by ${accountsLength} accounts |
|
|
|
</li> |
|
|
|