|
@ -1,6 +1,6 @@ |
|
|
import { GetValueObject } from '@ghostfolio/api/app/core/get-value.object'; |
|
|
import { GetValueObject } from '@ghostfolio/api/app/core/get-value-object.interface'; |
|
|
import { GetValueParams } from '@ghostfolio/api/app/core/get-value.params'; |
|
|
import { GetValueParams } from '@ghostfolio/api/app/core/get-value-params.interface'; |
|
|
import { GetValuesParams } from '@ghostfolio/api/app/core/get-values.params'; |
|
|
import { GetValuesParams } from '@ghostfolio/api/app/core/get-values-params.interface'; |
|
|
import { DataProviderService } from '@ghostfolio/api/services/data-provider.service'; |
|
|
import { DataProviderService } from '@ghostfolio/api/services/data-provider.service'; |
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; |
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; |
|
|
import { resetHours } from '@ghostfolio/common/helper'; |
|
|
import { resetHours } from '@ghostfolio/common/helper'; |
|
@ -41,12 +41,12 @@ export class CurrentRateService { |
|
|
if (marketData) { |
|
|
if (marketData) { |
|
|
return { |
|
|
return { |
|
|
date: marketData.date, |
|
|
date: marketData.date, |
|
|
symbol: marketData.symbol, |
|
|
|
|
|
marketPrice: this.exchangeRateDataService.toCurrency( |
|
|
marketPrice: this.exchangeRateDataService.toCurrency( |
|
|
marketData.marketPrice, |
|
|
marketData.marketPrice, |
|
|
currency, |
|
|
currency, |
|
|
userCurrency |
|
|
userCurrency |
|
|
) |
|
|
), |
|
|
|
|
|
symbol: marketData.symbol |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -67,8 +67,8 @@ export class CurrentRateService { |
|
|
const promises: Promise< |
|
|
const promises: Promise< |
|
|
{ |
|
|
{ |
|
|
date: Date; |
|
|
date: Date; |
|
|
symbol: string; |
|
|
|
|
|
marketPrice: number; |
|
|
marketPrice: number; |
|
|
|
|
|
symbol: string; |
|
|
}[] |
|
|
}[] |
|
|
>[] = []; |
|
|
>[] = []; |
|
|
|
|
|
|
|
@ -80,8 +80,8 @@ export class CurrentRateService { |
|
|
for (const symbol of symbols) { |
|
|
for (const symbol of symbols) { |
|
|
result.push({ |
|
|
result.push({ |
|
|
date: today, |
|
|
date: today, |
|
|
symbol: symbol, |
|
|
marketPrice: dataResultProvider?.[symbol]?.marketPrice ?? 0, |
|
|
marketPrice: dataResultProvider?.[symbol]?.marketPrice ?? 0 |
|
|
symbol: symbol |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
@ -99,12 +99,12 @@ export class CurrentRateService { |
|
|
return data.map((marketDataItem) => { |
|
|
return data.map((marketDataItem) => { |
|
|
return { |
|
|
return { |
|
|
date: marketDataItem.date, |
|
|
date: marketDataItem.date, |
|
|
symbol: marketDataItem.symbol, |
|
|
|
|
|
marketPrice: this.exchangeRateDataService.toCurrency( |
|
|
marketPrice: this.exchangeRateDataService.toCurrency( |
|
|
marketDataItem.marketPrice, |
|
|
marketDataItem.marketPrice, |
|
|
currencies[marketDataItem.symbol], |
|
|
currencies[marketDataItem.symbol], |
|
|
userCurrency |
|
|
userCurrency |
|
|
) |
|
|
), |
|
|
|
|
|
symbol: marketDataItem.symbol |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}) |
|
|