|
|
@ -1,17 +1,9 @@
|
|
|
|
import { DATE_FORMAT, parseDate, resetHours } from '@ghostfolio/common/helper';
|
|
|
|
import { DATE_FORMAT, parseDate, resetHours } from '@ghostfolio/common/helper';
|
|
|
|
import { DataSource } from '@prisma/client';
|
|
|
|
import { DataSource } from '@prisma/client';
|
|
|
|
import Big from 'big.js';
|
|
|
|
import Big from 'big.js';
|
|
|
|
import {
|
|
|
|
import { addDays, endOfDay, format, isBefore, isSameDay } from 'date-fns';
|
|
|
|
addDays,
|
|
|
|
|
|
|
|
differenceInCalendarDays,
|
|
|
|
|
|
|
|
endOfDay,
|
|
|
|
|
|
|
|
format,
|
|
|
|
|
|
|
|
isBefore,
|
|
|
|
|
|
|
|
isSameDay
|
|
|
|
|
|
|
|
} from 'date-fns';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { CurrentRateService } from './current-rate.service';
|
|
|
|
import { CurrentRateService } from './current-rate.service';
|
|
|
|
import { GetValueParams } from './interfaces/get-value-params.interface';
|
|
|
|
|
|
|
|
import { GetValuesParams } from './interfaces/get-values-params.interface';
|
|
|
|
import { GetValuesParams } from './interfaces/get-values-params.interface';
|
|
|
|
import { PortfolioOrder } from './interfaces/portfolio-order.interface';
|
|
|
|
import { PortfolioOrder } from './interfaces/portfolio-order.interface';
|
|
|
|
import { TimelinePeriod } from './interfaces/timeline-period.interface';
|
|
|
|
import { TimelinePeriod } from './interfaces/timeline-period.interface';
|
|
|
@ -275,9 +267,6 @@ jest.mock('./current-rate.service', () => {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
|
|
CurrentRateService: jest.fn().mockImplementation(() => {
|
|
|
|
CurrentRateService: jest.fn().mockImplementation(() => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
getValue: ({ date, symbol }: GetValueParams) => {
|
|
|
|
|
|
|
|
return Promise.resolve(mockGetValue(symbol, date));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getValues: ({ dataGatheringItems, dateQuery }: GetValuesParams) => {
|
|
|
|
getValues: ({ dataGatheringItems, dateQuery }: GetValuesParams) => {
|
|
|
|
const result = [];
|
|
|
|
const result = [];
|
|
|
|
if (dateQuery.lt) {
|
|
|
|
if (dateQuery.lt) {
|
|
|
|