Germán Martín
					
					3 days ago
					
						
							committed by
							
								
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B5690EEEBB952194
						
					
				
			
		
		
		
	
		
			
				 7 changed files with 
38 additions and 
0 deletions
			 
			
		 
		
			
				- 
					
					
					 
					CHANGELOG.md
				
 
			
				- 
					
					
					 
					apps/api/src/app/endpoints/public/public.controller.ts
				
 
			
				- 
					
					
					 
					apps/api/src/app/portfolio/portfolio.service.ts
				
 
			
				- 
					
					
					 
					libs/common/src/lib/interfaces/portfolio-position.interface.ts
				
 
			
				- 
					
					
					 
					libs/common/src/lib/interfaces/responses/public-portfolio-response.interface.ts
				
 
			
				- 
					
					
					 
					libs/ui/src/lib/holdings-table/holdings-table.component.html
				
 
			
				- 
					
					
					 
					libs/ui/src/lib/holdings-table/holdings-table.component.ts
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					## Unreleased | 
					 | 
					 | 
					## Unreleased | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					### Added | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					- Add Average Buy Price in holdings table | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					### Changed | 
					 | 
					 | 
					### Changed | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					- Improved the icon of the _View Holding_ menu item in the activities table | 
					 | 
					 | 
					- Improved the icon of the _View Holding_ menu item in the activities table | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -168,6 +168,7 @@ export class PublicController { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        allocationInPercentage: | 
					 | 
					 | 
					        allocationInPercentage: | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          portfolioPosition.valueInBaseCurrency / totalValue, | 
					 | 
					 | 
					          portfolioPosition.valueInBaseCurrency / totalValue, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        assetClass: hasDetails ? portfolioPosition.assetClass : undefined, | 
					 | 
					 | 
					        assetClass: hasDetails ? portfolioPosition.assetClass : undefined, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        averagePrice: hasDetails ? portfolioPosition.averagePrice : undefined, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        countries: hasDetails ? portfolioPosition.countries : [], | 
					 | 
					 | 
					        countries: hasDetails ? portfolioPosition.countries : [], | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        currency: hasDetails ? portfolioPosition.currency : undefined, | 
					 | 
					 | 
					        currency: hasDetails ? portfolioPosition.currency : undefined, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        dataSource: portfolioPosition.dataSource, | 
					 | 
					 | 
					        dataSource: portfolioPosition.dataSource, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -569,6 +569,7 @@ export class PortfolioService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    for (const { | 
					 | 
					 | 
					    for (const { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      averagePrice, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      currency, | 
					 | 
					 | 
					      currency, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      dividend, | 
					 | 
					 | 
					      dividend, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      firstBuyDate, | 
					 | 
					 | 
					      firstBuyDate, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -624,6 +625,7 @@ export class PortfolioService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          : valueInBaseCurrency.div(filteredValueInBaseCurrency).toNumber(), | 
					 | 
					 | 
					          : valueInBaseCurrency.div(filteredValueInBaseCurrency).toNumber(), | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        assetClass: assetProfile.assetClass, | 
					 | 
					 | 
					        assetClass: assetProfile.assetClass, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        assetSubClass: assetProfile.assetSubClass, | 
					 | 
					 | 
					        assetSubClass: assetProfile.assetSubClass, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        averagePrice: averagePrice?.toNumber(), | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        countries: assetProfile.countries, | 
					 | 
					 | 
					        countries: assetProfile.countries, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        dataSource: assetProfile.dataSource, | 
					 | 
					 | 
					        dataSource: assetProfile.dataSource, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        dateOfFirstActivity: parseDate(firstBuyDate), | 
					 | 
					 | 
					        dateOfFirstActivity: parseDate(firstBuyDate), | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -12,6 +12,7 @@ export interface PortfolioPosition { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  assetClassLabel?: string; | 
					 | 
					 | 
					  assetClassLabel?: string; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  assetSubClass?: AssetSubClass; | 
					 | 
					 | 
					  assetSubClass?: AssetSubClass; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  assetSubClassLabel?: string; | 
					 | 
					 | 
					  assetSubClassLabel?: string; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  averagePrice?: number; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  countries: Country[]; | 
					 | 
					 | 
					  countries: Country[]; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  currency: string; | 
					 | 
					 | 
					  currency: string; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  dataSource: DataSource; | 
					 | 
					 | 
					  dataSource: DataSource; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -15,6 +15,7 @@ export interface PublicPortfolioResponse extends PublicPortfolioResponseV1 { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      PortfolioPosition, | 
					 | 
					 | 
					      PortfolioPosition, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      | 'allocationInPercentage' | 
					 | 
					 | 
					      | 'allocationInPercentage' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      | 'assetClass' | 
					 | 
					 | 
					      | 'assetClass' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      | 'averagePrice' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      | 'countries' | 
					 | 
					 | 
					      | 'countries' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      | 'currency' | 
					 | 
					 | 
					      | 'currency' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      | 'dataSource' | 
					 | 
					 | 
					      | 'dataSource' | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -88,6 +88,33 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      </td> | 
					 | 
					 | 
					      </td> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    </ng-container> | 
					 | 
					 | 
					    </ng-container> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    <ng-container matColumnDef="averagePrice"> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      <th | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        *matHeaderCellDef | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        class="d-none d-lg-table-cell justify-content-end px-1" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        mat-header-cell | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        mat-sort-header | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      > | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        <ng-container i18n>Avg. Buy Price</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 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            [isCurrency]=" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					              element.averagePrice !== null && | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					              element.averagePrice !== undefined | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            " | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            [locale]="locale" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            [value]="isLoading ? undefined : (element.averagePrice ?? '')" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          /> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        </div> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      </td> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    </ng-container> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    <ng-container matColumnDef="valueInBaseCurrency"> | 
					 | 
					 | 
					    <ng-container matColumnDef="valueInBaseCurrency"> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      <th | 
					 | 
					 | 
					      <th | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        *matHeaderCellDef | 
					 | 
					 | 
					        *matHeaderCellDef | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -76,6 +76,8 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      this.displayedColumns.push('quantity'); | 
					 | 
					 | 
					      this.displayedColumns.push('quantity'); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    this.displayedColumns.push('averagePrice'); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (this.hasPermissionToShowValues) { | 
					 | 
					 | 
					    if (this.hasPermissionToShowValues) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      this.displayedColumns.push('valueInBaseCurrency'); | 
					 | 
					 | 
					      this.displayedColumns.push('valueInBaseCurrency'); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |