Browse Source
Bugfix/fix currency inconsistency with conversion of ZAR to ZAc (#2869)
* Fix conversion from ZAR to ZAc
* Update changelog
pull/2871/head
Thomas Kaul
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
0 deletions
-
CHANGELOG.md
-
apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts
|
|
@ -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 |
|
|
|
|
|
|
|
|
|
@ -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; |
|
|
|