|
|
@ -247,11 +247,10 @@ export class PortfolioService { |
|
|
|
|
|
|
|
const { endDate, startDate } = getIntervalFromDateRange(dateRange); |
|
|
|
|
|
|
|
const { activities } = await this.orderService.getOrders({ |
|
|
|
const { activities } = |
|
|
|
await this.orderService.getOrdersForPortfolioCalculator({ |
|
|
|
filters, |
|
|
|
userId, |
|
|
|
includeDrafts: true, |
|
|
|
types: ['BUY', 'SELL'], |
|
|
|
userCurrency: this.getUserCurrency() |
|
|
|
}); |
|
|
|
|
|
|
@ -332,11 +331,11 @@ export class PortfolioService { |
|
|
|
(user.Settings?.settings as UserSettings)?.emergencyFund ?? 0 |
|
|
|
); |
|
|
|
|
|
|
|
const { activities } = await this.orderService.getOrders({ |
|
|
|
const { activities } = |
|
|
|
await this.orderService.getOrdersForPortfolioCalculator({ |
|
|
|
filters, |
|
|
|
userCurrency, |
|
|
|
userId, |
|
|
|
withExcludedAccounts |
|
|
|
userId |
|
|
|
}); |
|
|
|
|
|
|
|
const portfolioCalculator = this.calculatorFactory.createCalculator({ |
|
|
@ -597,10 +596,10 @@ export class PortfolioService { |
|
|
|
const user = await this.userService.user({ id: userId }); |
|
|
|
const userCurrency = this.getUserCurrency(user); |
|
|
|
|
|
|
|
const { activities } = await this.orderService.getOrders({ |
|
|
|
const { activities } = |
|
|
|
await this.orderService.getOrdersForPortfolioCalculator({ |
|
|
|
userCurrency, |
|
|
|
userId, |
|
|
|
withExcludedAccounts: true |
|
|
|
userId |
|
|
|
}); |
|
|
|
|
|
|
|
const orders = activities.filter(({ SymbolProfile }) => { |
|
|
@ -906,10 +905,8 @@ export class PortfolioService { |
|
|
|
const userId = await this.getUserId(impersonationId, this.request.user.id); |
|
|
|
const user = await this.userService.user({ id: userId }); |
|
|
|
|
|
|
|
const { endDate } = getIntervalFromDateRange(dateRange); |
|
|
|
|
|
|
|
const { activities } = await this.orderService.getOrders({ |
|
|
|
endDate, |
|
|
|
const { activities } = |
|
|
|
await this.orderService.getOrdersForPortfolioCalculator({ |
|
|
|
filters, |
|
|
|
userId, |
|
|
|
userCurrency: this.getUserCurrency() |
|
|
@ -1085,14 +1082,11 @@ export class PortfolioService { |
|
|
|
) |
|
|
|
); |
|
|
|
|
|
|
|
const { endDate, startDate } = getIntervalFromDateRange(dateRange); |
|
|
|
|
|
|
|
const { activities } = await this.orderService.getOrders({ |
|
|
|
endDate, |
|
|
|
const { activities } = |
|
|
|
await this.orderService.getOrdersForPortfolioCalculator({ |
|
|
|
filters, |
|
|
|
userCurrency, |
|
|
|
userId, |
|
|
|
withExcludedAccounts |
|
|
|
userId |
|
|
|
}); |
|
|
|
|
|
|
|
if (accountBalanceItems?.length <= 0 && activities?.length <= 0) { |
|
|
@ -1126,6 +1120,8 @@ export class PortfolioService { |
|
|
|
const { errors, hasErrors, historicalData } = |
|
|
|
await portfolioCalculator.getSnapshot(); |
|
|
|
|
|
|
|
const { endDate, startDate } = getIntervalFromDateRange(dateRange); |
|
|
|
|
|
|
|
const { chart } = await portfolioCalculator.getPerformance({ |
|
|
|
end: endDate, |
|
|
|
start: startDate |
|
|
@ -1175,7 +1171,8 @@ export class PortfolioService { |
|
|
|
const user = await this.userService.user({ id: userId }); |
|
|
|
const userCurrency = this.getUserCurrency(user); |
|
|
|
|
|
|
|
const { activities } = await this.orderService.getOrders({ |
|
|
|
const { activities } = |
|
|
|
await this.orderService.getOrdersForPortfolioCalculator({ |
|
|
|
userCurrency, |
|
|
|
userId |
|
|
|
}); |
|
|
|