Germán Martín
2 weeks 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
|
|
|
@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
- Extended the content of the pricing page |
|
|
|
- Added a _Storybook_ story for the holdings table component |
|
|
|
|
|
|
|
### Added |
|
|
|
|
|
|
|
- Add Average Buy Price in holdings table |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
- Disabled the zoom functionality in the _Progressive Web App_ (PWA) |
|
|
|
|
|
|
|
@ -168,6 +168,7 @@ export class PublicController { |
|
|
|
allocationInPercentage: |
|
|
|
portfolioPosition.valueInBaseCurrency / totalValue, |
|
|
|
assetClass: hasDetails ? portfolioPosition.assetClass : undefined, |
|
|
|
averagePrice: hasDetails ? portfolioPosition.averagePrice : undefined, |
|
|
|
countries: hasDetails ? portfolioPosition.countries : [], |
|
|
|
currency: hasDetails ? portfolioPosition.currency : undefined, |
|
|
|
dataSource: portfolioPosition.dataSource, |
|
|
|
|
|
|
|
@ -569,6 +569,7 @@ export class PortfolioService { |
|
|
|
} |
|
|
|
|
|
|
|
for (const { |
|
|
|
averagePrice, |
|
|
|
currency, |
|
|
|
dividend, |
|
|
|
firstBuyDate, |
|
|
|
@ -624,6 +625,7 @@ export class PortfolioService { |
|
|
|
: valueInBaseCurrency.div(filteredValueInBaseCurrency).toNumber(), |
|
|
|
assetClass: assetProfile.assetClass, |
|
|
|
assetSubClass: assetProfile.assetSubClass, |
|
|
|
averagePrice: averagePrice?.toNumber(), |
|
|
|
countries: assetProfile.countries, |
|
|
|
dataSource: assetProfile.dataSource, |
|
|
|
dateOfFirstActivity: parseDate(firstBuyDate), |
|
|
|
|
|
|
|
@ -12,6 +12,7 @@ export interface PortfolioPosition { |
|
|
|
assetClassLabel?: string; |
|
|
|
assetSubClass?: AssetSubClass; |
|
|
|
assetSubClassLabel?: string; |
|
|
|
averagePrice?: number; |
|
|
|
countries: Country[]; |
|
|
|
currency: string; |
|
|
|
dataSource: DataSource; |
|
|
|
|
|
|
|
@ -15,6 +15,7 @@ export interface PublicPortfolioResponse extends PublicPortfolioResponseV1 { |
|
|
|
PortfolioPosition, |
|
|
|
| 'allocationInPercentage' |
|
|
|
| 'assetClass' |
|
|
|
| 'averagePrice' |
|
|
|
| 'countries' |
|
|
|
| 'currency' |
|
|
|
| 'dataSource' |
|
|
|
|
|
|
|
@ -88,6 +88,33 @@ |
|
|
|
</td> |
|
|
|
</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"> |
|
|
|
<th |
|
|
|
*matHeaderCellDef |
|
|
|
|
|
|
|
@ -76,6 +76,8 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy { |
|
|
|
this.displayedColumns.push('quantity'); |
|
|
|
} |
|
|
|
|
|
|
|
this.displayedColumns.push('averagePrice'); |
|
|
|
|
|
|
|
if (this.hasPermissionToShowValues) { |
|
|
|
this.displayedColumns.push('valueInBaseCurrency'); |
|
|
|
} |
|
|
|
|