From 50fb82a6e6c66894a9eefc621c6aab01e2ccb217 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 26 Jan 2024 22:37:26 +0100 Subject: [PATCH 1/2] Extend personal finance tools (#2925) --- apps/api/src/assets/sitemap.xml | 16 ++++++++++ .../personal-finance-tools/products.ts | 9 ++++++ .../products/wealthfolio-page.component.ts | 32 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 apps/client/src/app/pages/resources/personal-finance-tools/products/wealthfolio-page.component.ts diff --git a/apps/api/src/assets/sitemap.xml b/apps/api/src/assets/sitemap.xml index 232c4720a..bd80c7f34 100644 --- a/apps/api/src/assets/sitemap.xml +++ b/apps/api/src/assets/sitemap.xml @@ -230,6 +230,10 @@ https://ghostfol.io/de/ressourcen/personal-finance-tools/open-source-alternative-zu-vyzer ${currentDate}T00:00:00+00:00 + + https://ghostfol.io/de/ressourcen/personal-finance-tools/open-source-alternative-zu-wealthfolio + ${currentDate}T00:00:00+00:00 + https://ghostfol.io/de/ressourcen/personal-finance-tools/open-source-alternative-zu-wealthica ${currentDate}T00:00:00+00:00 @@ -568,6 +572,10 @@ https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-vyzer ${currentDate}T00:00:00+00:00 + + https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-wealthfolio + ${currentDate}T00:00:00+00:00 + https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-wealthica ${currentDate}T00:00:00+00:00 @@ -926,6 +934,10 @@ https://ghostfol.io/it/risorse/personal-finance-tools/alternativa-open-source-a-vyzer ${currentDate}T00:00:00+00:00 + + https://ghostfol.io/it/risorse/personal-finance-tools/alternativa-open-source-a-wealthfolio + ${currentDate}T00:00:00+00:00 + https://ghostfol.io/it/risorse/personal-finance-tools/alternativa-open-source-a-wealthica ${currentDate}T00:00:00+00:00 @@ -1130,6 +1142,10 @@ https://ghostfol.io/nl/bronnen/personal-finance-tools/open-source-alternatief-voor-vyzer ${currentDate}T00:00:00+00:00 + + https://ghostfol.io/nl/bronnen/personal-finance-tools/open-source-alternatief-voor-wealthfolio + ${currentDate}T00:00:00+00:00 + https://ghostfol.io/nl/bronnen/personal-finance-tools/open-source-alternatief-voor-wealthica ${currentDate}T00:00:00+00:00 diff --git a/apps/client/src/app/pages/resources/personal-finance-tools/products.ts b/apps/client/src/app/pages/resources/personal-finance-tools/products.ts index c4e6380ce..20f190a55 100644 --- a/apps/client/src/app/pages/resources/personal-finance-tools/products.ts +++ b/apps/client/src/app/pages/resources/personal-finance-tools/products.ts @@ -44,6 +44,7 @@ import { SumioPageComponent } from './products/sumio-page.component'; import { TillerPageComponent } from './products/tiller-page.component'; import { UtlunaPageComponent } from './products/utluna-page.component'; import { VyzerPageComponent } from './products/vyzer-page.component'; +import { WealthfolioPageComponent } from './products/wealthfolio-page.component'; import { WealthicaPageComponent } from './products/wealthica-page.component'; import { WhalPageComponent } from './products/whal-page.component'; import { YeekateePageComponent } from './products/yeekatee-page.component'; @@ -528,6 +529,14 @@ export const products: Product[] = [ pricingPerYear: '$348', slogan: 'Virtual Family Office for Smart Wealth Management' }, + { + component: WealthfolioPageComponent, + hasSelfHostingAbility: true, + key: 'wealthfolio', + languages: ['English'], + name: 'Wealthfolio', + slogan: 'Desktop Investment Tracker' + }, { component: WealthicaPageComponent, founded: 2015, diff --git a/apps/client/src/app/pages/resources/personal-finance-tools/products/wealthfolio-page.component.ts b/apps/client/src/app/pages/resources/personal-finance-tools/products/wealthfolio-page.component.ts new file mode 100644 index 000000000..d888e2f93 --- /dev/null +++ b/apps/client/src/app/pages/resources/personal-finance-tools/products/wealthfolio-page.component.ts @@ -0,0 +1,32 @@ +import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { RouterModule } from '@angular/router'; + +import { products } from '../products'; +import { BaseProductPageComponent } from './base-page.component'; + +@Component({ + host: { class: 'page' }, + imports: [CommonModule, MatButtonModule, RouterModule], + selector: 'gf-wealthfolio-page', + standalone: true, + styleUrls: ['../product-page-template.scss'], + templateUrl: '../product-page-template.html' +}) +export class WealthfolioPageComponent extends BaseProductPageComponent { + public product1 = products.find(({ key }) => { + return key === 'ghostfolio'; + }); + + public product2 = products.find(({ key }) => { + return key === 'wealthfolio'; + }); + + public routerLinkAbout = ['/' + $localize`about`]; + public routerLinkFeatures = ['/' + $localize`features`]; + public routerLinkResourcesPersonalFinanceTools = [ + '/' + $localize`resources`, + 'personal-finance-tools' + ]; +} From 8f5f4c5875362f71bf8843968dbd7ea8eb96a436 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 26 Jan 2024 22:37:47 +0100 Subject: [PATCH 2/2] Feature/format name in eod historical data service (#2922) * Format name * Update changelog --- CHANGELOG.md | 1 + .../yahoo-finance/yahoo-finance.service.ts | 23 ++++++++----------- .../eod-historical-data.service.ts | 19 +++++++++++++-- libs/common/src/lib/config.ts | 15 ++++++++++++ 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6752784fa..9b16b7b8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Formatted the name in the _EOD Historical Data_ service - Improved the language localization for German (`de`) ### Fixed 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 930e0c7f1..f2a136151 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 @@ -1,7 +1,11 @@ import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { CryptocurrencyService } from '@ghostfolio/api/services/cryptocurrency/cryptocurrency.service'; import { DataEnhancerInterface } from '@ghostfolio/api/services/data-provider/interfaces/data-enhancer.interface'; -import { DEFAULT_CURRENCY, UNKNOWN_KEY } from '@ghostfolio/common/config'; +import { + DEFAULT_CURRENCY, + REPLACE_NAME_PARTS, + UNKNOWN_KEY +} from '@ghostfolio/common/config'; import { isCurrency } from '@ghostfolio/common/helper'; import { Injectable, Logger } from '@nestjs/common'; import { @@ -137,18 +141,11 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { if (name) { name = name.replace('&', '&'); - name = name.replace('Amundi Index Solutions - ', ''); - name = name.replace('iShares ETF (CH) - ', ''); - name = name.replace('iShares III Public Limited Company - ', ''); - name = name.replace('iShares V PLC - ', ''); - name = name.replace('iShares VI Public Limited Company - ', ''); - name = name.replace('iShares VII PLC - ', ''); - name = name.replace('Multi Units Luxembourg - ', ''); - name = name.replace('VanEck ETFs N.V. - ', ''); - name = name.replace('Vaneck Vectors Ucits Etfs Plc - ', ''); - name = name.replace('Vanguard Funds Public Limited Company - ', ''); - name = name.replace('Vanguard Index Funds - ', ''); - name = name.replace('Xtrackers (IE) Plc - ', ''); + for (const part of REPLACE_NAME_PARTS) { + name = name.replace(part, ''); + } + + name = name.trim(); } if (quoteType === 'FUTURE') { diff --git a/apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts b/apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts index 39457320f..bcff104c0 100644 --- a/apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts +++ b/apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts @@ -11,7 +11,10 @@ import { IDataProviderHistoricalResponse, IDataProviderResponse } from '@ghostfolio/api/services/interfaces/interfaces'; -import { DEFAULT_CURRENCY } from '@ghostfolio/common/config'; +import { + DEFAULT_CURRENCY, + REPLACE_NAME_PARTS +} from '@ghostfolio/common/config'; import { DATE_FORMAT, isCurrency } from '@ghostfolio/common/helper'; import { Injectable, Logger } from '@nestjs/common'; import { @@ -362,6 +365,18 @@ export class EodHistoricalDataService implements DataProviderInterface { return aSymbol; } + private formatName({ name }: { name: string }) { + if (name) { + for (const part of REPLACE_NAME_PARTS) { + name = name.replace(part, ''); + } + + name = name.trim(); + } + + return name; + } + private async getSearchResult(aQuery: string): Promise< (LookupItem & { assetClass: AssetClass; @@ -397,9 +412,9 @@ export class EodHistoricalDataService implements DataProviderInterface { assetClass, assetSubClass, isin, - name, currency: this.convertCurrency(Currency), dataSource: this.getName(), + name: this.formatName({ name }), symbol: `${Code}.${Exchange}` }; } diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.ts index df89ae9e9..b93d22f45 100644 --- a/libs/common/src/lib/config.ts +++ b/libs/common/src/lib/config.ts @@ -112,6 +112,21 @@ export const QUEUE_JOB_STATUS_LIST = [ 'waiting' ]; +export const REPLACE_NAME_PARTS = [ + 'Amundi Index Solutions -', + 'iShares ETF (CH) -', + 'iShares III Public Limited Company -', + 'iShares V PLC -', + 'iShares VI Public Limited Company -', + 'iShares VII PLC -', + 'Multi Units Luxembourg -', + 'VanEck ETFs N.V. -', + 'Vaneck Vectors Ucits Etfs Plc -', + 'Vanguard Funds Public Limited Company -', + 'Vanguard Index Funds -', + 'Xtrackers (IE) Plc -' +]; + export const SUPPORTED_LANGUAGE_CODES = [ 'de', 'en',