Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

add errors in case gross performance is not set

Valentin Zickner9b1e9397a8f5
diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts
index 6c701cbe55..b99b055376 100644
--- a/apps/api/src/app/portfolio/portfolio.service.ts
+++ b/apps/api/src/app/portfolio/portfolio.service.ts
@@ -474,16 +474,18 @@ export class PortfolioService {
new Big(currentPosition.marketPrice).mul(currentPosition.quantity)
);
if (currentPosition.grossPerformance) {
- hasErrors = true;
grossPerformance = grossPerformance.plus(
currentPosition.grossPerformance
);
+ } else {
+ hasErrors = true;
}
if (currentPosition.grossPerformancePercentage) {
- hasErrors = true;
grossPerformancePercentage = grossPerformancePercentage.mul(
currentPosition.grossPerformancePercentage.plus(1)
);
+ } else {
+ hasErrors = true;
}
}