Refactoring
This commit is contained in:
parent
fb9e66318f
commit
5e9cecc6c1
@ -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
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import {
|
import { CurrentRateService } from '@ghostfolio/api/app/core/current-rate.service';
|
||||||
CurrentRateService
|
import { GetValueParams } from '@ghostfolio/api/app/core/get-value-params.interface';
|
||||||
} from '@ghostfolio/api/app/core/current-rate.service';
|
import { GetValuesParams } from '@ghostfolio/api/app/core/get-values-params.interface';
|
||||||
import { GetValueParams } from '@ghostfolio/api/app/core/get-value.params';
|
|
||||||
import { GetValuesParams } from '@ghostfolio/api/app/core/get-values.params';
|
|
||||||
import { PortfolioCalculator } from '@ghostfolio/api/app/core/portfolio-calculator';
|
import { PortfolioCalculator } from '@ghostfolio/api/app/core/portfolio-calculator';
|
||||||
import { PortfolioOrder } from '@ghostfolio/api/app/core/portfolio-order';
|
import { PortfolioOrder } from '@ghostfolio/api/app/core/portfolio-order';
|
||||||
import { TimelinePeriod } from '@ghostfolio/api/app/core/timeline-period';
|
import { TimelinePeriod } from '@ghostfolio/api/app/core/timeline-period';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { CurrentRateService } from '@ghostfolio/api/app/core/current-rate.service';
|
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 { PortfolioOrder } from '@ghostfolio/api/app/core/portfolio-order';
|
||||||
import { TimelinePeriod } from '@ghostfolio/api/app/core/timeline-period';
|
import { TimelinePeriod } from '@ghostfolio/api/app/core/timeline-period';
|
||||||
import {
|
import {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user