Browse Source
Feature/refactor X-ray summary (#4116)
* Refactor report statistics
pull/4118/head^2
Thomas Kaul
1 month ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
4 deletions
-
apps/api/src/app/portfolio/portfolio.service.ts
|
|
@ -1677,14 +1677,14 @@ export class PortfolioService { |
|
|
|
): PortfolioReportResponse['statistics'] { |
|
|
|
const rulesActiveCount = Object.values(evaluatedRules) |
|
|
|
.flat() |
|
|
|
.filter(({ isActive }) => { |
|
|
|
return isActive === true; |
|
|
|
.filter((rule) => { |
|
|
|
return rule?.isActive === true; |
|
|
|
}).length; |
|
|
|
|
|
|
|
const rulesFulfilledCount = Object.values(evaluatedRules) |
|
|
|
.flat() |
|
|
|
.filter(({ value }) => { |
|
|
|
return value === true; |
|
|
|
.filter((rule) => { |
|
|
|
return rule?.value === true; |
|
|
|
}).length; |
|
|
|
|
|
|
|
return { rulesActiveCount, rulesFulfilledCount }; |
|
|
|