Browse Source

Merge branch 'main' into task/extract-account-selector-to-reusable-component

pull/7653/head
Thomas Kaul 14 hours ago
committed by GitHub
parent
commit
f63c6ecb10
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      CHANGELOG.md
  2. 8
      apps/api/src/helper/country.helper.ts
  3. 4
      apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts
  4. 1
      apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
  5. 18
      apps/api/src/services/data-provider/data-provider.service.ts
  6. 1
      apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts
  7. 15
      libs/common/src/lib/helper.ts

5
CHANGELOG.md

@ -9,9 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Moved the improved symbol lookup results by removing the currency from the name of cryptocurrencies from experimental to general availability
- Extracted the account selector to a reusable component - Extracted the account selector to a reusable component
- Upgraded `ng-extract-i18n-merge` from `3.3.0` to `3.4.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 ## 3.53.0 - 2026-08-16
### Changed ### Changed

8
apps/api/src/helper/country.helper.ts

@ -3,9 +3,11 @@ import { countries } from 'countries-list';
export function getCountryCodeByName({ export function getCountryCodeByName({
aliases = {}, aliases = {},
dataSource,
name name
}: { }: {
aliases?: Record<string, string>; aliases?: Record<string, string>;
dataSource?: string;
name: string; name: string;
}): string { }): string {
if (aliases[name]) { if (aliases[name]) {
@ -21,7 +23,11 @@ export function getCountryCodeByName({
if (name && name.toLowerCase() !== 'other') { if (name && name.toLowerCase() !== 'other') {
const logger = new Logger('getCountryCodeByName'); 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; return undefined;

4
apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts

@ -17,6 +17,7 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface {
private static countriesMapping = { private static countriesMapping = {
'Czech Republic': 'CZ', 'Czech Republic': 'CZ',
Macau: 'MO',
'Republic of Korea': 'KR', 'Republic of Korea': 'KR',
'Russian Federation': 'RU', 'Russian Federation': 'RU',
Turkey: 'TR', Turkey: 'TR',
@ -128,7 +129,8 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface {
)) { )) {
const code = getCountryCodeByName({ const code = getCountryCodeByName({
name, name,
aliases: TrackinsightDataEnhancerService.countriesMapping aliases: TrackinsightDataEnhancerService.countriesMapping,
dataSource: this.getName()
}); });
if (code) { if (code) {

1
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({ const code = getCountryCodeByName({
aliases: YahooFinanceDataEnhancerService.countriesMapping, aliases: YahooFinanceDataEnhancerService.countriesMapping,
dataSource: this.getName(),
name: assetProfile.summaryProfile.country name: assetProfile.summaryProfile.country
}); });

18
apps/api/src/services/data-provider/data-provider.service.ts

@ -17,6 +17,7 @@ import { CreateOrderDto } from '@ghostfolio/common/dtos';
import { SubscriptionType } from '@ghostfolio/common/enums'; import { SubscriptionType } from '@ghostfolio/common/enums';
import { import {
DATE_FORMAT, DATE_FORMAT,
formatAssetProfileName,
getAssetProfileIdentifier, getAssetProfileIdentifier,
getCurrencyFromSymbol, getCurrencyFromSymbol,
getStartOfUtcDate, getStartOfUtcDate,
@ -125,7 +126,11 @@ export class DataProviderService implements OnModuleInit {
symbol, symbol,
dataSource: DataSource[dataSource] dataSource: DataSource[dataSource]
}) })
] = { ...assetProfile, symbol }; ] = {
...assetProfile,
symbol,
name: formatAssetProfileName(assetProfile)
};
} }
}) })
); );
@ -897,16 +902,7 @@ export class DataProviderService implements OnModuleInit {
lookupItem.dataProviderInfo.isPremium = false; lookupItem.dataProviderInfo.isPremium = false;
} }
if ( lookupItem.name = formatAssetProfileName(lookupItem);
lookupItem.assetSubClass === 'CRYPTOCURRENCY' &&
user?.settings?.settings.isExperimentalFeatures
) {
// Remove DEFAULT_CURRENCY at the end of cryptocurrency names
lookupItem.name = lookupItem.name.replace(
new RegExp(` ${DEFAULT_CURRENCY}$`),
''
);
}
return lookupItem; return lookupItem;
}) })

1
apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts

@ -175,6 +175,7 @@ export class FinancialModelingPrepService
return { return {
code: getCountryCodeByName({ code: getCountryCodeByName({
aliases: FinancialModelingPrepService.countriesMapping, aliases: FinancialModelingPrepService.countriesMapping,
dataSource: this.getName(),
name: countryName name: countryName
}), }),
weight: parseFloat(`${weightPercentage}`) / 100 weight: parseFloat(`${weightPercentage}`) / 100

15
libs/common/src/lib/helper.ts

@ -261,6 +261,21 @@ export function extractNumberFromString({
} }
} }
export function formatAssetProfileName({
assetSubClass,
name
}: {
assetSubClass?: AssetSubClass;
name?: string;
}) {
if (assetSubClass === 'CRYPTOCURRENCY') {
// Remove DEFAULT_CURRENCY at the end of cryptocurrency names
return name?.replace(new RegExp(` ${DEFAULT_CURRENCY}$`), '');
}
return name;
}
export function formatMonthAndYear({ export function formatMonthAndYear({
date, date,
locale locale

Loading…
Cancel
Save