diff --git a/CHANGELOG.md b/CHANGELOG.md index f419ecfaf..0dcbcc741 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Restructured the resources page +- Renamed the static portfolio analysis rule from _Allocation Cluster Risk_ to _Economic Market Cluster Risk_ (Developed Markets and Emerging Markets) - Improved the language localization for German (`de`) - Switched the `consistent-generic-constructors` rule from `warn` to `error` in the `eslint` configuration - Switched the `consistent-type-assertions` rule from `warn` to `error` in the `eslint` configuration @@ -29,15 +30,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an issue with the X-axis scale of the dividend timeline on the analysis page - Fixed an issue with the X-axis scale of the investment timeline on the analysis page - Fixed an issue with the X-axis scale of the portfolio evolution chart on the analysis page -- Fixed an issue in the calculation of the static portfolio analysis rule: Allocation Cluster Risk (Developed Markets) -- Fixed an issue in the calculation of the static portfolio analysis rule: Allocation Cluster Risk (Emerging Markets) +- Fixed an issue in the calculation of the static portfolio analysis rule: _Allocation Cluster Risk_ (Developed Markets) +- Fixed an issue in the calculation of the static portfolio analysis rule: _Allocation Cluster Risk_ (Emerging Markets) ## 2.118.0 - 2024-10-23 ### Added -- Added a new static portfolio analysis rule: Allocation Cluster Risk (Developed Markets) -- Added a new static portfolio analysis rule: Allocation Cluster Risk (Emerging Markets) +- Added a new static portfolio analysis rule: _Allocation Cluster Risk_ (Developed Markets) +- Added a new static portfolio analysis rule: _Allocation Cluster Risk_ (Emerging Markets) - Added support for mutual funds in the _EOD Historical Data_ service ### Changed diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index d88d925a4..d4018686c 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -7,10 +7,10 @@ import { UserService } from '@ghostfolio/api/app/user/user.service'; import { getFactor } from '@ghostfolio/api/helper/portfolio.helper'; import { AccountClusterRiskCurrentInvestment } from '@ghostfolio/api/models/rules/account-cluster-risk/current-investment'; import { AccountClusterRiskSingleAccount } from '@ghostfolio/api/models/rules/account-cluster-risk/single-account'; -import { AllocationClusterRiskDevelopedMarkets } from '@ghostfolio/api/models/rules/allocation-cluster-risk/developed-markets'; -import { AllocationClusterRiskEmergingMarkets } from '@ghostfolio/api/models/rules/allocation-cluster-risk/emerging-markets'; import { CurrencyClusterRiskBaseCurrencyCurrentInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/base-currency-current-investment'; import { CurrencyClusterRiskCurrentInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/current-investment'; +import { EconomicMarketClusterRiskDevelopedMarkets } from '@ghostfolio/api/models/rules/economic-market-cluster-risk/developed-markets'; +import { EconomicMarketClusterRiskEmergingMarkets } from '@ghostfolio/api/models/rules/economic-market-cluster-risk/emerging-markets'; import { EmergencyFundSetup } from '@ghostfolio/api/models/rules/emergency-fund/emergency-fund-setup'; import { FeeRatioInitialInvestment } from '@ghostfolio/api/models/rules/fees/fee-ratio-initial-investment'; import { DataProviderService } from '@ghostfolio/api/services/data-provider/data-provider.service'; @@ -1193,16 +1193,16 @@ export class PortfolioService { userSettings ) : undefined, - allocationClusterRisk: + economicMarketClusterRisk: summary.ordersCount > 0 ? await this.rulesService.evaluate( [ - new AllocationClusterRiskDevelopedMarkets( + new EconomicMarketClusterRiskDevelopedMarkets( this.exchangeRateDataService, marketsTotalInBaseCurrency, markets.developedMarkets.valueInBaseCurrency ), - new AllocationClusterRiskEmergingMarkets( + new EconomicMarketClusterRiskEmergingMarkets( this.exchangeRateDataService, marketsTotalInBaseCurrency, markets.emergingMarkets.valueInBaseCurrency diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts index 556d28340..288e2aba2 100644 --- a/apps/api/src/app/user/user.service.ts +++ b/apps/api/src/app/user/user.service.ts @@ -4,10 +4,10 @@ import { environment } from '@ghostfolio/api/environments/environment'; import { PortfolioChangedEvent } from '@ghostfolio/api/events/portfolio-changed.event'; import { AccountClusterRiskCurrentInvestment } from '@ghostfolio/api/models/rules/account-cluster-risk/current-investment'; import { AccountClusterRiskSingleAccount } from '@ghostfolio/api/models/rules/account-cluster-risk/single-account'; -import { AllocationClusterRiskDevelopedMarkets } from '@ghostfolio/api/models/rules/allocation-cluster-risk/developed-markets'; -import { AllocationClusterRiskEmergingMarkets } from '@ghostfolio/api/models/rules/allocation-cluster-risk/emerging-markets'; import { CurrencyClusterRiskBaseCurrencyCurrentInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/base-currency-current-investment'; import { CurrencyClusterRiskCurrentInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/current-investment'; +import { EconomicMarketClusterRiskDevelopedMarkets } from '@ghostfolio/api/models/rules/economic-market-cluster-risk/developed-markets'; +import { EconomicMarketClusterRiskEmergingMarkets } from '@ghostfolio/api/models/rules/economic-market-cluster-risk/emerging-markets'; import { EmergencyFundSetup } from '@ghostfolio/api/models/rules/emergency-fund/emergency-fund-setup'; import { FeeRatioInitialInvestment } from '@ghostfolio/api/models/rules/fees/fee-ratio-initial-investment'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; @@ -217,14 +217,14 @@ export class UserService { undefined, {} ).getSettings(user.Settings.settings), - AllocationClusterRiskDevelopedMarkets: - new AllocationClusterRiskDevelopedMarkets( + EconomicMarketClusterRiskDevelopedMarkets: + new EconomicMarketClusterRiskDevelopedMarkets( undefined, undefined, undefined ).getSettings(user.Settings.settings), - AllocationClusterRiskEmergingMarkets: - new AllocationClusterRiskEmergingMarkets( + EconomicMarketClusterRiskEmergingMarkets: + new EconomicMarketClusterRiskEmergingMarkets( undefined, undefined, undefined diff --git a/apps/api/src/models/rules/allocation-cluster-risk/developed-markets.ts b/apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts similarity index 95% rename from apps/api/src/models/rules/allocation-cluster-risk/developed-markets.ts rename to apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts index 068ebdda3..15e113927 100644 --- a/apps/api/src/models/rules/allocation-cluster-risk/developed-markets.ts +++ b/apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts @@ -3,7 +3,7 @@ import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { UserSettings } from '@ghostfolio/common/interfaces'; -export class AllocationClusterRiskDevelopedMarkets extends Rule { +export class EconomicMarketClusterRiskDevelopedMarkets extends Rule { private currentValueInBaseCurrency: number; private developedMarketsValueInBaseCurrency: number; @@ -13,7 +13,7 @@ export class AllocationClusterRiskDevelopedMarkets extends Rule { developedMarketsValueInBaseCurrency: number ) { super(exchangeRateDataService, { - key: AllocationClusterRiskDevelopedMarkets.name, + key: EconomicMarketClusterRiskDevelopedMarkets.name, name: 'Developed Markets' }); diff --git a/apps/api/src/models/rules/allocation-cluster-risk/emerging-markets.ts b/apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts similarity index 95% rename from apps/api/src/models/rules/allocation-cluster-risk/emerging-markets.ts rename to apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts index e7c107510..8fccdf1d8 100644 --- a/apps/api/src/models/rules/allocation-cluster-risk/emerging-markets.ts +++ b/apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts @@ -3,7 +3,7 @@ import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { UserSettings } from '@ghostfolio/common/interfaces'; -export class AllocationClusterRiskEmergingMarkets extends Rule { +export class EconomicMarketClusterRiskEmergingMarkets extends Rule { private currentValueInBaseCurrency: number; private emergingMarketsValueInBaseCurrency: number; @@ -13,7 +13,7 @@ export class AllocationClusterRiskEmergingMarkets extends Rule { emergingMarketsValueInBaseCurrency: number ) { super(exchangeRateDataService, { - key: AllocationClusterRiskEmergingMarkets.name, + key: EconomicMarketClusterRiskEmergingMarkets.name, name: 'Emerging Markets' }); diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts index ea83500c4..d20c66912 100644 --- a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts +++ b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts @@ -22,9 +22,9 @@ import { takeUntil } from 'rxjs/operators'; }) export class FirePageComponent implements OnDestroy, OnInit { public accountClusterRiskRules: PortfolioReportRule[]; - public allocationClusterRiskRules: PortfolioReportRule[]; public currencyClusterRiskRules: PortfolioReportRule[]; public deviceType: string; + public economicMarketClusterRiskRules: PortfolioReportRule[]; public emergencyFundRules: PortfolioReportRule[]; public feeRules: PortfolioReportRule[]; public fireWealth: Big; @@ -204,15 +204,15 @@ export class FirePageComponent implements OnDestroy, OnInit { } ) ?? null; - this.allocationClusterRiskRules = - portfolioReport.rules['allocationClusterRisk']?.filter( + this.currencyClusterRiskRules = + portfolioReport.rules['currencyClusterRisk']?.filter( ({ isActive }) => { return isActive; } ) ?? null; - this.currencyClusterRiskRules = - portfolioReport.rules['currencyClusterRisk']?.filter( + this.economicMarketClusterRiskRules = + portfolioReport.rules['economicMarketClusterRisk']?.filter( ({ isActive }) => { return isActive; } diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.html b/apps/client/src/app/pages/portfolio/fire/fire-page.html index 4eedca300..7a336b62f 100644 --- a/apps/client/src/app/pages/portfolio/fire/fire-page.html +++ b/apps/client/src/app/pages/portfolio/fire/fire-page.html @@ -176,7 +176,7 @@

