|
@ -17,7 +17,6 @@ import { FeeRatioInitialInvestment } from '@ghostfolio/api/models/rules/fees/fee |
|
|
import { DataProviderService } from '@ghostfolio/api/services/data-provider.service'; |
|
|
import { DataProviderService } from '@ghostfolio/api/services/data-provider.service'; |
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; |
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; |
|
|
import { ImpersonationService } from '@ghostfolio/api/services/impersonation.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 { EnhancedSymbolProfile } from '@ghostfolio/api/services/interfaces/symbol-profile.interface'; |
|
|
import { RulesService } from '@ghostfolio/api/services/rules.service'; |
|
|
import { RulesService } from '@ghostfolio/api/services/rules.service'; |
|
|
import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile.service'; |
|
|
import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile.service'; |
|
@ -264,9 +263,7 @@ export class PortfolioService { |
|
|
this.request.user.Settings.currency |
|
|
this.request.user.Settings.currency |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const { transactionPoints, orders } = await this.getTransactionPoints( |
|
|
const { transactionPoints } = await this.getTransactionPoints(userId); |
|
|
userId |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (transactionPoints?.length <= 0) { |
|
|
if (transactionPoints?.length <= 0) { |
|
|
return { |
|
|
return { |
|
@ -352,18 +349,18 @@ export class PortfolioService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
averagePrice: averagePrice.toNumber(), |
|
|
|
|
|
currency, |
|
|
currency, |
|
|
firstBuyDate, |
|
|
firstBuyDate, |
|
|
investment: investment.toNumber(), |
|
|
|
|
|
marketPrice, |
|
|
marketPrice, |
|
|
maxPrice, |
|
|
maxPrice, |
|
|
minPrice, |
|
|
minPrice, |
|
|
quantity: quantity.toNumber(), |
|
|
|
|
|
transactionCount, |
|
|
transactionCount, |
|
|
|
|
|
averagePrice: averagePrice.toNumber(), |
|
|
grossPerformance: position.grossPerformance.toNumber(), |
|
|
grossPerformance: position.grossPerformance.toNumber(), |
|
|
grossPerformancePercent: position.grossPerformancePercentage.toNumber(), |
|
|
grossPerformancePercent: position.grossPerformancePercentage.toNumber(), |
|
|
historicalData: historicalDataArray, |
|
|
historicalData: historicalDataArray, |
|
|
|
|
|
investment: investment.toNumber(), |
|
|
|
|
|
quantity: quantity.toNumber(), |
|
|
symbol: aSymbol |
|
|
symbol: aSymbol |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
@ -452,9 +449,7 @@ export class PortfolioService { |
|
|
position.grossPerformancePercentage?.toNumber() ?? null, |
|
|
position.grossPerformancePercentage?.toNumber() ?? null, |
|
|
investment: new Big(position.investment).toNumber(), |
|
|
investment: new Big(position.investment).toNumber(), |
|
|
name: position.name, |
|
|
name: position.name, |
|
|
quantity: new Big(position.quantity).toNumber(), |
|
|
quantity: new Big(position.quantity).toNumber() |
|
|
type: Type.Unknown, // TODO
|
|
|
|
|
|
url: '' // TODO
|
|
|
|
|
|
}; |
|
|
}; |
|
|
}) |
|
|
}) |
|
|
}; |
|
|
}; |
|
|