Browse Source

Improve value redaction in portfolio details endpoint

pull/3039/head
Thomas Kaul 2 years ago
parent
commit
b7626f456b
  1. 5
      apps/api/src/app/portfolio/portfolio.controller.ts
  2. 2
      apps/api/src/interceptors/redact-values-in-response.interceptor.ts

5
apps/api/src/app/portfolio/portfolio.controller.ts

@ -135,13 +135,8 @@ export class PortfolioController {
.reduce((a, b) => a + b, 0);
for (const [symbol, portfolioPosition] of Object.entries(holdings)) {
portfolioPosition.grossPerformance = null;
portfolioPosition.grossPerformanceWithCurrencyEffect = null;
portfolioPosition.investment =
portfolioPosition.investment / totalInvestment;
portfolioPosition.netPerformance = null;
portfolioPosition.netPerformanceWithCurrencyEffect = null;
portfolioPosition.quantity = null;
portfolioPosition.valueInPercentage =
portfolioPosition.valueInBaseCurrency / totalValue;
}

2
apps/api/src/interceptors/redact-values-in-response.interceptor.ts

@ -51,8 +51,10 @@ export class RedactValuesInResponseInterceptor<T>
'feeInBaseCurrency',
'filteredValueInBaseCurrency',
'grossPerformance',
'grossPerformanceWithCurrencyEffect',
'investment',
'netPerformance',
'netPerformanceWithCurrencyEffect',
'quantity',
'symbolMapping',
'totalBalanceInBaseCurrency',

Loading…
Cancel
Save