Feature/add date of first activity to holdings (#1505)

* Add date of first activity

* Update changelog
This commit is contained in:
Thomas Kaul 2022-12-11 10:19:35 +01:00 committed by GitHub
parent 7cd65eed39
commit 49dcade964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 1 deletions

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased ## Unreleased
### Added
- Added the date of the first activity to the positions table
### Changed ### Changed
- Improved the asset profile details dialog in the admin control panel - Improved the asset profile details dialog in the admin control panel

View File

@ -422,6 +422,7 @@ export class PortfolioController {
allocationCurrent: portfolioPosition.value / totalValue, allocationCurrent: portfolioPosition.value / totalValue,
countries: hasDetails ? portfolioPosition.countries : [], countries: hasDetails ? portfolioPosition.countries : [],
currency: hasDetails ? portfolioPosition.currency : undefined, currency: hasDetails ? portfolioPosition.currency : undefined,
dateOfFirstActivity: portfolioPosition.dateOfFirstActivity,
markets: hasDetails ? portfolioPosition.markets : undefined, markets: hasDetails ? portfolioPosition.markets : undefined,
name: portfolioPosition.name, name: portfolioPosition.name,
netPerformancePercent: portfolioPosition.netPerformancePercent, netPerformancePercent: portfolioPosition.netPerformancePercent,

View File

@ -533,6 +533,7 @@ export class PortfolioService {
countries: symbolProfile.countries, countries: symbolProfile.countries,
currency: item.currency, currency: item.currency,
dataSource: symbolProfile.dataSource, dataSource: symbolProfile.dataSource,
dateOfFirstActivity: parseDate(item.firstBuyDate),
grossPerformance: item.grossPerformance?.toNumber() ?? 0, grossPerformance: item.grossPerformance?.toNumber() ?? 0,
grossPerformancePercent: grossPerformancePercent:
item.grossPerformancePercentage?.toNumber() ?? 0, item.grossPerformancePercentage?.toNumber() ?? 0,
@ -1329,6 +1330,7 @@ export class PortfolioService {
assetSubClass: AssetClass.CASH, assetSubClass: AssetClass.CASH,
countries: [], countries: [],
dataSource: undefined, dataSource: undefined,
dateOfFirstActivity: undefined,
grossPerformance: 0, grossPerformance: 0,
grossPerformancePercent: 0, grossPerformancePercent: 0,
investment: balance, investment: balance,

View File

@ -42,6 +42,26 @@
</td> </td>
</ng-container> </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"> <ng-container matColumnDef="value">
<th <th
*matHeaderCellDef *matHeaderCellDef

View File

@ -56,7 +56,7 @@ export class PositionsTableComponent implements OnChanges, OnDestroy, OnInit {
public ngOnInit() {} public ngOnInit() {}
public ngOnChanges() { public ngOnChanges() {
this.displayedColumns = ['icon', 'symbol', 'name']; this.displayedColumns = ['icon', 'symbol', 'name', 'dateOfFirstActivity'];
if (this.hasPermissionToShowValues) { if (this.hasPermissionToShowValues) {
this.displayedColumns.push('value'); this.displayedColumns.push('value');

View File

@ -269,6 +269,12 @@ export class DataService {
response.holdings[symbol].assetSubClass = translate( response.holdings[symbol].assetSubClass = translate(
response.holdings[symbol].assetSubClass response.holdings[symbol].assetSubClass
); );
response.holdings[symbol].dateOfFirstActivity = response.holdings[
symbol
].dateOfFirstActivity
? parseISO(response.holdings[symbol].dateOfFirstActivity)
: undefined;
} }
} }

View File

@ -12,6 +12,7 @@ export interface PortfolioPosition {
countries: Country[]; countries: Country[];
currency: string; currency: string;
dataSource: DataSource; dataSource: DataSource;
dateOfFirstActivity: Date;
exchange?: string; exchange?: string;
grossPerformance: number; grossPerformance: number;
grossPerformancePercent: number; grossPerformancePercent: number;

View File

@ -9,6 +9,7 @@ export interface PortfolioPublicDetails {
| 'allocationCurrent' | 'allocationCurrent'
| 'countries' | 'countries'
| 'currency' | 'currency'
| 'dateOfFirstActivity'
| 'markets' | 'markets'
| 'name' | 'name'
| 'netPerformancePercent' | 'netPerformancePercent'