H1net
2 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
34 additions and
31 deletions
-
CHANGELOG.md
-
apps/api/src/app/activities/activities.service.ts
-
apps/api/src/app/portfolio/portfolio.service.ts
-
apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts
|
|
|
@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed a crash on the _Overview_, _Portfolio_ and _Holdings_ pages when exchange rate data is missing (e.g. before the data gathering job completes) |
|
|
|
- Fixed an issue with the detection of the thousand separator for the `de-CH` locale |
|
|
|
- Fixed an issue in the _Storybook_ stories of the symbol autocomplete component caused by a circular dependency |
|
|
|
|
|
|
|
|
|
|
|
@ -702,7 +702,8 @@ export class ActivitiesService { |
|
|
|
feeInBaseCurrency, |
|
|
|
unitPriceInAssetProfileCurrency, |
|
|
|
valueInBaseCurrency |
|
|
|
] = await Promise.all([ |
|
|
|
] = ( |
|
|
|
await Promise.all([ |
|
|
|
this.exchangeRateDataService.toCurrencyAtDate( |
|
|
|
order.fee, |
|
|
|
order.currency ?? order.SymbolProfile.currency, |
|
|
|
@ -727,7 +728,8 @@ export class ActivitiesService { |
|
|
|
userCurrency, |
|
|
|
order.date |
|
|
|
) |
|
|
|
]); |
|
|
|
]) |
|
|
|
).map((result) => result ?? 0); |
|
|
|
|
|
|
|
return { |
|
|
|
...order, |
|
|
|
|
|
|
|
@ -195,21 +195,21 @@ export class PortfolioService { |
|
|
|
switch (type) { |
|
|
|
case ActivityType.DIVIDEND: |
|
|
|
dividendInBaseCurrency += |
|
|
|
await this.exchangeRateDataService.toCurrencyAtDate( |
|
|
|
(await this.exchangeRateDataService.toCurrencyAtDate( |
|
|
|
new Big(quantity).mul(unitPrice).toNumber(), |
|
|
|
currency ?? SymbolProfile.currency, |
|
|
|
userCurrency, |
|
|
|
date |
|
|
|
); |
|
|
|
)) ?? 0; |
|
|
|
break; |
|
|
|
case ActivityType.INTEREST: |
|
|
|
interestInBaseCurrency += |
|
|
|
await this.exchangeRateDataService.toCurrencyAtDate( |
|
|
|
(await this.exchangeRateDataService.toCurrencyAtDate( |
|
|
|
unitPrice, |
|
|
|
currency ?? SymbolProfile.currency, |
|
|
|
userCurrency, |
|
|
|
date |
|
|
|
); |
|
|
|
)) ?? 0; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -349,7 +349,7 @@ export class ExchangeRateDataService { |
|
|
|
'ExchangeRateDataService' |
|
|
|
); |
|
|
|
|
|
|
|
return undefined; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
private async getExchangeRates({ |
|
|
|
|