Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/deprecate SymbolProfile in favor of assetProfile in get holding endpoint (#7054)

Thomas Kaulbab02b3d68d7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0ea139fc07..9abb2bc2be 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved the account name display in the accounts table
- Improved the name display in the activities table
- Improved the user id display in the users table of the admin control panel
+- Deprecated `SymbolProfile` in favor of `assetProfile` in the endpoint `GET api/v1/portfolio/holding/:dataSource/:symbol`
- Improved the language localization for German (`de`)
- Upgraded `svgmap` from version `2.19.3` to `2.21.0`
diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts
index 24d760888f..c153535219 100644
--- a/apps/api/src/app/portfolio/portfolio.service.ts
+++ b/apps/api/src/app/portfolio/portfolio.service.ts
@@ -957,6 +957,18 @@ export class PortfolioService {
marketPriceMin,
SymbolProfile,
tags,
+ assetProfile: {
+ assetClass: SymbolProfile.assetClass,
+ assetSubClass: SymbolProfile.assetSubClass,
+ countries: SymbolProfile.countries,
+ currency: SymbolProfile.currency,
+ dataSource: SymbolProfile.dataSource,
+ isin: SymbolProfile.isin,
+ name: SymbolProfile.name,
+ sectors: SymbolProfile.sectors,
+ symbol: SymbolProfile.symbol,
+ userId: SymbolProfile.userId
+ },
averagePrice: averagePrice.toNumber(),
dataProviderInfo: portfolioCalculator.getDataProviderInfos()?.[0],
dividendInBaseCurrency: dividendInBaseCurrency.toNumber(),
diff --git a/apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts b/apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts
index 57643f76c9..fb8ff5dc56 100644
--- a/apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts
+++ b/apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts
@@ -64,6 +64,7 @@ export class TransformDataSourceInResponseInterceptor<
paths: [
'activities[*].dataSource',
'activities[*].SymbolProfile.dataSource',
+ 'assetProfile.dataSource',
'benchmarks[*].dataSource',
'errors[*].dataSource',
'fearAndGreedIndex.CRYPTOCURRENCIES.dataSource',
diff --git a/libs/common/src/lib/interfaces/responses/portfolio-holding-response.interface.ts b/libs/common/src/lib/interfaces/responses/portfolio-holding-response.interface.ts
index 76bc7dc028..3b07666c9d 100644
--- a/libs/common/src/lib/interfaces/responses/portfolio-holding-response.interface.ts
+++ b/libs/common/src/lib/interfaces/responses/portfolio-holding-response.interface.ts
@@ -9,6 +9,19 @@ import { Tag } from '@prisma/client';
export interface PortfolioHoldingResponse {
activitiesCount: number;
+ assetProfile: Pick<
+ EnhancedSymbolProfile,
+ | 'assetClass'
+ | 'assetSubClass'
+ | 'countries'
+ | 'currency'
+ | 'dataSource'
+ | 'isin'
+ | 'name'
+ | 'sectors'
+ | 'symbol'
+ | 'userId'
+ >;
averagePrice: number;
dataProviderInfo: DataProviderInfo;
dateOfFirstActivity: string;
@@ -31,7 +44,10 @@ export interface PortfolioHoldingResponse {
netPerformanceWithCurrencyEffect: number;
performances: Benchmark['performances'];
quantity: number;
+
+ /* @deprecated */
SymbolProfile: EnhancedSymbolProfile;
+
tags: Tag[];
value: number;
}