From 9f2e9e23b087c2c5f1f8a16105f01e5c890c8fae Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Thu, 10 Jul 2025 09:24:21 +0700 Subject: [PATCH] resolve comments --- .../src/app/portfolio/calculator/roai/portfolio-calculator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator.ts index 735e75f08..039c6cabc 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator.ts @@ -237,10 +237,10 @@ export class RoaiPortfolioCalculator extends PortfolioCalculator { if ( !unitPriceAtEndDate && dataSource === 'MANUAL' && - lastOrder?.type === 'BUY' && + ['BUY', 'SELL'].includes(lastOrder?.type) && lastOrder?.unitPrice ) { - // For BUY activities with a MANUAL data source where no historical market price is available, + // For BUY/SELL activities with a MANUAL data source where no historical market price is available, // the calculation should fall back to using the activity's unit price. unitPriceAtEndDate = lastOrder.unitPrice; }