From 693791d113750c287670ce00753c9fd2ed2fa6b6 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:03:31 +0100 Subject: [PATCH] Feature/add validation of search results in eod historical data service (#2883) * Validate currency * Update changelog --- CHANGELOG.md | 1 + .../eod-historical-data/eod-historical-data.service.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59c1e176a..56e0d9385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added the holdings table to the account detail dialog +- Validated the currency of the search results in the _EOD Historical Data_ service ## 2.40.0 - 2024-01-15 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 24607ab4d..649b0c354 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 @@ -277,8 +277,9 @@ export class EodHistoricalDataService implements DataProviderInterface { return { items: searchResult - .filter(({ symbol }) => { - return !symbol.endsWith('.FOREX'); + .filter(({ currency, symbol }) => { + // Remove 'NA' currency and exchange rates + return currency?.length === 3 && !symbol.endsWith('.FOREX'); }) .map( ({