Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/remove deprecated transaction count in portfolio calculator and service (#6288)

Thomas Kaul63e75942a8e2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53c9b42d8b..0942668697 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## Unreleased
+
+### Changed
+
+- Removed the `transactionCount` in the portfolio calculator and service
+
## 2.236.0 - 2026-02-05
### Changed
diff --git a/apps/api/src/app/account/account.service.ts b/apps/api/src/app/account/account.service.ts
index 398a89bb95..e1b01a6ed1 100644
--- a/apps/api/src/app/account/account.service.ts
+++ b/apps/api/src/app/account/account.service.ts
@@ -150,15 +150,15 @@ export class AccountService {
});
return accounts.map((account) => {
- let transactionCount = 0;
+ let activitiesCount = 0;
for (const { isDraft } of account.activities) {
if (!isDraft) {
- transactionCount += 1;
+ activitiesCount += 1;
}
}
- const result = { ...account, transactionCount };
+ const result = { ...account, activitiesCount };
delete result.activities;
diff --git a/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts b/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
index 9612ad1c42..2e58a4ef5e 100644
--- a/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
+++ b/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
@@ -445,7 +445,6 @@ export abstract class PortfolioCalculator {
quantity: item.quantity,
symbol: item.symbol,
tags: item.tags,
- transactionCount: item.transactionCount,
valueInBaseCurrency: new Big(marketPriceInBaseCurrency).mul(
item.quantity
)
@@ -1005,8 +1004,7 @@ export abstract class PortfolioCalculator {
oldAccumulatedSymbol.feeInBaseCurrency.plus(feeInBaseCurrency),
includeInHoldings: oldAccumulatedSymbol.includeInHoldings,
quantity: newQuantity,
- tags: oldAccumulatedSymbol.tags.concat(tags),
- transactionCount: oldAccumulatedSymbol.transactionCount + 1
+ tags: oldAccumulatedSymbol.tags.concat(tags)
};
} else {
currentTransactionPointItem = {
@@ -1024,8 +1022,7 @@ export abstract class PortfolioCalculator {
dividend: new Big(0),
includeInHoldings: INVESTMENT_ACTIVITY_TYPES.includes(type),
investment: unitPrice.mul(quantity).mul(factor),
- quantity: quantity.mul(factor),
- transactionCount: 1
+ quantity: quantity.mul(factor)
};
}
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts
index 7858d75464..52c8489dda 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts
@@ -178,7 +178,6 @@ describe('PortfolioCalculator', () => {
timeWeightedInvestmentWithCurrencyEffect: new Big(
'474.93846153846153846154'
),
- transactionCount: 2,
valueInBaseCurrency: new Big('595.6')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts
index 8b40c7b70a..3998b081d2 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts
@@ -192,7 +192,6 @@ describe('PortfolioCalculator', () => {
timeWeightedInvestmentWithCurrencyEffect: new Big(
'285.80000000000000396627'
),
- transactionCount: 3,
valueInBaseCurrency: new Big('0')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts
index fc372f68f2..acd0d0b2e7 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts
@@ -176,7 +176,6 @@ describe('PortfolioCalculator', () => {
tags: [],
timeWeightedInvestment: new Big('285.8'),
timeWeightedInvestmentWithCurrencyEffect: new Big('285.8'),
- transactionCount: 2,
valueInBaseCurrency: new Big('0')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts
index 926fae6dcc..652e72db00 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts
@@ -172,7 +172,6 @@ describe('PortfolioCalculator', () => {
tags: [],
timeWeightedInvestment: new Big('273.2'),
timeWeightedInvestmentWithCurrencyEffect: new Big('273.2'),
- transactionCount: 1,
valueInBaseCurrency: new Big('297.8')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts
index b216438b8a..0553563253 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts
@@ -227,7 +227,6 @@ describe('PortfolioCalculator', () => {
tags: [],
timeWeightedInvestment: new Big('44558.42'),
timeWeightedInvestmentWithCurrencyEffect: new Big('44558.42'),
- transactionCount: 1,
valueInBaseCurrency: new Big('43099.7')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts
index 14cd4f2175..a70cc29867 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts
@@ -194,7 +194,6 @@ describe('PortfolioCalculator', () => {
timeWeightedInvestmentWithCurrencyEffect: new Big(
'636.79389574611155533947'
),
- transactionCount: 2,
valueInBaseCurrency: new Big('13298.425356')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts
index 066f33ea38..64882061f3 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts
@@ -227,7 +227,6 @@ describe('PortfolioCalculator', () => {
tags: [],
timeWeightedInvestment: new Big('44558.42'),
timeWeightedInvestmentWithCurrencyEffect: new Big('44558.42'),
- transactionCount: 1,
valueInBaseCurrency: new Big('43099.7')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts
index bd8afddd74..a53ebcf055 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts
@@ -276,7 +276,6 @@ describe('PortfolioCalculator', () => {
timeWeightedInvestmentWithCurrencyEffect: new Big(
'852.45231607629427792916'
),
- transactionCount: 2,
valueInBaseCurrency: new Big(1820)
});
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts
index 28b44e1590..9b48a1324d 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts
@@ -172,7 +172,6 @@ describe('PortfolioCalculator', () => {
tags: [],
timeWeightedInvestment: new Big('89.12').mul(0.8854),
timeWeightedInvestmentWithCurrencyEffect: new Big('82.329056'),
- transactionCount: 1,
valueInBaseCurrency: new Big('103.10483')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts
index 87ef9ed8b8..b19adb6427 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts
@@ -162,8 +162,7 @@ describe('PortfolioCalculator', () => {
},
quantity: new Big('1'),
symbol: 'MSFT',
- tags: [],
- transactionCount: 2
+ tags: []
}
],
totalFeesWithCurrencyEffect: new Big('19'),
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts
index 7a8dc010a8..fecf170111 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts
@@ -174,7 +174,6 @@ describe('PortfolioCalculator', () => {
timeWeightedInvestmentWithCurrencyEffect: new Big(
'145.10285714285714285714'
),
- transactionCount: 2,
valueInBaseCurrency: new Big('87.8')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts
index 02a4e80d8d..adbb5c3ff4 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts
@@ -225,7 +225,6 @@ describe('PortfolioCalculator', () => {
tags: [],
timeWeightedInvestment: new Big('151.6'),
timeWeightedInvestmentWithCurrencyEffect: new Big('151.6'),
- transactionCount: 2,
valueInBaseCurrency: new Big('0')
}
],
diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts
index 610a52c069..6fc94622fb 100644
--- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts
+++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts
@@ -146,7 +146,6 @@ describe('PortfolioCalculator', () => {
tags: [],
timeWeightedInvestment: new Big('500000'),
timeWeightedInvestmentWithCurrencyEffect: new Big('500000'),
- transactionCount: 1,
valueInBaseCurrency: new Big('500000')
}
],
diff --git a/apps/api/src/app/portfolio/interfaces/transaction-point-symbol.interface.ts b/apps/api/src/app/portfolio/interfaces/transaction-point-symbol.interface.ts
index 7e7d741ea3..7f3f54ff5e 100644
--- a/apps/api/src/app/portfolio/interfaces/transaction-point-symbol.interface.ts
+++ b/apps/api/src/app/portfolio/interfaces/transaction-point-symbol.interface.ts
@@ -17,7 +17,4 @@ export interface TransactionPointSymbol {
skipErrors: boolean;
symbol: string;
tags?: Tag[];
-
- /** @deprecated use activitiesCount instead */
- transactionCount: number;
}
diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts
index 05df6a8fcf..7be3754737 100644
--- a/apps/api/src/app/portfolio/portfolio.service.ts
+++ b/apps/api/src/app/portfolio/portfolio.service.ts
@@ -233,7 +233,6 @@ export class PortfolioService {
account.currency,
userCurrency
),
- transactionCount: activitiesCount,
value: this.exchangeRateDataService.toCurrency(
valueInBaseCurrency,
userCurrency,
@@ -284,7 +283,6 @@ export class PortfolioService {
let totalDividendInBaseCurrency = new Big(0);
let totalInterestInBaseCurrency = new Big(0);
let totalValueInBaseCurrency = new Big(0);
- let transactionCount = 0;
for (const account of accounts) {
activitiesCount += account.activitiesCount;
@@ -301,8 +299,6 @@ export class PortfolioService {
totalValueInBaseCurrency = totalValueInBaseCurrency.plus(
account.valueInBaseCurrency
);
-
- transactionCount += account.transactionCount;
}
for (const account of accounts) {
@@ -317,7 +313,6 @@ export class PortfolioService {
return {
accounts,
activitiesCount,
- transactionCount,
totalBalanceInBaseCurrency: totalBalanceInBaseCurrency.toNumber(),
totalDividendInBaseCurrency: totalDividendInBaseCurrency.toNumber(),
totalInterestInBaseCurrency: totalInterestInBaseCurrency.toNumber(),
@@ -591,7 +586,6 @@ export class PortfolioService {
quantity,
symbol,
tags,
- transactionCount,
valueInBaseCurrency
} of positions) {
if (isFilteredByClosedHoldings === true) {
@@ -625,7 +619,6 @@ export class PortfolioService {
marketPrice,
symbol,
tags,
- transactionCount,
allocationInPercentage: filteredValueInBaseCurrency.eq(0)
? 0
: valueInBaseCurrency.div(filteredValueInBaseCurrency).toNumber(),
@@ -1696,7 +1689,6 @@ export class PortfolioService {
sectors: [],
symbol: currency,
tags: [],
- transactionCount: 0,
valueInBaseCurrency: balance
};
}
diff --git a/apps/api/src/helper/object.helper.spec.ts b/apps/api/src/helper/object.helper.spec.ts
index 5ddff164b2..ed821390fa 100644
--- a/apps/api/src/helper/object.helper.spec.ts
+++ b/apps/api/src/helper/object.helper.spec.ts
@@ -111,6 +111,7 @@ describe('redactAttributes', () => {
hasError: false,
holdings: {
'AAPL.US': {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -130,7 +131,6 @@ describe('redactAttributes', () => {
marketPrice: 220.79,
symbol: 'AAPL.US',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.044900865255793135,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -163,6 +163,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.0694356974830054
},
'ALV.DE': {
+ activitiesCount: 2,
currency: 'EUR',
markets: {
UNKNOWN: 0,
@@ -182,7 +183,6 @@ describe('redactAttributes', () => {
marketPrice: 296.5,
symbol: 'ALV.DE',
tags: [],
- transactionCount: 2,
allocationInPercentage: 0.026912563036519527,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -210,6 +210,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.04161818652826481
},
AMZN: {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -229,7 +230,6 @@ describe('redactAttributes', () => {
marketPrice: 187.99,
symbol: 'AMZN',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.07646101417126275,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -262,6 +262,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.11824101426541227
},
bitcoin: {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 36985.0332704,
@@ -287,7 +288,6 @@ describe('redactAttributes', () => {
userId: null
}
],
- transactionCount: 1,
allocationInPercentage: 0.15042891393226654,
assetClass: 'LIQUIDITY',
assetSubClass: 'CRYPTOCURRENCY',
@@ -313,6 +313,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.232626620912395
},
BONDORA_GO_AND_GROW: {
+ activitiesCount: 5,
currency: 'EUR',
markets: {
UNKNOWN: 2231.644722160232,
@@ -338,7 +339,6 @@ describe('redactAttributes', () => {
userId: null
}
],
- transactionCount: 5,
allocationInPercentage: 0.009076749759365777,
assetClass: 'FIXED_INCOME',
assetSubClass: 'BOND',
@@ -364,6 +364,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.014036487867880205
},
FRANKLY95P: {
+ activitiesCount: 6,
currency: 'CHF',
markets: {
UNKNOWN: 0,
@@ -389,7 +390,6 @@ describe('redactAttributes', () => {
userId: null
}
],
- transactionCount: 6,
allocationInPercentage: 0.09095764645669335,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
@@ -488,6 +488,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.14065892911313693
},
MSFT: {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -507,7 +508,6 @@ describe('redactAttributes', () => {
marketPrice: 428.02,
symbol: 'MSFT',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.05222646409742627,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -540,6 +540,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.08076416659271518
},
TSLA: {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -559,7 +560,6 @@ describe('redactAttributes', () => {
marketPrice: 260.46,
symbol: 'TSLA',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.1589050142378352,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -592,6 +592,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.2457342510950259
},
VTI: {
+ activitiesCount: 5,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -611,7 +612,6 @@ describe('redactAttributes', () => {
marketPrice: 282.05,
symbol: 'VTI',
tags: [],
- transactionCount: 5,
allocationInPercentage: 0.057358979326040366,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
@@ -764,6 +764,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.08870120238725339
},
'VWRL.SW': {
+ activitiesCount: 5,
currency: 'CHF',
markets: {
UNKNOWN: 0,
@@ -783,7 +784,6 @@ describe('redactAttributes', () => {
marketPrice: 117.62,
symbol: 'VWRL.SW',
tags: [],
- transactionCount: 5,
allocationInPercentage: 0.09386983901959013,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
@@ -1172,6 +1172,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.145162408515095
},
'XDWD.DE': {
+ activitiesCount: 1,
currency: 'EUR',
markets: {
UNKNOWN: 0,
@@ -1191,7 +1192,6 @@ describe('redactAttributes', () => {
marketPrice: 105.72,
symbol: 'XDWD.DE',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.03598477442100562,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
@@ -1450,6 +1450,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.055647656152211074
},
USD: {
+ activitiesCount: 0,
currency: 'USD',
allocationInPercentage: 0.20291717628620132,
assetClass: 'LIQUIDITY',
@@ -1472,7 +1473,6 @@ describe('redactAttributes', () => {
sectors: [],
symbol: 'USD',
tags: [],
- transactionCount: 0,
valueInBaseCurrency: 49890,
valueInPercentage: 0.3137956381563603
}
@@ -1615,6 +1615,7 @@ describe('redactAttributes', () => {
hasError: false,
holdings: {
'AAPL.US': {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -1634,7 +1635,6 @@ describe('redactAttributes', () => {
marketPrice: 220.79,
symbol: 'AAPL.US',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.044900865255793135,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -1667,6 +1667,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.0694356974830054
},
'ALV.DE': {
+ activitiesCount: 2,
currency: 'EUR',
markets: {
UNKNOWN: 0,
@@ -1686,7 +1687,6 @@ describe('redactAttributes', () => {
marketPrice: 296.5,
symbol: 'ALV.DE',
tags: [],
- transactionCount: 2,
allocationInPercentage: 0.026912563036519527,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -1714,6 +1714,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.04161818652826481
},
AMZN: {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -1733,7 +1734,6 @@ describe('redactAttributes', () => {
marketPrice: 187.99,
symbol: 'AMZN',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.07646101417126275,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -1766,6 +1766,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.11824101426541227
},
bitcoin: {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 36985.0332704,
@@ -1791,7 +1792,6 @@ describe('redactAttributes', () => {
userId: null
}
],
- transactionCount: 1,
allocationInPercentage: 0.15042891393226654,
assetClass: 'LIQUIDITY',
assetSubClass: 'CRYPTOCURRENCY',
@@ -1817,6 +1817,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.232626620912395
},
BONDORA_GO_AND_GROW: {
+ activitiesCount: 5,
currency: 'EUR',
markets: {
UNKNOWN: 2231.644722160232,
@@ -1842,7 +1843,6 @@ describe('redactAttributes', () => {
userId: null
}
],
- transactionCount: 5,
allocationInPercentage: 0.009076749759365777,
assetClass: 'FIXED_INCOME',
assetSubClass: 'BOND',
@@ -1868,6 +1868,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.014036487867880205
},
FRANKLY95P: {
+ activitiesCount: 6,
currency: 'CHF',
markets: {
UNKNOWN: 0,
@@ -1893,7 +1894,6 @@ describe('redactAttributes', () => {
userId: null
}
],
- transactionCount: 6,
allocationInPercentage: 0.09095764645669335,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
@@ -1972,6 +1972,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.14065892911313693
},
MSFT: {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -1991,7 +1992,6 @@ describe('redactAttributes', () => {
marketPrice: 428.02,
symbol: 'MSFT',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.05222646409742627,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -2024,6 +2024,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.08076416659271518
},
TSLA: {
+ activitiesCount: 1,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -2043,7 +2044,6 @@ describe('redactAttributes', () => {
marketPrice: 260.46,
symbol: 'TSLA',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.1589050142378352,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
@@ -2076,6 +2076,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.2457342510950259
},
VTI: {
+ activitiesCount: 5,
currency: 'USD',
markets: {
UNKNOWN: 0,
@@ -2095,7 +2096,6 @@ describe('redactAttributes', () => {
marketPrice: 282.05,
symbol: 'VTI',
tags: [],
- transactionCount: 5,
allocationInPercentage: 0.057358979326040366,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
@@ -2248,6 +2248,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.08870120238725339
},
'VWRL.SW': {
+ activitiesCount: 5,
currency: 'CHF',
markets: {
UNKNOWN: 0,
@@ -2267,7 +2268,6 @@ describe('redactAttributes', () => {
marketPrice: 117.62,
symbol: 'VWRL.SW',
tags: [],
- transactionCount: 5,
allocationInPercentage: 0.09386983901959013,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
@@ -2648,6 +2648,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.145162408515095
},
'XDWD.DE': {
+ activitiesCount: 1,
currency: 'EUR',
markets: {
UNKNOWN: 0,
@@ -2667,7 +2668,6 @@ describe('redactAttributes', () => {
marketPrice: 105.72,
symbol: 'XDWD.DE',
tags: [],
- transactionCount: 1,
allocationInPercentage: 0.03598477442100562,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
@@ -2926,6 +2926,7 @@ describe('redactAttributes', () => {
valueInPercentage: 0.055647656152211074
},
USD: {
+ activitiesCount: 0,
currency: 'USD',
allocationInPercentage: 0.20291717628620132,
assetClass: 'LIQUIDITY',
@@ -2948,7 +2949,6 @@ describe('redactAttributes', () => {
sectors: [],
symbol: 'USD',
tags: [],
- transactionCount: 0,
valueInBaseCurrency: null,
valueInPercentage: 0.3137956381563603
}
diff --git a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
index b40043cc88..380fb69cb5 100644
--- a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
+++ b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
@@ -80,6 +80,7 @@ import { AccountDetailDialogParams } from './interfaces/interfaces';
export class GfAccountDetailDialogComponent implements OnDestroy, OnInit {
public accountBalances: AccountBalancesResponse['balances'];
public activities: OrderWithAccount[];
+ public activitiesCount: number;
public balance: number;
public balancePrecision = 2;
public currency: string;
@@ -100,7 +101,6 @@ export class GfAccountDetailDialogComponent implements OnDestroy, OnInit {
public sortColumn = 'date';
public sortDirection: SortDirection = 'desc';
public totalItems: number;
- public transactionCount: number;
public user: User;
public valueInBaseCurrency: number;
@@ -215,16 +215,17 @@ export class GfAccountDetailDialogComponent implements OnDestroy, OnInit {
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(
({
+ activitiesCount,
balance,
currency,
dividendInBaseCurrency,
interestInBaseCurrency,
name,
platform,
- transactionCount,
value,
valueInBaseCurrency
}) => {
+ this.activitiesCount = activitiesCount;
this.balance = balance;
if (
@@ -270,7 +271,6 @@ export class GfAccountDetailDialogComponent implements OnDestroy, OnInit {
this.name = name;
this.platformName = platform?.name ?? '-';
- this.transactionCount = transactionCount;
this.valueInBaseCurrency = valueInBaseCurrency;
this.changeDetectorRef.markForCheck();
diff --git a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html
index 07ea17038e..15dd8f13a1 100644
--- a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html
+++ b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html
@@ -82,7 +82,7 @@
>
</div>
<div class="col-6 mb-3">
- <gf-value i18n size="medium" [value]="transactionCount"
+ <gf-value i18n size="medium" [value]="activitiesCount"
>Activities</gf-value
>
</div>
diff --git a/libs/common/src/lib/interfaces/portfolio-position.interface.ts b/libs/common/src/lib/interfaces/portfolio-position.interface.ts
index 67a2f3e77c..620cc00e95 100644
--- a/libs/common/src/lib/interfaces/portfolio-position.interface.ts
+++ b/libs/common/src/lib/interfaces/portfolio-position.interface.ts
@@ -39,10 +39,6 @@ export interface PortfolioPosition {
sectors: Sector[];
symbol: string;
tags?: Tag[];
-
- /** @deprecated use activitiesCount instead */
- transactionCount: number;
-
type?: string;
url?: string;
valueInBaseCurrency?: number;
diff --git a/libs/common/src/lib/interfaces/responses/accounts-response.interface.ts b/libs/common/src/lib/interfaces/responses/accounts-response.interface.ts
index 1891b9cbbd..90f1303e02 100644
--- a/libs/common/src/lib/interfaces/responses/accounts-response.interface.ts
+++ b/libs/common/src/lib/interfaces/responses/accounts-response.interface.ts
@@ -7,7 +7,4 @@ export interface AccountsResponse {
totalDividendInBaseCurrency: number;
totalInterestInBaseCurrency: number;
totalValueInBaseCurrency: number;
-
- /** @deprecated use activitiesCount instead */
- transactionCount: number;
}
diff --git a/libs/common/src/lib/models/timeline-position.ts b/libs/common/src/lib/models/timeline-position.ts
index 9cfb2df04d..13f9001d59 100644
--- a/libs/common/src/lib/models/timeline-position.ts
+++ b/libs/common/src/lib/models/timeline-position.ts
@@ -93,9 +93,6 @@ export class TimelinePosition {
@Type(() => Big)
timeWeightedInvestmentWithCurrencyEffect: Big;
- /** @deprecated use activitiesCount instead */
- transactionCount: number;
-
@Transform(transformToBig, { toClassOnly: true })
@Type(() => Big)
valueInBaseCurrency: Big;
diff --git a/libs/common/src/lib/types/account-with-value.type.ts b/libs/common/src/lib/types/account-with-value.type.ts
index 7f5fe79ba8..23cb147492 100644
--- a/libs/common/src/lib/types/account-with-value.type.ts
+++ b/libs/common/src/lib/types/account-with-value.type.ts
@@ -7,10 +7,6 @@ export type AccountWithValue = AccountModel & {
dividendInBaseCurrency: number;
interestInBaseCurrency: number;
platform?: Platform;
-
- /** @deprecated use activitiesCount instead */
- transactionCount: number;
-
value: number;
valueInBaseCurrency: number;
};
diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.html b/libs/ui/src/lib/accounts-table/accounts-table.component.html
index c9124820c8..68ae784747 100644
--- a/libs/ui/src/lib/accounts-table/accounts-table.component.html
+++ b/libs/ui/src/lib/accounts-table/accounts-table.component.html
@@ -120,13 +120,13 @@
*matHeaderCellDef
class="justify-content-end px-1"
mat-header-cell
- mat-sort-header="transactionCount"
+ mat-sort-header="activitiesCount"
>
<span class="d-block d-sm-none">#</span>
<span class="d-none d-sm-block" i18n>Activities</span>
</th>
<td *matCellDef="let element" class="px-1 text-right" mat-cell>
- {{ element.transactionCount }}
+ {{ element.activitiesCount }}
</td>
<td *matFooterCellDef class="px-1 text-right" mat-footer-cell>
{{ activitiesCount }}
@@ -323,7 +323,7 @@
<hr class="m-0" />
<button
mat-menu-item
- [disabled]="element.transactionCount > 0"
+ [disabled]="element.activitiesCount > 0"
(click)="onDeleteAccount(element.id)"
>
<span class="align-items-center d-flex">
diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts b/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts
index 96da4419dc..594db4c6ad 100644
--- a/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts
+++ b/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts
@@ -16,6 +16,7 @@ import { GfAccountsTableComponent } from './accounts-table.component';
const accounts = [
{
+ activitiesCount: 0,
allocationInPercentage: null,
balance: 278,
balanceInBaseCurrency: 278,
@@ -31,13 +32,13 @@ const accounts = [
url: 'https://www.coinbase.com'
},
platformId: '8dc24b88-bb92-4152-af25-fe6a31643e26',
- transactionCount: 0,
updatedAt: new Date('2025-06-01T06:52:49.063Z'),
userId: '081aa387-487d-4438-83a4-3060eb2a016e',
value: 278,
valueInBaseCurrency: 278
},
{
+ activitiesCount: 0,
allocationInPercentage: null,
balance: 12000,
balanceInBaseCurrency: 12000,
@@ -53,13 +54,13 @@ const accounts = [
url: 'https://www.jpmorgan.com'
},
platformId: '43e8fcd1-5b79-4100-b678-d2229bd1660d',
- transactionCount: 0,
updatedAt: new Date('2025-06-01T06:48:53.055Z'),
userId: '081aa387-487d-4438-83a4-3060eb2a016e',
value: 12000,
valueInBaseCurrency: 12000
},
{
+ activitiesCount: 12,
allocationInPercentage: null,
balance: 150.2,
balanceInBaseCurrency: 150.2,
@@ -75,7 +76,6 @@ const accounts = [
url: 'https://interactivebrokers.com'
},
platformId: '9da3a8a7-4795-43e3-a6db-ccb914189737',
- transactionCount: 12,
valueInBaseCurrency: 95693.70321466809,
updatedAt: new Date('2025-06-01T06:53:10.569Z'),
userId: '081aa387-487d-4438-83a4-3060eb2a016e',
diff --git a/libs/ui/src/lib/mocks/holdings.ts b/libs/ui/src/lib/mocks/holdings.ts
index 0f30b3e6f9..3f57af8846 100644
--- a/libs/ui/src/lib/mocks/holdings.ts
+++ b/libs/ui/src/lib/mocks/holdings.ts
@@ -41,7 +41,6 @@ export const holdings: PortfolioPosition[] = [
],
symbol: 'AAPL',
tags: [],
- transactionCount: 1,
url: 'https://www.apple.com',
valueInBaseCurrency: 12230
},
@@ -85,7 +84,6 @@ export const holdings: PortfolioPosition[] = [
],
symbol: 'ALV.DE',
tags: [],
- transactionCount: 2,
url: 'https://www.allianz.com',
valueInBaseCurrency: 6763.224181360202
},
@@ -129,7 +127,6 @@ export const holdings: PortfolioPosition[] = [
],
symbol: 'AMZN',
tags: [],
- transactionCount: 1,
url: 'https://www.aboutamazon.com',
valueInBaseCurrency: 22868
},
@@ -161,7 +158,6 @@ export const holdings: PortfolioPosition[] = [
sectors: [],
symbol: 'bitcoin',
tags: [],
- transactionCount: 1,
url: null,
valueInBaseCurrency: 54666.7898248
},
@@ -205,7 +201,6 @@ export const holdings: PortfolioPosition[] = [
],
symbol: 'MSFT',
tags: [],
- transactionCount: 1,
url: 'https://www.microsoft.com',
valueInBaseCurrency: 12252.9
},
@@ -249,7 +244,6 @@ export const holdings: PortfolioPosition[] = [
],
symbol: 'TSLA',
tags: [],
- transactionCount: 1,
url: 'https://www.tesla.com',
valueInBaseCurrency: 53376
},
@@ -293,7 +287,6 @@ export const holdings: PortfolioPosition[] = [
],
symbol: 'VTI',
tags: [],
- transactionCount: 5,
url: 'https://www.vanguard.com',
valueInBaseCurrency: 15092
}