Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Task/remove deprecated attributes from holdings of public portfolio endpoint response (#6923)
Thomas Kaul5b9df03a1e39
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7cee9179d8..c6b8e50a9f 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-21diff --git a/apps/api/src/app/endpoints/public/public.controller.ts b/apps/api/src/app/endpoints/public/public.controller.tsindex 1d6eb6b0b2..0488da3268 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.tsindex cb6f21e8a1..3b306c87bb 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.assetSubClassdiff --git a/apps/client/src/app/pages/public/public-page.component.ts b/apps/client/src/app/pages/public/public-page.component.tsindex c12a2d5dea..43eb23eb94 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.valueInBaseCurrencydiff --git a/libs/common/src/lib/interfaces/responses/public-portfolio-response.interface.ts b/libs/common/src/lib/interfaces/responses/public-portfolio-response.interface.tsindex eae14cec6d..18c7dc57ab 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.htmlindex 46fc0216dd..f196465525 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 @@<th *matHeaderCellDef class="px-1" mat-header-cell></th><td *matCellDef="let element" class="px-1 text-center" mat-cell><gf-entity-logo- [dataSource]="element.dataSource"- [symbol]="element.symbol"- [tooltip]="element.name"+ [dataSource]="element.assetProfile.dataSource"+ [symbol]="element.assetProfile.symbol"+ [tooltip]="element.assetProfile.name"/></td></ng-container><ng-container matColumnDef="nameWithSymbol">- <th *matHeaderCellDef class="px-1" mat-header-cell mat-sort-header="name">+ <th+ *matHeaderCellDef+ class="px-1"+ mat-header-cell+ mat-sort-header="assetProfile.name"+ ><ng-container i18n>Name</ng-container></th><td *matCellDef="let element" class="line-height-1 px-1" mat-cell><div class="text-truncate">- {{ element.name }}- @if (element.name === element.symbol) {+ {{ element.assetProfile.name }}+ @if (element.assetProfile.name === element.assetProfile.symbol) {<span>({{ element.assetProfile.assetSubClassLabel }})</span>}</div><div>- <small class="text-muted">{{ element.symbol }}</small>+ <small class="text-muted">{{ element.assetProfile.symbol }}</small></div></td></ng-container>@@ -185,8 +190,8 @@(click)="canShowDetails(row) &&onOpenHoldingDialog({- dataSource: row.dataSource,- symbol: row.symbol+ dataSource: row.assetProfile.dataSource,+ symbol: row.assetProfile.symbol})"></tr>