Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Bugfix/fix currency conversion of ila to ils (#1026)
Thomas Kaul161015042797
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 485a29529b..4fc7ded655 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).+## Unreleased++### Fixed++- Fixed an issue with the currency inconsistency in the _Yahoo Finance_ service (convert from `ILA` to `ILS`)+## 1.161.1 - 16.06.2022### Addeddiff --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.tsindex 81f8c43fc1..b2c79284bb 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@@ -181,6 +181,9 @@ export class YahooFinanceService implements DataProviderInterface {if (symbol === 'USDGBp') {// Convert GPB to GBp (pence)marketPrice = new Big(marketPrice).mul(100).toNumber();+ } else if (symbol === 'USDILA') {+ // Convert ILS to ILA+ marketPrice = new Big(marketPrice).mul(100).toNumber();}response[symbol][format(historicalItem.date, DATE_FORMAT)] = {@@ -243,6 +246,18 @@ export class YahooFinanceService implements DataProviderInterface {.mul(100).toNumber()};+ } else if (+ symbol === 'USDILS' &&+ yahooFinanceSymbols.includes('USDILA=X')+ ) {+ // Convert ILS to ILA+ response['USDILA'] = {+ ...response[symbol],+ currency: 'ILA',+ marketPrice: new Big(response[symbol].marketPrice)+ .mul(100)+ .toNumber()+ };}}