Browse Source
Bugfix/fix issue with currency detection in Yahoo Finance service (#5250)
* Improve currency detection
* Extend tests
* Update changelog
pull/5251/head
Thomas Kaul
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
23 additions and
1 deletions
-
CHANGELOG.md
-
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.spec.ts
-
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
|
@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
- Fixed the date format of the retirement date in the _FIRE_ calculator |
|
|
- Fixed the date format of the retirement date in the _FIRE_ calculator |
|
|
- Fixed an issue with the permissions of the impersonation mode related to the onboarding on the overview tab of the home page |
|
|
- Fixed an issue with the permissions of the impersonation mode related to the onboarding on the overview tab of the home page |
|
|
- Fixed an issue with the permissions of the impersonation mode related to the manage activities button of the holdings tab on the home page |
|
|
- Fixed an issue with the permissions of the impersonation mode related to the manage activities button of the holdings tab on the home page |
|
|
|
|
|
- Fixed an issue with the currency detection related to `USD.AX` in the _Yahoo Finance_ service |
|
|
|
|
|
|
|
|
## 2.184.0 - 2025-07-22 |
|
|
## 2.184.0 - 2025-07-22 |
|
|
|
|
|
|
|
|
|
@ -47,11 +47,21 @@ describe('YahooFinanceDataEnhancerService', () => { |
|
|
'BTC-USD' |
|
|
'BTC-USD' |
|
|
) |
|
|
) |
|
|
).toEqual('BTCUSD'); |
|
|
).toEqual('BTCUSD'); |
|
|
|
|
|
expect( |
|
|
|
|
|
await yahooFinanceDataEnhancerService.convertFromYahooFinanceSymbol( |
|
|
|
|
|
'USD.AX' |
|
|
|
|
|
) |
|
|
|
|
|
).toEqual('USD.AX'); |
|
|
expect( |
|
|
expect( |
|
|
await yahooFinanceDataEnhancerService.convertFromYahooFinanceSymbol( |
|
|
await yahooFinanceDataEnhancerService.convertFromYahooFinanceSymbol( |
|
|
'EURUSD=X' |
|
|
'EURUSD=X' |
|
|
) |
|
|
) |
|
|
).toEqual('EURUSD'); |
|
|
).toEqual('EURUSD'); |
|
|
|
|
|
expect( |
|
|
|
|
|
await yahooFinanceDataEnhancerService.convertFromYahooFinanceSymbol( |
|
|
|
|
|
'USDCHF=X' |
|
|
|
|
|
) |
|
|
|
|
|
).toEqual('USDCHF'); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it('convertToYahooFinanceSymbol', async () => { |
|
|
it('convertToYahooFinanceSymbol', async () => { |
|
@ -65,6 +75,16 @@ describe('YahooFinanceDataEnhancerService', () => { |
|
|
'DOGEUSD' |
|
|
'DOGEUSD' |
|
|
) |
|
|
) |
|
|
).toEqual('DOGE-USD'); |
|
|
).toEqual('DOGE-USD'); |
|
|
|
|
|
expect( |
|
|
|
|
|
await yahooFinanceDataEnhancerService.convertToYahooFinanceSymbol( |
|
|
|
|
|
'EURUSD' |
|
|
|
|
|
) |
|
|
|
|
|
).toEqual('EURUSD=X'); |
|
|
|
|
|
expect( |
|
|
|
|
|
await yahooFinanceDataEnhancerService.convertToYahooFinanceSymbol( |
|
|
|
|
|
'USD.AX' |
|
|
|
|
|
) |
|
|
|
|
|
).toEqual('USD.AX'); |
|
|
expect( |
|
|
expect( |
|
|
await yahooFinanceDataEnhancerService.convertToYahooFinanceSymbol( |
|
|
await yahooFinanceDataEnhancerService.convertToYahooFinanceSymbol( |
|
|
'USDCHF' |
|
|
'USDCHF' |
|
|
|
@ -63,7 +63,8 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { |
|
|
if ( |
|
|
if ( |
|
|
isCurrency( |
|
|
isCurrency( |
|
|
aSymbol.substring(0, aSymbol.length - DEFAULT_CURRENCY.length) |
|
|
aSymbol.substring(0, aSymbol.length - DEFAULT_CURRENCY.length) |
|
|
) |
|
|
) && |
|
|
|
|
|
isCurrency(aSymbol.substring(aSymbol.length - DEFAULT_CURRENCY.length)) |
|
|
) { |
|
|
) { |
|
|
return `${aSymbol}=X`; |
|
|
return `${aSymbol}=X`; |
|
|
} else if ( |
|
|
} else if ( |
|
|