From 49dcade964d3acea6daa8656f78a2f191856381a Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sun, 11 Dec 2022 10:19:35 +0100
Subject: [PATCH] Feature/add date of first activity to holdings (#1505)
* Add date of first activity
* Update changelog
---
CHANGELOG.md | 4 ++++
.../src/app/portfolio/portfolio.controller.ts | 1 +
.../src/app/portfolio/portfolio.service.ts | 2 ++
.../positions-table.component.html | 20 +++++++++++++++++++
.../positions-table.component.ts | 2 +-
apps/client/src/app/services/data.service.ts | 6 ++++++
.../portfolio-position.interface.ts | 1 +
.../portfolio-public-details.interface.ts | 1 +
8 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 87015d76..acdd804c 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 date of the first activity to the positions table
+
### Changed
- Improved the asset profile details dialog in the admin control panel
diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts
index a0f676ff..46f55564 100644
--- a/apps/api/src/app/portfolio/portfolio.controller.ts
+++ b/apps/api/src/app/portfolio/portfolio.controller.ts
@@ -422,6 +422,7 @@ export class PortfolioController {
allocationCurrent: portfolioPosition.value / totalValue,
countries: hasDetails ? portfolioPosition.countries : [],
currency: hasDetails ? portfolioPosition.currency : undefined,
+ dateOfFirstActivity: portfolioPosition.dateOfFirstActivity,
markets: hasDetails ? portfolioPosition.markets : undefined,
name: portfolioPosition.name,
netPerformancePercent: portfolioPosition.netPerformancePercent,
diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts
index 0db7d581..a8c26afa 100644
--- a/apps/api/src/app/portfolio/portfolio.service.ts
+++ b/apps/api/src/app/portfolio/portfolio.service.ts
@@ -533,6 +533,7 @@ export class PortfolioService {
countries: symbolProfile.countries,
currency: item.currency,
dataSource: symbolProfile.dataSource,
+ dateOfFirstActivity: parseDate(item.firstBuyDate),
grossPerformance: item.grossPerformance?.toNumber() ?? 0,
grossPerformancePercent:
item.grossPerformancePercentage?.toNumber() ?? 0,
@@ -1329,6 +1330,7 @@ export class PortfolioService {
assetSubClass: AssetClass.CASH,
countries: [],
dataSource: undefined,
+ dateOfFirstActivity: undefined,
grossPerformance: 0,
grossPerformancePercent: 0,
investment: balance,
diff --git a/apps/client/src/app/components/positions-table/positions-table.component.html b/apps/client/src/app/components/positions-table/positions-table.component.html
index 3f9a0cb4..cb72cddb 100644
--- a/apps/client/src/app/components/positions-table/positions-table.component.html
+++ b/apps/client/src/app/components/positions-table/positions-table.component.html
@@ -42,6 +42,26 @@
+
+
+ First Activity
+ |
+
+
+
+
+ |
+
+
|