diff --git a/CHANGELOG.md b/CHANGELOG.md index 46a940772..3bdae6e2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Added the value to the position detail dialog + ### Changed - Upgraded `angular` from version `12.2.4` to `13.0.2` diff --git a/apps/api/src/app/portfolio/interfaces/portfolio-position-detail.interface.ts b/apps/api/src/app/portfolio/interfaces/portfolio-position-detail.interface.ts index 336e5a2d4..069230983 100644 --- a/apps/api/src/app/portfolio/interfaces/portfolio-position-detail.interface.ts +++ b/apps/api/src/app/portfolio/interfaces/portfolio-position-detail.interface.ts @@ -19,6 +19,7 @@ export interface PortfolioPositionDetail { quantity: number; symbol: string; transactionCount: number; + value: number; } export interface HistoricalDataContainer { diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index 362badb8e..f4578e070 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -370,7 +370,8 @@ export class PortfolioController { 'grossPerformance', 'investment', 'netPerformance', - 'quantity' + 'quantity', + 'value' ]); } diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index e6279d1f4..76bf34f14 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -391,7 +391,8 @@ export class PortfolioService { netPerformancePercent: undefined, quantity: undefined, symbol: aSymbol, - transactionCount: undefined + transactionCount: undefined, + value: undefined }; } @@ -527,7 +528,12 @@ export class PortfolioService { historicalData: historicalDataArray, netPerformancePercent: position.netPerformancePercentage.toNumber(), quantity: quantity.toNumber(), - symbol: aSymbol + symbol: aSymbol, + value: this.exchangeRateDataService.toCurrency( + quantity.mul(marketPrice).toNumber(), + currency, + userCurrency + ) }; } else { const currentData = await this.dataProviderService.get([ @@ -584,7 +590,8 @@ export class PortfolioService { netPerformancePercent: undefined, quantity: 0, symbol: aSymbol, - transactionCount: undefined + transactionCount: undefined, + value: 0 }; } } diff --git a/apps/client/src/app/components/dialog-header/dialog-header.component.html b/apps/client/src/app/components/dialog-header/dialog-header.component.html index 0b683f9b9..c39c2ca7b 100644 --- a/apps/client/src/app/components/dialog-header/dialog-header.component.html +++ b/apps/client/src/app/components/dialog-header/dialog-header.component.html @@ -1,4 +1,8 @@ -{{ title }} +{{ title }}