Browse Source

Merge a6895d12b7 into 8c0a49a8cc

pull/6574/merge
H1net 2 days ago
committed by GitHub
parent
commit
ef27d610a8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6
      apps/api/src/app/activities/activities.service.ts
  3. 8
      apps/api/src/app/portfolio/portfolio.service.ts
  4. 2
      apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts

1
CHANGELOG.md

@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### 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 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 - Fixed an issue in the _Storybook_ stories of the symbol autocomplete component caused by a circular dependency

6
apps/api/src/app/activities/activities.service.ts

@ -702,7 +702,8 @@ export class ActivitiesService {
feeInBaseCurrency, feeInBaseCurrency,
unitPriceInAssetProfileCurrency, unitPriceInAssetProfileCurrency,
valueInBaseCurrency valueInBaseCurrency
] = await Promise.all([ ] = (
await Promise.all([
this.exchangeRateDataService.toCurrencyAtDate( this.exchangeRateDataService.toCurrencyAtDate(
order.fee, order.fee,
order.currency ?? order.SymbolProfile.currency, order.currency ?? order.SymbolProfile.currency,
@ -727,7 +728,8 @@ export class ActivitiesService {
userCurrency, userCurrency,
order.date order.date
) )
]); ])
).map((result) => result ?? 0);
return { return {
...order, ...order,

8
apps/api/src/app/portfolio/portfolio.service.ts

@ -195,21 +195,21 @@ export class PortfolioService {
switch (type) { switch (type) {
case ActivityType.DIVIDEND: case ActivityType.DIVIDEND:
dividendInBaseCurrency += dividendInBaseCurrency +=
await this.exchangeRateDataService.toCurrencyAtDate( (await this.exchangeRateDataService.toCurrencyAtDate(
new Big(quantity).mul(unitPrice).toNumber(), new Big(quantity).mul(unitPrice).toNumber(),
currency ?? SymbolProfile.currency, currency ?? SymbolProfile.currency,
userCurrency, userCurrency,
date date
); )) ?? 0;
break; break;
case ActivityType.INTEREST: case ActivityType.INTEREST:
interestInBaseCurrency += interestInBaseCurrency +=
await this.exchangeRateDataService.toCurrencyAtDate( (await this.exchangeRateDataService.toCurrencyAtDate(
unitPrice, unitPrice,
currency ?? SymbolProfile.currency, currency ?? SymbolProfile.currency,
userCurrency, userCurrency,
date date
); )) ?? 0;
break; break;
} }

2
apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts

@ -349,7 +349,7 @@ export class ExchangeRateDataService {
'ExchangeRateDataService' 'ExchangeRateDataService'
); );
return undefined; return 0;
} }
private async getExchangeRates({ private async getExchangeRates({

Loading…
Cancel
Save