From 8292699afb68ed8e44dda4e4feded445f4e23229 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 17 Aug 2026 20:46:35 +0200 Subject: [PATCH] Bugfix/add missing country mapping for Macau in Trackinsight data enhancer (#7651) * Add missing country mapping for Macau * Update changelog --- CHANGELOG.md | 4 ++++ apps/api/src/helper/country.helper.ts | 8 +++++++- .../data-enhancer/trackinsight/trackinsight.service.ts | 4 +++- .../data-enhancer/yahoo-finance/yahoo-finance.service.ts | 1 + .../financial-modeling-prep.service.ts | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e49a4967..b052e2d10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgraded `ng-extract-i18n-merge` from `3.3.0` to `3.4.0` +### Fixed + +- Fixed the missing mapping for Macau in the data enhancer for asset profile data via _Trackinsight_ + ## 3.53.0 - 2026-08-16 ### Changed diff --git a/apps/api/src/helper/country.helper.ts b/apps/api/src/helper/country.helper.ts index 2e6da5340..119f5e44c 100644 --- a/apps/api/src/helper/country.helper.ts +++ b/apps/api/src/helper/country.helper.ts @@ -3,9 +3,11 @@ import { countries } from 'countries-list'; export function getCountryCodeByName({ aliases = {}, + dataSource, name }: { aliases?: Record; + dataSource?: string; name: string; }): string { if (aliases[name]) { @@ -21,7 +23,11 @@ export function getCountryCodeByName({ if (name && name.toLowerCase() !== 'other') { const logger = new Logger('getCountryCodeByName'); - logger.warn(`Could not map the country "${name}" to a code`); + logger.warn( + `Could not map the country "${name}" to a code${ + dataSource ? ` (${dataSource})` : '' + }` + ); } return undefined; 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 7f58448b7..23a8ce33c 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 @@ -17,6 +17,7 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface { private static countriesMapping = { 'Czech Republic': 'CZ', + Macau: 'MO', 'Republic of Korea': 'KR', 'Russian Federation': 'RU', Turkey: 'TR', @@ -128,7 +129,8 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface { )) { const code = getCountryCodeByName({ name, - aliases: TrackinsightDataEnhancerService.countriesMapping + aliases: TrackinsightDataEnhancerService.countriesMapping, + dataSource: this.getName() }); if (code) { 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 77e83b271..cd4a0436e 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 @@ -254,6 +254,7 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { const code = getCountryCodeByName({ aliases: YahooFinanceDataEnhancerService.countriesMapping, + dataSource: this.getName(), name: assetProfile.summaryProfile.country }); diff --git a/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts b/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts index 2fd101396..c768de070 100644 --- a/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts +++ b/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts @@ -175,6 +175,7 @@ export class FinancialModelingPrepService return { code: getCountryCodeByName({ aliases: FinancialModelingPrepService.countriesMapping, + dataSource: this.getName(), name: countryName }), weight: parseFloat(`${weightPercentage}`) / 100