Browse Source

Code review fixes

pull/4352/head
csehatt741 2 months ago
committed by Attila Cseh
parent
commit
b03c84e6fd
  1. 4
      apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
  2. 4
      apps/api/src/app/portfolio/calculator/twr/portfolio-calculator.ts
  3. 4
      libs/common/src/lib/models/portfolio-snapshot.ts

4
apps/api/src/app/portfolio/calculator/portfolio-calculator.ts

@ -175,6 +175,7 @@ export abstract class PortfolioCalculator {
if (!transactionPoints.length) {
return {
activitiesCount: 0,
currentValueInBaseCurrency: new Big(0),
errors: [],
hasErrors: false,
@ -185,8 +186,7 @@ export abstract class PortfolioCalculator {
totalInvestment: new Big(0),
totalInvestmentWithCurrencyEffect: new Big(0),
totalLiabilitiesWithCurrencyEffect: new Big(0),
totalValuablesWithCurrencyEffect: new Big(0),
activitiesCount: 0
totalValuablesWithCurrencyEffect: new Big(0)
};
}

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

@ -101,11 +101,11 @@ export class TWRPortfolioCalculator extends PortfolioCalculator {
totalInterestWithCurrencyEffect,
totalInvestment,
totalInvestmentWithCurrencyEffect,
activitiesCount: this.activities.length,
errors: [],
historicalData: [],
totalLiabilitiesWithCurrencyEffect: new Big(0),
totalValuablesWithCurrencyEffect: new Big(0),
activitiesCount: this.activities.length
totalValuablesWithCurrencyEffect: new Big(0)
};
}

4
libs/common/src/lib/models/portfolio-snapshot.ts

@ -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;
@ -45,6 +47,4 @@ export class PortfolioSnapshot {
@Transform(transformToBig, { toClassOnly: true })
@Type(() => Big)
totalValuablesWithCurrencyEffect: Big;
activitiesCount: number;
}

Loading…
Cancel
Save