|
|
@ -372,20 +372,23 @@ export class PortfolioService {
|
|
|
|
filters,
|
|
|
|
filters,
|
|
|
|
impersonationId,
|
|
|
|
impersonationId,
|
|
|
|
userCurrency,
|
|
|
|
userCurrency,
|
|
|
|
userId
|
|
|
|
userId,
|
|
|
|
|
|
|
|
withExcludedAccounts = false
|
|
|
|
}: {
|
|
|
|
}: {
|
|
|
|
dateRange?: DateRange;
|
|
|
|
dateRange?: DateRange;
|
|
|
|
filters?: Filter[];
|
|
|
|
filters?: Filter[];
|
|
|
|
impersonationId: string;
|
|
|
|
impersonationId: string;
|
|
|
|
userCurrency: string;
|
|
|
|
userCurrency: string;
|
|
|
|
userId: string;
|
|
|
|
userId: string;
|
|
|
|
|
|
|
|
withExcludedAccounts?: boolean;
|
|
|
|
}): Promise<HistoricalDataContainer> {
|
|
|
|
}): Promise<HistoricalDataContainer> {
|
|
|
|
userId = await this.getUserId(impersonationId, userId);
|
|
|
|
userId = await this.getUserId(impersonationId, userId);
|
|
|
|
|
|
|
|
|
|
|
|
const { portfolioOrders, transactionPoints } =
|
|
|
|
const { portfolioOrders, transactionPoints } =
|
|
|
|
await this.getTransactionPoints({
|
|
|
|
await this.getTransactionPoints({
|
|
|
|
filters,
|
|
|
|
filters,
|
|
|
|
userId
|
|
|
|
userId,
|
|
|
|
|
|
|
|
withExcludedAccounts
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
@ -1110,12 +1113,14 @@ export class PortfolioService {
|
|
|
|
dateRange = 'max',
|
|
|
|
dateRange = 'max',
|
|
|
|
filters,
|
|
|
|
filters,
|
|
|
|
impersonationId,
|
|
|
|
impersonationId,
|
|
|
|
userId
|
|
|
|
userId,
|
|
|
|
|
|
|
|
withExcludedAccounts = false
|
|
|
|
}: {
|
|
|
|
}: {
|
|
|
|
dateRange?: DateRange;
|
|
|
|
dateRange?: DateRange;
|
|
|
|
filters?: Filter[];
|
|
|
|
filters?: Filter[];
|
|
|
|
impersonationId: string;
|
|
|
|
impersonationId: string;
|
|
|
|
userId: string;
|
|
|
|
userId: string;
|
|
|
|
|
|
|
|
withExcludedAccounts?: boolean;
|
|
|
|
}): Promise<PortfolioPerformanceResponse> {
|
|
|
|
}): Promise<PortfolioPerformanceResponse> {
|
|
|
|
userId = await this.getUserId(impersonationId, userId);
|
|
|
|
userId = await this.getUserId(impersonationId, userId);
|
|
|
|
const user = await this.userService.user({ id: userId });
|
|
|
|
const user = await this.userService.user({ id: userId });
|
|
|
@ -1124,7 +1129,8 @@ export class PortfolioService {
|
|
|
|
const { portfolioOrders, transactionPoints } =
|
|
|
|
const { portfolioOrders, transactionPoints } =
|
|
|
|
await this.getTransactionPoints({
|
|
|
|
await this.getTransactionPoints({
|
|
|
|
filters,
|
|
|
|
filters,
|
|
|
|
userId
|
|
|
|
userId,
|
|
|
|
|
|
|
|
withExcludedAccounts
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
@ -1174,7 +1180,8 @@ export class PortfolioService {
|
|
|
|
filters,
|
|
|
|
filters,
|
|
|
|
impersonationId,
|
|
|
|
impersonationId,
|
|
|
|
userCurrency,
|
|
|
|
userCurrency,
|
|
|
|
userId
|
|
|
|
userId,
|
|
|
|
|
|
|
|
withExcludedAccounts
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const itemOfToday = historicalDataContainer.items.find((item) => {
|
|
|
|
const itemOfToday = historicalDataContainer.items.find((item) => {
|
|
|
@ -1763,7 +1770,7 @@ export class PortfolioService {
|
|
|
|
filters,
|
|
|
|
filters,
|
|
|
|
includeDrafts = false,
|
|
|
|
includeDrafts = false,
|
|
|
|
userId,
|
|
|
|
userId,
|
|
|
|
withExcludedAccounts
|
|
|
|
withExcludedAccounts = false
|
|
|
|
}: {
|
|
|
|
}: {
|
|
|
|
filters?: Filter[];
|
|
|
|
filters?: Filter[];
|
|
|
|
includeDrafts?: boolean;
|
|
|
|
includeDrafts?: boolean;
|
|
|
@ -1851,7 +1858,7 @@ export class PortfolioService {
|
|
|
|
portfolioItemsNow,
|
|
|
|
portfolioItemsNow,
|
|
|
|
userCurrency,
|
|
|
|
userCurrency,
|
|
|
|
userId,
|
|
|
|
userId,
|
|
|
|
withExcludedAccounts
|
|
|
|
withExcludedAccounts = false
|
|
|
|
}: {
|
|
|
|
}: {
|
|
|
|
filters?: Filter[];
|
|
|
|
filters?: Filter[];
|
|
|
|
orders: OrderWithAccount[];
|
|
|
|
orders: OrderWithAccount[];
|
|
|
|