Browse Source

Refactor portfolio service

pull/5063/head
Thomas Kaul 2 days ago
parent
commit
ece43087fa
  1. 29
      apps/api/src/app/portfolio/portfolio.service.ts

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

@ -720,7 +720,16 @@ export class PortfolioService {
dividendInBaseCurrency, dividendInBaseCurrency,
fee, fee,
firstBuyDate, firstBuyDate,
grossPerformance,
grossPerformancePercentage,
grossPerformancePercentageWithCurrencyEffect,
grossPerformanceWithCurrencyEffect,
investmentWithCurrencyEffect,
marketPrice, marketPrice,
netPerformance,
netPerformancePercentage,
netPerformancePercentageWithCurrencyEffectMap,
netPerformanceWithCurrencyEffectMap,
quantity, quantity,
tags, tags,
timeWeightedInvestment, timeWeightedInvestment,
@ -856,23 +865,21 @@ export class PortfolioService {
SymbolProfile.currency, SymbolProfile.currency,
userCurrency userCurrency
), ),
grossPerformance: holding.grossPerformance?.toNumber(), grossPerformance: grossPerformance?.toNumber(),
grossPerformancePercent: holding.grossPerformancePercentage?.toNumber(), grossPerformancePercent: grossPerformancePercentage?.toNumber(),
grossPerformancePercentWithCurrencyEffect: grossPerformancePercentWithCurrencyEffect:
holding.grossPerformancePercentageWithCurrencyEffect?.toNumber(), grossPerformancePercentageWithCurrencyEffect?.toNumber(),
grossPerformanceWithCurrencyEffect: grossPerformanceWithCurrencyEffect:
holding.grossPerformanceWithCurrencyEffect?.toNumber(), grossPerformanceWithCurrencyEffect?.toNumber(),
historicalData: historicalDataArray, historicalData: historicalDataArray,
investmentInBaseCurrencyWithCurrencyEffect: investmentInBaseCurrencyWithCurrencyEffect:
holding.investmentWithCurrencyEffect?.toNumber(), investmentWithCurrencyEffect?.toNumber(),
netPerformance: holding.netPerformance?.toNumber(), netPerformance: netPerformance?.toNumber(),
netPerformancePercent: holding.netPerformancePercentage?.toNumber(), netPerformancePercent: netPerformancePercentage?.toNumber(),
netPerformancePercentWithCurrencyEffect: netPerformancePercentWithCurrencyEffect:
holding.netPerformancePercentageWithCurrencyEffectMap?.[ netPerformancePercentageWithCurrencyEffectMap?.['max']?.toNumber(),
'max'
]?.toNumber(),
netPerformanceWithCurrencyEffect: netPerformanceWithCurrencyEffect:
holding.netPerformanceWithCurrencyEffectMap?.['max']?.toNumber(), netPerformanceWithCurrencyEffectMap?.['max']?.toNumber(),
performances: { performances: {
allTimeHigh: { allTimeHigh: {
performancePercent, performancePercent,

Loading…
Cancel
Save