Refactoring

pull/239/head
Thomas 3 years ago
parent fb9e66318f
commit 5e9cecc6c1

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

@ -1,8 +1,6 @@
import {
CurrentRateService
} from '@ghostfolio/api/app/core/current-rate.service';
import { GetValueParams } from '@ghostfolio/api/app/core/get-value.params';
import { GetValuesParams } from '@ghostfolio/api/app/core/get-values.params';
import { CurrentRateService } from '@ghostfolio/api/app/core/current-rate.service';
import { GetValueParams } from '@ghostfolio/api/app/core/get-value-params.interface';
import { GetValuesParams } from '@ghostfolio/api/app/core/get-values-params.interface';
import { PortfolioCalculator } from '@ghostfolio/api/app/core/portfolio-calculator';
import { PortfolioOrder } from '@ghostfolio/api/app/core/portfolio-order';
import { TimelinePeriod } from '@ghostfolio/api/app/core/timeline-period';

@ -1,5 +1,5 @@
import { CurrentRateService } from '@ghostfolio/api/app/core/current-rate.service';
import { GetValueObject } from '@ghostfolio/api/app/core/get-value.object';
import { GetValueObject } from '@ghostfolio/api/app/core/get-value-object.interface';
import { PortfolioOrder } from '@ghostfolio/api/app/core/portfolio-order';
import { TimelinePeriod } from '@ghostfolio/api/app/core/timeline-period';
import {

Loading…
Cancel
Save