Browse Source

Refactoring

pull/3393/head
Thomas Kaul 1 year ago
parent
commit
2d4b7d2d97
  1. 17
      apps/api/src/app/portfolio/portfolio.service.ts
  2. 4
      libs/common/src/lib/interfaces/portfolio-performance.interface.ts
  3. 4
      libs/common/src/lib/interfaces/portfolio-summary.interface.ts

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

@ -573,7 +573,6 @@ export class PortfolioService {
if (withSummary) { if (withSummary) {
summary = await this.getSummary({ summary = await this.getSummary({
filteredValueInBaseCurrency, filteredValueInBaseCurrency,
holdings,
impersonationId, impersonationId,
portfolioCalculator, portfolioCalculator,
userCurrency, userCurrency,
@ -1110,10 +1109,6 @@ export class PortfolioService {
performance: { performance: {
currentNetWorth: 0, currentNetWorth: 0,
currentValueInBaseCurrency: 0, currentValueInBaseCurrency: 0,
grossPerformance: 0,
grossPerformancePercentage: 0,
grossPerformancePercentageWithCurrencyEffect: 0,
grossPerformanceWithCurrencyEffect: 0,
netPerformance: 0, netPerformance: 0,
netPerformancePercentage: 0, netPerformancePercentage: 0,
netPerformancePercentageWithCurrencyEffect: 0, netPerformancePercentageWithCurrencyEffect: 0,
@ -1145,7 +1140,6 @@ export class PortfolioService {
}); });
const { const {
grossPerformancePercent,
netPerformance, netPerformance,
netPerformanceInPercentage, netPerformanceInPercentage,
netPerformanceInPercentageWithCurrencyEffect, netPerformanceInPercentageWithCurrencyEffect,
@ -1157,7 +1151,6 @@ export class PortfolioService {
chart?.length > 0 chart?.length > 0
? last(chart) ? last(chart)
: { : {
grossPerformancePercent: 0,
netPerformance: 0, netPerformance: 0,
netPerformanceInPercentage: 0, netPerformanceInPercentage: 0,
netPerformanceInPercentageWithCurrencyEffect: 0, netPerformanceInPercentageWithCurrencyEffect: 0,
@ -1178,13 +1171,7 @@ export class PortfolioService {
totalInvestment, totalInvestment,
currentNetWorth: netWorth, currentNetWorth: netWorth,
currentValueInBaseCurrency: valueWithCurrencyEffect, currentValueInBaseCurrency: valueWithCurrencyEffect,
// TODO netPerformancePercentage: netPerformanceInPercentage / 100 / 100,
grossPerformance: 0,
grossPerformancePercentage: grossPerformancePercent / 100,
grossPerformancePercentageWithCurrencyEffect: 0 / 100,
// TODO
grossPerformanceWithCurrencyEffect: 0,
netPerformancePercentage: netPerformanceInPercentage / 100,
netPerformancePercentageWithCurrencyEffect: netPerformancePercentageWithCurrencyEffect:
netPerformanceInPercentageWithCurrencyEffect / 100 netPerformanceInPercentageWithCurrencyEffect / 100
} }
@ -1582,7 +1569,6 @@ export class PortfolioService {
balanceInBaseCurrency, balanceInBaseCurrency,
emergencyFundPositionsValueInBaseCurrency, emergencyFundPositionsValueInBaseCurrency,
filteredValueInBaseCurrency, filteredValueInBaseCurrency,
holdings,
impersonationId, impersonationId,
portfolioCalculator, portfolioCalculator,
userCurrency, userCurrency,
@ -1591,7 +1577,6 @@ export class PortfolioService {
balanceInBaseCurrency: number; balanceInBaseCurrency: number;
emergencyFundPositionsValueInBaseCurrency: number; emergencyFundPositionsValueInBaseCurrency: number;
filteredValueInBaseCurrency: Big; filteredValueInBaseCurrency: Big;
holdings: PortfolioDetails['holdings'];
impersonationId: string; impersonationId: string;
portfolioCalculator: PortfolioCalculator; portfolioCalculator: PortfolioCalculator;
userCurrency: string; userCurrency: string;

4
libs/common/src/lib/interfaces/portfolio-performance.interface.ts

@ -2,10 +2,6 @@ export interface PortfolioPerformance {
annualizedPerformancePercent?: number; annualizedPerformancePercent?: number;
currentNetWorth?: number; currentNetWorth?: number;
currentValueInBaseCurrency: number; currentValueInBaseCurrency: number;
grossPerformance: number;
grossPerformancePercentage: number;
grossPerformancePercentageWithCurrencyEffect: number;
grossPerformanceWithCurrencyEffect: number;
netPerformance: number; netPerformance: number;
netPerformancePercentage: number; netPerformancePercentage: number;
netPerformancePercentageWithCurrencyEffect: number; netPerformancePercentageWithCurrencyEffect: number;

4
libs/common/src/lib/interfaces/portfolio-summary.interface.ts

@ -17,6 +17,10 @@ export interface PortfolioSummary extends PortfolioPerformance {
filteredValueInPercentage?: number; filteredValueInPercentage?: number;
fireWealth: number; fireWealth: number;
firstOrderDate: Date; firstOrderDate: Date;
grossPerformance: number;
grossPerformancePercentage: number;
grossPerformancePercentageWithCurrencyEffect: number;
grossPerformanceWithCurrencyEffect: number;
interest: number; interest: number;
items: number; items: number;
liabilities: number; liabilities: number;

Loading…
Cancel
Save