From 68e558f198d5749421648fca28e264c18ac67ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bjergmark?= Date: Thu, 29 Feb 2024 20:45:40 +0100 Subject: [PATCH] Feature/Improve activities import by ISIN number (#3051) * Improve activities import by ISIN number * Update changelog --- CHANGELOG.md | 4 ++++ .../yahoo-finance/yahoo-finance.service.ts | 4 +++- .../yahoo-finance/yahoo-finance.service.ts | 12 +----------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b8671505..55a80a9fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed + +- Improved the activities import by `isin` in the _Yahoo Finance_ service + ### Fixed - Fixed an issue with the exchange rate calculation of (wealth) items in accounts diff --git a/apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts b/apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts index ccb5e2a64..c6edef0ca 100644 --- a/apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts +++ b/apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts @@ -196,7 +196,9 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { shortName: assetProfile.price.shortName, symbol: assetProfile.price.symbol }); - response.symbol = assetProfile.price.symbol; + response.symbol = this.convertFromYahooFinanceSymbol( + assetProfile.price.symbol + ); if (assetSubClass === AssetSubClass.MUTUALFUND) { response.sectors = []; diff --git a/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts b/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts index b6148d431..c55da2597 100644 --- a/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts +++ b/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts @@ -38,17 +38,7 @@ export class YahooFinanceService implements DataProviderInterface { }: { symbol: string; }): Promise> { - const { assetClass, assetSubClass, currency, name } = - await this.yahooFinanceDataEnhancerService.getAssetProfile(symbol); - - return { - assetClass, - assetSubClass, - currency, - name, - symbol, - dataSource: this.getName() - }; + return this.yahooFinanceDataEnhancerService.getAssetProfile(symbol); } public getDataProviderInfo(): DataProviderInfo {