Browse Source

Feature/optimize portfolio calculations with smarter cloning of activities (#3827)

* Optimize portfolio calculations with smarter cloning of activities

* Update changelog
pull/3824/head^2
ceroma 1 week ago
committed by GitHub
parent
commit
33de8a10bb
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6
      apps/api/src/app/portfolio/calculator/twr/portfolio-calculator.ts

1
CHANGELOG.md

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Optimized the portfolio calculations with smarter cloning of activities
- Integrated the add currency functionality into the market data section of the admin control panel
- Improved the language localization for German (`de`)
- Upgraded `prisma` from version `5.19.1` to `5.20.0`

6
apps/api/src/app/portfolio/calculator/twr/portfolio-calculator.ts

@ -180,10 +180,10 @@ export class TWRPortfolioCalculator extends PortfolioCalculator {
let valueAtStartDateWithCurrencyEffect: Big;
// Clone orders to keep the original values in this.orders
let orders: PortfolioOrderItem[] = cloneDeep(this.activities).filter(
({ SymbolProfile }) => {
let orders: PortfolioOrderItem[] = cloneDeep(
this.activities.filter(({ SymbolProfile }) => {
return SymbolProfile.symbol === symbol;
}
})
);
if (orders.length <= 0) {

Loading…
Cancel
Save