diff --git a/CHANGELOG.md b/CHANGELOG.md index 3691a51f1..b5a637552 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed the currency in the error log of the exchange rate data service +- Fixed an issue with the currency inconsistency in the _EOD Historical Data_ service (convert from `ZAR` to `ZAc`) ## 2.38.0 - 2024-01-13 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 76e8ce9c6..24607ab4d 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 @@ -235,6 +235,17 @@ export class EodHistoricalDataService implements DataProviderInterface { }; } + if (response[`${DEFAULT_CURRENCY}ZAR`]) { + response[`${DEFAULT_CURRENCY}ZAc`] = { + ...response[`${DEFAULT_CURRENCY}ZAR`], + currency: 'ZAc', + marketPrice: this.getConvertedValue({ + symbol: `${DEFAULT_CURRENCY}ZAc`, + value: response[`${DEFAULT_CURRENCY}ZAR`].marketPrice + }) + }; + } + return response; } catch (error) { let message = error; @@ -350,6 +361,9 @@ export class EodHistoricalDataService implements DataProviderInterface { } else if (symbol === `${DEFAULT_CURRENCY}ILA`) { // Convert ILS to ILA return new Big(value).mul(100).toNumber(); + } else if (symbol === `${DEFAULT_CURRENCY}ZAc`) { + // Convert ZAR to ZAc + return new Big(value).mul(100).toNumber(); } return value;