Browse Source

Clean up date range

pull/3393/head
Thomas Kaul 1 year ago
parent
commit
3e62c4f01b
  1. 5
      apps/api/src/app/portfolio/calculator/portfolio-calculator.factory.ts
  2. 4
      apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
  3. 4
      apps/api/src/app/portfolio/portfolio.service.ts

5
apps/api/src/app/portfolio/calculator/portfolio-calculator.factory.ts

@ -4,7 +4,6 @@ import { RedisCacheService } from '@ghostfolio/api/app/redis-cache/redis-cache.s
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
import { HistoricalDataItem } from '@ghostfolio/common/interfaces';
import { DateRange, UserWithSettings } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
@ -31,7 +30,6 @@ export class PortfolioCalculatorFactory {
activities,
calculationType,
currency,
dateRange = 'max',
hasFilters,
isExperimentalFeatures = false,
userId
@ -40,7 +38,6 @@ export class PortfolioCalculatorFactory {
activities: Activity[];
calculationType: PerformanceCalculationType;
currency: string;
dateRange?: DateRange;
hasFilters: boolean;
isExperimentalFeatures?: boolean;
userId: string;
@ -53,7 +50,6 @@ export class PortfolioCalculatorFactory {
accountBalanceItems,
activities,
currency,
dateRange,
useCache,
userId,
configurationService: this.configurationService,
@ -67,7 +63,6 @@ export class PortfolioCalculatorFactory {
activities,
currency,
currentRateService: this.currentRateService,
dateRange,
useCache,
userId,
configurationService: this.configurationService,

4
apps/api/src/app/portfolio/calculator/portfolio-calculator.ts

@ -54,7 +54,6 @@ export abstract class PortfolioCalculator {
private currency: string;
private currentRateService: CurrentRateService;
private dataProviderInfos: DataProviderInfo[];
private dateRange: DateRange;
private endDate: Date;
private exchangeRateDataService: ExchangeRateDataService;
private redisCacheService: RedisCacheService;
@ -71,7 +70,6 @@ export abstract class PortfolioCalculator {
configurationService,
currency,
currentRateService,
dateRange,
exchangeRateDataService,
redisCacheService,
useCache,
@ -82,7 +80,6 @@ export abstract class PortfolioCalculator {
configurationService: ConfigurationService;
currency: string;
currentRateService: CurrentRateService;
dateRange: DateRange;
exchangeRateDataService: ExchangeRateDataService;
redisCacheService: RedisCacheService;
useCache: boolean;
@ -92,7 +89,6 @@ export abstract class PortfolioCalculator {
this.configurationService = configurationService;
this.currency = currency;
this.currentRateService = currentRateService;
this.dateRange = dateRange;
this.exchangeRateDataService = exchangeRateDataService;
let dateOfFirstActivity = new Date();

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

@ -261,7 +261,6 @@ export class PortfolioService {
const portfolioCalculator = this.calculatorFactory.createCalculator({
activities,
dateRange,
userId,
calculationType: PerformanceCalculationType.TWR,
currency: this.request.user.Settings.settings.baseCurrency,
@ -340,7 +339,6 @@ export class PortfolioService {
const portfolioCalculator = this.calculatorFactory.createCalculator({
activities,
dateRange,
userId,
calculationType: PerformanceCalculationType.TWR,
currency: userCurrency,
@ -930,7 +928,6 @@ export class PortfolioService {
const portfolioCalculator = this.calculatorFactory.createCalculator({
activities,
dateRange,
userId,
calculationType: PerformanceCalculationType.TWR,
currency: this.request.user.Settings.settings.baseCurrency,
@ -1127,7 +1124,6 @@ export class PortfolioService {
this.calculatorFactory.createCalculator({
accountBalanceItems,
activities,
dateRange,
userId,
calculationType: PerformanceCalculationType.TWR,
currency: userCurrency,

Loading…
Cancel
Save