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 3 months ago committed by GitHub
parent ed30549f6b
commit 33de8a10bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

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

Loading…
Cancel
Save