diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cee9179d..c6b8e50a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Removed the deprecated attributes (`assetClass`, `countries`, `currency`, `dataSource`, `name`, `sectors`, `symbol` and `url`) from the holdings of the public portfolio endpoint response - Upgraded `@keyv/redis` from version `4.4.0` to `5.1.6` ## 3.4.0 - 2026-05-21 diff --git a/apps/api/src/app/endpoints/public/public.controller.ts b/apps/api/src/app/endpoints/public/public.controller.ts index 1d6eb6b0b..0488da326 100644 --- a/apps/api/src/app/endpoints/public/public.controller.ts +++ b/apps/api/src/app/endpoints/public/public.controller.ts @@ -167,19 +167,25 @@ export class PublicController { publicPortfolioResponse.holdings[symbol] = { allocationInPercentage: portfolioPosition.valueInBaseCurrency / totalValue, - assetClass: hasDetails ? portfolioPosition.assetClass : undefined, - assetProfile: hasDetails ? portfolioPosition.assetProfile : undefined, - countries: hasDetails ? portfolioPosition.countries : [], - currency: hasDetails ? portfolioPosition.currency : undefined, - dataSource: portfolioPosition.dataSource, + assetProfile: { + ...portfolioPosition.assetProfile, + ...(hasDetails + ? {} + : { + assetClass: undefined, + assetClassLabel: undefined, + assetSubClass: undefined, + assetSubClassLabel: undefined, + countries: [], + currency: undefined, + holdings: [], + sectors: [] + }) + }, dateOfFirstActivity: portfolioPosition.dateOfFirstActivity, markets: hasDetails ? portfolioPosition.markets : undefined, - name: portfolioPosition.name, netPerformancePercentWithCurrencyEffect: portfolioPosition.netPerformancePercentWithCurrencyEffect, - sectors: hasDetails ? portfolioPosition.sectors : [], - symbol: portfolioPosition.symbol, - url: portfolioPosition.url, valueInPercentage: portfolioPosition.valueInBaseCurrency / totalValue }; } diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index cb6f21e8a..3b306c87b 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -220,6 +220,21 @@ export class PortfolioController { hasDetails || portfolioPosition.assetClass === AssetClass.LIQUIDITY ? portfolioPosition.assetClass : undefined, + assetProfile: { + ...portfolioPosition.assetProfile, + ...(hasDetails + ? {} + : { + assetClass: undefined, + assetClassLabel: undefined, + assetSubClass: undefined, + assetSubClassLabel: undefined, + countries: [], + currency: undefined, + holdings: [], + sectors: [] + }) + }, assetSubClass: hasDetails || portfolioPosition.assetSubClass === AssetSubClass.CASH ? portfolioPosition.assetSubClass diff --git a/apps/client/src/app/pages/public/public-page.component.ts b/apps/client/src/app/pages/public/public-page.component.ts index c12a2d5de..43eb23eb9 100644 --- a/apps/client/src/app/pages/public/public-page.component.ts +++ b/apps/client/src/app/pages/public/public-page.component.ts @@ -172,16 +172,16 @@ export class GfPublicPageComponent implements OnInit { this.holdings.push(position); this.positions[symbol] = { - currency: position.currency, - name: position.name, + currency: position.assetProfile.currency, + name: position.assetProfile.name, value: position.allocationInPercentage }; - if (position.assetClass !== AssetClass.LIQUIDITY) { + if (position.assetProfile.assetClass !== AssetClass.LIQUIDITY) { // Prepare analysis data by continents, countries, holdings and sectors except for liquidity - if (position.countries.length > 0) { - for (const country of position.countries) { + if (position.assetProfile.countries.length > 0) { + for (const country of position.assetProfile.countries) { const { code, continent, name, weight } = country; if (this.continents[continent]?.value) { @@ -220,8 +220,8 @@ export class GfPublicPageComponent implements OnInit { 0; } - if (position.sectors.length > 0) { - for (const sector of position.sectors) { + if (position.assetProfile.sectors.length > 0) { + for (const sector of position.assetProfile.sectors) { const { name, weight } = sector; if (this.sectors[name]?.value) { @@ -245,7 +245,7 @@ export class GfPublicPageComponent implements OnInit { } this.symbols[prettifySymbol(symbol)] = { - name: position.name, + name: position.assetProfile.name, symbol: prettifySymbol(symbol), value: isNumber(position.valueInBaseCurrency) ? position.valueInBaseCurrency diff --git a/libs/common/src/lib/interfaces/responses/public-portfolio-response.interface.ts b/libs/common/src/lib/interfaces/responses/public-portfolio-response.interface.ts index eae14cec6..18c7dc57a 100644 --- a/libs/common/src/lib/interfaces/responses/public-portfolio-response.interface.ts +++ b/libs/common/src/lib/interfaces/responses/public-portfolio-response.interface.ts @@ -14,32 +14,10 @@ export interface PublicPortfolioResponse extends PublicPortfolioResponseV1 { [symbol: string]: Pick< PortfolioPosition, | 'allocationInPercentage' - - /** @deprecated */ - | 'assetClass' | 'assetProfile' - - /** @deprecated */ - | 'countries' - | 'currency' - - /** @deprecated */ - | 'dataSource' | 'dateOfFirstActivity' | 'markets' - - /** @deprecated */ - | 'name' | 'netPerformancePercentWithCurrencyEffect' - - /** @deprecated */ - | 'sectors' - - /** @deprecated */ - | 'symbol' - - /** @deprecated */ - | 'url' | 'valueInBaseCurrency' | 'valueInPercentage' >; diff --git a/libs/ui/src/lib/holdings-table/holdings-table.component.html b/libs/ui/src/lib/holdings-table/holdings-table.component.html index 46fc0216d..f19646552 100644 --- a/libs/ui/src/lib/holdings-table/holdings-table.component.html +++ b/libs/ui/src/lib/holdings-table/holdings-table.component.html @@ -11,26 +11,31 @@