Browse Source
Feature/add date of first activity to holdings (#1505)
* Add date of first activity
* Update changelog
pull/1507/head
Thomas Kaul
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with
36 additions and
1 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/portfolio.controller.ts
-
apps/api/src/app/portfolio/portfolio.service.ts
-
apps/client/src/app/components/positions-table/positions-table.component.html
-
apps/client/src/app/components/positions-table/positions-table.component.ts
-
apps/client/src/app/services/data.service.ts
-
libs/common/src/lib/interfaces/portfolio-position.interface.ts
-
libs/common/src/lib/interfaces/portfolio-public-details.interface.ts
|
|
@ -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 |
|
|
|
|
|
@ -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, |
|
|
|
|
|
@ -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, |
|
|
|
|
|
@ -42,6 +42,26 @@ |
|
|
|
</td> |
|
|
|
</ng-container> |
|
|
|
|
|
|
|
<ng-container matColumnDef="dateOfFirstActivity"> |
|
|
|
<th |
|
|
|
*matHeaderCellDef |
|
|
|
class="d-none d-lg-table-cell justify-content-end px-1" |
|
|
|
mat-header-cell |
|
|
|
mat-sort-header |
|
|
|
> |
|
|
|
<ng-container i18n>First Activity</ng-container> |
|
|
|
</th> |
|
|
|
<td *matCellDef="let element" class="d-none d-lg-table-cell px-1" mat-cell> |
|
|
|
<div class="d-flex justify-content-end"> |
|
|
|
<gf-value |
|
|
|
[isDate]="element.dateOfFirstActivity ? true : false" |
|
|
|
[locale]="locale" |
|
|
|
[value]="element.dateOfFirstActivity ?? ''" |
|
|
|
></gf-value> |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
</ng-container> |
|
|
|
|
|
|
|
<ng-container matColumnDef="value"> |
|
|
|
<th |
|
|
|
*matHeaderCellDef |
|
|
|
|
|
@ -56,7 +56,7 @@ export class PositionsTableComponent implements OnChanges, OnDestroy, OnInit { |
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
this.displayedColumns = ['icon', 'symbol', 'name']; |
|
|
|
this.displayedColumns = ['icon', 'symbol', 'name', 'dateOfFirstActivity']; |
|
|
|
|
|
|
|
if (this.hasPermissionToShowValues) { |
|
|
|
this.displayedColumns.push('value'); |
|
|
|
|
|
@ -269,6 +269,12 @@ export class DataService { |
|
|
|
response.holdings[symbol].assetSubClass = translate( |
|
|
|
response.holdings[symbol].assetSubClass |
|
|
|
); |
|
|
|
|
|
|
|
response.holdings[symbol].dateOfFirstActivity = response.holdings[ |
|
|
|
symbol |
|
|
|
].dateOfFirstActivity |
|
|
|
? parseISO(response.holdings[symbol].dateOfFirstActivity) |
|
|
|
: undefined; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -12,6 +12,7 @@ export interface PortfolioPosition { |
|
|
|
countries: Country[]; |
|
|
|
currency: string; |
|
|
|
dataSource: DataSource; |
|
|
|
dateOfFirstActivity: Date; |
|
|
|
exchange?: string; |
|
|
|
grossPerformance: number; |
|
|
|
grossPerformancePercent: number; |
|
|
|
|
|
@ -9,6 +9,7 @@ export interface PortfolioPublicDetails { |
|
|
|
| 'allocationCurrent' |
|
|
|
| 'countries' |
|
|
|
| 'currency' |
|
|
|
| 'dateOfFirstActivity' |
|
|
|
| 'markets' |
|
|
|
| 'name' |
|
|
|
| 'netPerformancePercent' |
|
|
|