diff --git a/apps/api/src/app/core/portfolio-calculator.ts b/apps/api/src/app/core/portfolio-calculator.ts index 56faaef43..3ff1f4ba3 100644 --- a/apps/api/src/app/core/portfolio-calculator.ts +++ b/apps/api/src/app/core/portfolio-calculator.ts @@ -1,4 +1,5 @@ import { CurrentRateService } from '@ghostfolio/api/app/core/current-rate.service'; +import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; import { GetValueObject } from '@ghostfolio/api/app/core/interfaces/get-value-object.interface'; import { PortfolioOrder } from '@ghostfolio/api/app/core/interfaces/portfolio-order.interface'; import { TimelinePeriod } from '@ghostfolio/api/app/core/interfaces/timeline-period.interface'; @@ -26,7 +27,6 @@ import { subDays } from 'date-fns'; import { flatten } from 'lodash'; -import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; export class PortfolioCalculator { private transactionPoints: TransactionPoint[]; diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index def8cfee0..3930f4850 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -11,6 +11,7 @@ import { PortfolioPosition, PortfolioReport } from '@ghostfolio/common/interfaces'; +import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; import { getPermissions, hasPermission, @@ -39,7 +40,6 @@ import { } from './interfaces/portfolio-position-detail.interface'; import { PortfolioPositions } from './interfaces/portfolio-positions.interface'; import { PortfolioService } from './portfolio.service'; -import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; @Controller('portfolio') export class PortfolioController { diff --git a/apps/api/src/app/portfolio/portfolio.module.ts b/apps/api/src/app/portfolio/portfolio.module.ts index b3bb2509e..3a4aa29e1 100644 --- a/apps/api/src/app/portfolio/portfolio.module.ts +++ b/apps/api/src/app/portfolio/portfolio.module.ts @@ -16,11 +16,11 @@ import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate- import { ImpersonationService } from '@ghostfolio/api/services/impersonation.service'; import { PrismaService } from '@ghostfolio/api/services/prisma.service'; import { RulesService } from '@ghostfolio/api/services/rules.service'; +import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile.service'; import { Module } from '@nestjs/common'; import { PortfolioController } from './portfolio.controller'; import { PortfolioService } from './portfolio.service'; -import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile.service'; @Module({ imports: [RedisCacheModule], diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 9e431622e..bb6f403cb 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -2,14 +2,26 @@ import { AccountService } from '@ghostfolio/api/app/account/account.service'; import { CurrentRateService } from '@ghostfolio/api/app/core/current-rate.service'; import { PortfolioOrder } from '@ghostfolio/api/app/core/interfaces/portfolio-order.interface'; import { TimelineSpecification } from '@ghostfolio/api/app/core/interfaces/timeline-specification.interface'; +import { TransactionPoint } from '@ghostfolio/api/app/core/interfaces/transaction-point.interface'; import { PortfolioCalculator } from '@ghostfolio/api/app/core/portfolio-calculator'; import { OrderService } from '@ghostfolio/api/app/order/order.service'; import { OrderType } from '@ghostfolio/api/models/order-type'; +import { AccountClusterRiskCurrentInvestment } from '@ghostfolio/api/models/rules/account-cluster-risk/current-investment'; +import { AccountClusterRiskInitialInvestment } from '@ghostfolio/api/models/rules/account-cluster-risk/initial-investment'; +import { AccountClusterRiskSingleAccount } from '@ghostfolio/api/models/rules/account-cluster-risk/single-account'; +import { CurrencyClusterRiskBaseCurrencyCurrentInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/base-currency-current-investment'; +import { CurrencyClusterRiskBaseCurrencyInitialInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/base-currency-initial-investment'; +import { CurrencyClusterRiskCurrentInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/current-investment'; +import { CurrencyClusterRiskInitialInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/initial-investment'; +import { FeeRatioInitialInvestment } from '@ghostfolio/api/models/rules/fees/fee-ratio-initial-investment'; import { DataProviderService } from '@ghostfolio/api/services/data-provider.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; import { ImpersonationService } from '@ghostfolio/api/services/impersonation.service'; import { Type } from '@ghostfolio/api/services/interfaces/interfaces'; +import { EnhancedSymbolProfile } from '@ghostfolio/api/services/interfaces/symbol-profile.interface'; import { RulesService } from '@ghostfolio/api/services/rules.service'; +import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile.service'; +import { UNKNOWN_KEY } from '@ghostfolio/common/config'; import { DATE_FORMAT, parseDate } from '@ghostfolio/common/helper'; import { PortfolioOverview, @@ -19,6 +31,7 @@ import { Position, TimelinePosition } from '@ghostfolio/common/interfaces'; +import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; import { DateRange, OrderWithAccount, @@ -46,19 +59,6 @@ import { HistoricalDataItem, PortfolioPositionDetail } from './interfaces/portfolio-position-detail.interface'; -import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile.service'; -import { UNKNOWN_KEY } from '@ghostfolio/common/config'; -import { EnhancedSymbolProfile } from '@ghostfolio/api/services/interfaces/symbol-profile.interface'; -import { TransactionPoint } from '@ghostfolio/api/app/core/interfaces/transaction-point.interface'; -import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; -import { AccountClusterRiskInitialInvestment } from '@ghostfolio/api/models/rules/account-cluster-risk/initial-investment'; -import { AccountClusterRiskCurrentInvestment } from '@ghostfolio/api/models/rules/account-cluster-risk/current-investment'; -import { AccountClusterRiskSingleAccount } from '@ghostfolio/api/models/rules/account-cluster-risk/single-account'; -import { CurrencyClusterRiskBaseCurrencyInitialInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/base-currency-initial-investment'; -import { CurrencyClusterRiskBaseCurrencyCurrentInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/base-currency-current-investment'; -import { CurrencyClusterRiskInitialInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/initial-investment'; -import { CurrencyClusterRiskCurrentInvestment } from '@ghostfolio/api/models/rules/currency-cluster-risk/current-investment'; -import { FeeRatioInitialInvestment } from '@ghostfolio/api/models/rules/fees/fee-ratio-initial-investment'; @Injectable() export class PortfolioService { diff --git a/apps/api/src/models/interfaces/rule.interface.ts b/apps/api/src/models/interfaces/rule.interface.ts index 894751b32..d91d1ff5c 100644 --- a/apps/api/src/models/interfaces/rule.interface.ts +++ b/apps/api/src/models/interfaces/rule.interface.ts @@ -1,6 +1,7 @@ +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; + import { EvaluationResult } from './evaluation-result.interface'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; export interface RuleInterface { evaluate(aRuleSettings: T): EvaluationResult; diff --git a/apps/api/src/models/rule.ts b/apps/api/src/models/rule.ts index 628931068..2cba7c5ff 100644 --- a/apps/api/src/models/rule.ts +++ b/apps/api/src/models/rule.ts @@ -1,3 +1,5 @@ +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; import { groupBy } from '@ghostfolio/common/helper'; import { PortfolioPosition, @@ -8,8 +10,6 @@ import { Currency } from '@prisma/client'; import { ExchangeRateDataService } from '../services/exchange-rate-data.service'; import { EvaluationResult } from './interfaces/evaluation-result.interface'; import { RuleInterface } from './interfaces/rule.interface'; -import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; export abstract class Rule implements RuleInterface { private name: string; diff --git a/apps/api/src/models/rules/account-cluster-risk/current-investment.ts b/apps/api/src/models/rules/account-cluster-risk/current-investment.ts index ff101678e..74a7c80b0 100644 --- a/apps/api/src/models/rules/account-cluster-risk/current-investment.ts +++ b/apps/api/src/models/rules/account-cluster-risk/current-investment.ts @@ -1,9 +1,9 @@ +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; import { PortfolioPosition } from '@ghostfolio/common/interfaces'; import { Rule } from '../../rule'; -import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; export class AccountClusterRiskCurrentInvestment extends Rule { public constructor( diff --git a/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts b/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts index cd5d4b393..3f5f6c854 100644 --- a/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts +++ b/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts @@ -1,9 +1,9 @@ +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; import { PortfolioPosition } from '@ghostfolio/common/interfaces'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; -import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; export class AccountClusterRiskInitialInvestment extends Rule { public constructor( diff --git a/apps/api/src/models/rules/account-cluster-risk/single-account.ts b/apps/api/src/models/rules/account-cluster-risk/single-account.ts index eb2d29667..6132a65f5 100644 --- a/apps/api/src/models/rules/account-cluster-risk/single-account.ts +++ b/apps/api/src/models/rules/account-cluster-risk/single-account.ts @@ -1,8 +1,8 @@ +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; -import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; export class AccountClusterRiskSingleAccount extends Rule { public constructor( diff --git a/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts index 39d5a08d5..4c5fe01da 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts @@ -1,11 +1,11 @@ -import { Currency } from '@prisma/client'; +import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; import { PortfolioPosition } from '@ghostfolio/common/interfaces'; +import { Currency } from '@prisma/client'; import { Rule } from '../../rule'; -import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; -import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; export class CurrencyClusterRiskBaseCurrencyCurrentInvestment extends Rule { public constructor( diff --git a/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts index e298a127d..02ea09770 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts @@ -1,10 +1,10 @@ +import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; import { Currency } from '@prisma/client'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; -import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; -import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; export class CurrencyClusterRiskBaseCurrencyInitialInvestment extends Rule { public constructor( diff --git a/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts index b65d17d08..12a6c22b6 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts @@ -1,10 +1,10 @@ +import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; +import { Currency } from '@prisma/client'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; -import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; -import { Currency } from '@prisma/client'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; -import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; export class CurrencyClusterRiskCurrentInvestment extends Rule { public constructor( diff --git a/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts index 02d3f8c81..3ce70a1e6 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts @@ -1,10 +1,10 @@ +import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; import { Currency } from '@prisma/client'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; -import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; -import { CurrentPositions } from '@ghostfolio/api/app/core/interfaces/current-positions.interface'; export class CurrencyClusterRiskInitialInvestment extends Rule { public constructor( diff --git a/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts b/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts index bd28c13ec..a51933016 100644 --- a/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts +++ b/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts @@ -1,9 +1,9 @@ +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; import { Currency } from '@prisma/client'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; -import { UserSettings } from '@ghostfolio/api/models/interfaces/user-settings.interface'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; export class FeeRatioInitialInvestment extends Rule { public constructor( diff --git a/apps/api/src/services/interfaces/symbol-profile.interface.ts b/apps/api/src/services/interfaces/symbol-profile.interface.ts index f6f83c3c1..f7bcc283b 100644 --- a/apps/api/src/services/interfaces/symbol-profile.interface.ts +++ b/apps/api/src/services/interfaces/symbol-profile.interface.ts @@ -1,5 +1,5 @@ -import { Sector } from '@ghostfolio/common/interfaces/sector.interface'; import { Country } from '@ghostfolio/common/interfaces/country.interface'; +import { Sector } from '@ghostfolio/common/interfaces/sector.interface'; import { Currency, DataSource } from '@prisma/client'; export interface EnhancedSymbolProfile { diff --git a/apps/api/src/services/rules.service.ts b/apps/api/src/services/rules.service.ts index f3de455ac..d9e6183d0 100644 --- a/apps/api/src/services/rules.service.ts +++ b/apps/api/src/services/rules.service.ts @@ -1,7 +1,8 @@ +import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Injectable } from '@nestjs/common'; -import { Rule } from '../models/rule'; import { Currency } from '@prisma/client'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; + +import { Rule } from '../models/rule'; @Injectable() export class RulesService { diff --git a/apps/api/src/services/symbol-profile.service.ts b/apps/api/src/services/symbol-profile.service.ts index 4af066d73..1a0c472ea 100644 --- a/apps/api/src/services/symbol-profile.service.ts +++ b/apps/api/src/services/symbol-profile.service.ts @@ -1,11 +1,11 @@ +import { EnhancedSymbolProfile } from '@ghostfolio/api/services/interfaces/symbol-profile.interface'; import { PrismaService } from '@ghostfolio/api/services/prisma.service'; -import { Injectable } from '@nestjs/common'; -import { Prisma, SymbolProfile } from '@prisma/client'; -import { continents, countries } from 'countries-list'; import { UNKNOWN_KEY } from '@ghostfolio/common/config'; import { Country } from '@ghostfolio/common/interfaces/country.interface'; -import { EnhancedSymbolProfile } from '@ghostfolio/api/services/interfaces/symbol-profile.interface'; import { Sector } from '@ghostfolio/common/interfaces/sector.interface'; +import { Injectable } from '@nestjs/common'; +import { Prisma, SymbolProfile } from '@prisma/client'; +import { continents, countries } from 'countries-list'; @Injectable() export class SymbolProfileService { diff --git a/apps/client/src/app/components/investment-chart/investment-chart.component.ts b/apps/client/src/app/components/investment-chart/investment-chart.component.ts index c9056a94a..adbdac16b 100644 --- a/apps/client/src/app/components/investment-chart/investment-chart.component.ts +++ b/apps/client/src/app/components/investment-chart/investment-chart.component.ts @@ -10,16 +10,16 @@ import { ViewChild } from '@angular/core'; import { primaryColorRgb } from '@ghostfolio/common/config'; +import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; import { Chart, - LinearScale, LineController, LineElement, + LinearScale, PointElement, TimeScale } from 'chart.js'; import { addMonths, isAfter, parseISO, subMonths } from 'date-fns'; -import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; @Component({ selector: 'gf-investment-chart', diff --git a/apps/client/src/app/pages/tools/analysis/analysis-page.component.ts b/apps/client/src/app/pages/tools/analysis/analysis-page.component.ts index 9ec8b2d78..433bf63b1 100644 --- a/apps/client/src/app/pages/tools/analysis/analysis-page.component.ts +++ b/apps/client/src/app/pages/tools/analysis/analysis-page.component.ts @@ -9,10 +9,10 @@ import { PortfolioPosition, User } from '@ghostfolio/common/interfaces'; +import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; import { DeviceDetectorService } from 'ngx-device-detector'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; @Component({ selector: 'gf-analysis-page', diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts index b6e9d5dd7..6dabe681b 100644 --- a/apps/client/src/app/services/data.service.ts +++ b/apps/client/src/app/services/data.service.ts @@ -26,6 +26,7 @@ import { PortfolioReport, User } from '@ghostfolio/common/interfaces'; +import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; import { permissions } from '@ghostfolio/common/permissions'; import { DateRange } from '@ghostfolio/common/types'; import { Order as OrderModel } from '@prisma/client'; @@ -36,7 +37,6 @@ import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { SettingsStorageService } from './settings-storage.service'; -import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; @Injectable({ providedIn: 'root'