From 1e526852a7573086073069d26851282d991da4fe Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 1 Jan 2022 13:55:53 +0100 Subject: [PATCH] Bugfix/fix mapping for russia in trackinsight data enhancer (#610) * Fix mapping for Russia * Update changelog --- CHANGELOG.md | 1 + .../data-enhancer/trackinsight/trackinsight.service.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46be289e2..01065cac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an exception with the market state caused by a failed data provider request - Fixed an exception in the portfolio position endpoint - Fixed the reload of the position detail dialog (with query parameters) +- Fixed the missing mapping for Russia in the data enhancer for symbol profile data via _Trackinsight_ ## 1.98.0 - 29.12.2021 diff --git a/apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts b/apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts index d7dfb3b42..a469e57a5 100644 --- a/apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts +++ b/apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts @@ -7,6 +7,9 @@ const getJSON = bent('json'); export class TrackinsightDataEnhancerService implements DataEnhancerInterface { private static baseUrl = 'https://data.trackinsight.com/holdings'; private static countries = require('countries-list/dist/countries.json'); + private static countriesMapping = { + 'Russian Federation': 'Russia' + }; private static sectorsMapping = { 'Consumer Discretionary': 'Consumer Cyclical', 'Consumer Defensive': 'Consumer Staples', @@ -45,7 +48,11 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface { for (const [key, country] of Object.entries( TrackinsightDataEnhancerService.countries )) { - if (country.name === name) { + if ( + country.name === name || + country.name === + TrackinsightDataEnhancerService.countriesMapping[name] + ) { countryCode = key; break; }