Merge branch 'main' of github.com:ghostfolio/ghostfolio
All checks were successful
Docker image CD / build_and_push (push) Successful in 31m43s

This commit is contained in:
sudacode 2025-02-24 19:27:30 -08:00
commit aa43b674f7
4 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Extended the export functionality by the tags
- Extended the portfolio snapshot in the portfolio calculator by the activities count
- Extended the user endpoint `GET api/v1/user` by the activities count
### Changed

View File

@ -175,6 +175,7 @@ export abstract class PortfolioCalculator {
if (!transactionPoints.length) {
return {
activitiesCount: 0,
currentValueInBaseCurrency: new Big(0),
errors: [],
hasErrors: false,

View File

@ -101,6 +101,9 @@ export class TWRPortfolioCalculator extends PortfolioCalculator {
totalInterestWithCurrencyEffect,
totalInvestment,
totalInvestmentWithCurrencyEffect,
activitiesCount: this.activities.filter(({ type }) => {
return ['BUY', 'SELL'].includes(type);
}).length,
errors: [],
historicalData: [],
totalLiabilitiesWithCurrencyEffect: new Big(0),

View File

@ -9,6 +9,8 @@ import { Big } from 'big.js';
import { Transform, Type } from 'class-transformer';
export class PortfolioSnapshot {
activitiesCount: number;
@Transform(transformToBig, { toClassOnly: true })
@Type(() => Big)
currentValueInBaseCurrency: Big;