- Allocation Cluster Risks + Economic Market Cluster Risks @if (user?.subscription?.type === 'Basic') { } @@ -188,7 +188,7 @@ user?.settings?.isExperimentalFeatures " [isLoading]="isLoadingPortfolioReport" - [rules]="allocationClusterRiskRules" + [rules]="economicMarketClusterRiskRules" [settings]="user?.settings?.xRayRules" (rulesUpdated)="onRulesUpdated($event)" /> diff --git a/libs/common/src/lib/interfaces/x-ray-rules-settings.interface.ts b/libs/common/src/lib/interfaces/x-ray-rules-settings.interface.ts index f38a8e6a9..579d589b6 100644 --- a/libs/common/src/lib/interfaces/x-ray-rules-settings.interface.ts +++ b/libs/common/src/lib/interfaces/x-ray-rules-settings.interface.ts @@ -1,10 +1,10 @@ export interface XRayRulesSettings { AccountClusterRiskCurrentInvestment?: RuleSettings; AccountClusterRiskSingleAccount?: RuleSettings; - AllocationClusterRiskDevelopedMarkets?: RuleSettings; - AllocationClusterRiskEmergingMarkets?: RuleSettings; CurrencyClusterRiskBaseCurrencyCurrentInvestment?: RuleSettings; CurrencyClusterRiskCurrentInvestment?: RuleSettings; + EconomicMarketClusterRiskDevelopedMarkets?: RuleSettings; + EconomicMarketClusterRiskEmergingMarkets?: RuleSettings; EmergencyFundSetup?: RuleSettings; FeeRatioInitialInvestment?: RuleSettings; }