diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a82ded75..186910232 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 allocation column to the accounts table component of the holding detail dialog + ### Changed - Restructured the response of the portfolio report endpoint (_X-ray_) diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index c5b9c2148..83653dd9f 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -191,6 +191,7 @@ export class PortfolioService { ...account, transactionCount, valueInBaseCurrency, + allocationInPercentage: null, // TODO balanceInBaseCurrency: this.exchangeRateDataService.toCurrency( account.balance, account.currency, diff --git a/apps/client/src/app/components/accounts-table/accounts-table.component.html b/apps/client/src/app/components/accounts-table/accounts-table.component.html index 7e2ac92db..609c76ee1 100644 --- a/apps/client/src/app/components/accounts-table/accounts-table.component.html +++ b/apps/client/src/app/components/accounts-table/accounts-table.component.html @@ -231,6 +231,35 @@ + + + Allocation + + + + + + + - + diff --git a/apps/client/src/app/components/accounts-table/accounts-table.component.ts b/apps/client/src/app/components/accounts-table/accounts-table.component.ts index 3d38d6775..a7ce6e488 100644 --- a/apps/client/src/app/components/accounts-table/accounts-table.component.ts +++ b/apps/client/src/app/components/accounts-table/accounts-table.component.ts @@ -60,6 +60,7 @@ export class GfAccountsTableComponent implements OnChanges, OnDestroy { @Input() hasPermissionToOpenDetails = true; @Input() locale = getLocale(); @Input() showActions: boolean; + @Input() showAllocationInPercentage: boolean; @Input() showBalance = true; @Input() showFooter = true; @Input() showTransactions = true; @@ -117,6 +118,10 @@ export class GfAccountsTableComponent implements OnChanges, OnDestroy { this.displayedColumns.push('valueInBaseCurrency'); } + if (this.showAllocationInPercentage) { + this.displayedColumns.push('allocation'); + } + this.displayedColumns.push('comment'); if (this.showActions) { diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html index 4427cfcbb..e0673a1f5 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html @@ -375,6 +375,7 @@ [deviceType]="data.deviceType" [hasPermissionToOpenDetails]="false" [locale]="user?.settings?.locale" + [showAllocationInPercentage]="user?.settings?.isExperimentalFeatures" [showBalance]="false" [showFooter]="false" [showTransactions]="false" diff --git a/libs/common/src/lib/types/account-with-value.type.ts b/libs/common/src/lib/types/account-with-value.type.ts index 40aefa998..d86a7ca1f 100644 --- a/libs/common/src/lib/types/account-with-value.type.ts +++ b/libs/common/src/lib/types/account-with-value.type.ts @@ -1,6 +1,7 @@ import { Account as AccountModel, Platform } from '@prisma/client'; export type AccountWithValue = AccountModel & { + allocationInPercentage: number; balanceInBaseCurrency: number; platform?: Platform; transactionCount: number;