Browse Source

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

* Deprecate SymbolProfile in favor of assetProfile

* Update changelog
pull/7062/head
Thomas Kaul 4 days ago
committed by GitHub
parent
commit
bab02b3d68
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 12
      apps/api/src/app/portfolio/portfolio.service.ts
  3. 1
      apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts
  4. 16
      libs/common/src/lib/interfaces/responses/portfolio-holding-response.interface.ts

1
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`

12
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(),

1
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',

16
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;
}

Loading…
Cancel
Save