Skip to content

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

Bugfix/fix mapping for russia in trackinsight data enhancer (#610)

Thomas Kaul1e526852a757
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 46be289e20..01065cac58 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 d7dfb3b425..a469e57a56 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<any>(
TrackinsightDataEnhancerService.countries
)) {
- if (country.name === name) {
+ if (
+ country.name === name ||
+ country.name ===
+ TrackinsightDataEnhancerService.countriesMapping[name]
+ ) {
countryCode = key;
break;
}