diff --git a/CHANGELOG.md b/CHANGELOG.md index 041f12c2..1d2ccc5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,10 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Renamed `Order` to `activities` in the `User` database schema - Improved the language localization for Catalan (`ca`) - Improved the language localization for Italian (`it`) - Upgraded `nestjs` from version `10.4.15` to `11.0.12` +### Fixed + +- Fixed an issue in the watchlist endpoint (`POST`) related to the `HasPermissionGuard` + ## 2.161.0 - 2025-05-06 ### Added diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index e4c50c1f..35b4ea73 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -821,7 +821,7 @@ export class AdminService { where, select: { _count: { - select: { Account: true, Order: true } + select: { Account: true, activities: true } }, Analytics: { select: { @@ -869,10 +869,10 @@ export class AdminService { role, subscription, accountCount: _count.Account || 0, + activityCount: _count.activities || 0, country: Analytics?.country, dailyApiRequests: Analytics?.dataProviderGhostfolioDailyRequests || 0, - lastActivity: Analytics?.updatedAt, - transactionCount: _count.Order || 0 + lastActivity: Analytics?.updatedAt }; } ); diff --git a/apps/api/src/app/endpoints/watchlist/watchlist.controller.ts b/apps/api/src/app/endpoints/watchlist/watchlist.controller.ts index 8d9d322a..2a8ea987 100644 --- a/apps/api/src/app/endpoints/watchlist/watchlist.controller.ts +++ b/apps/api/src/app/endpoints/watchlist/watchlist.controller.ts @@ -39,7 +39,7 @@ export class WatchlistController { @Post() @HasPermission(permissions.createWatchlistItem) - @UseGuards(AuthGuard('jwt')) + @UseGuards(AuthGuard('jwt'), HasPermissionGuard) @UseInterceptors(TransformDataSourceInRequestInterceptor) public async createWatchlistItem(@Body() data: CreateWatchlistItemDto) { return this.watchlistService.createWatchlistItem({ diff --git a/apps/api/src/models/interfaces/portfolio.interface.ts b/apps/api/src/models/interfaces/portfolio.interface.ts deleted file mode 100644 index b369202c..00000000 --- a/apps/api/src/models/interfaces/portfolio.interface.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { PortfolioItem, Position } from '@ghostfolio/common/interfaces'; - -import { Order } from '../order'; - -export interface PortfolioInterface { - get(aDate?: Date): PortfolioItem[]; - - getFees(): number; - - getPositions(aDate: Date): { - [symbol: string]: Position; - }; - - getSymbols(aDate?: Date): string[]; - - getTotalBuy(): number; - - getTotalSell(): number; - - getOrders(): Order[]; - - getValue(aDate?: Date): number; -} diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html index ab3468dc..f10b6dc0 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html @@ -257,20 +257,20 @@
Sectors
Countries
} diff --git a/apps/client/src/app/components/admin-users/admin-users.html b/apps/client/src/app/components/admin-users/admin-users.html index 56b2e0ea..1a4125d8 100644 --- a/apps/client/src/app/components/admin-users/admin-users.html +++ b/apps/client/src/app/components/admin-users/admin-users.html @@ -142,7 +142,7 @@ 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 d18dc479..11898c44 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 @@ -259,11 +259,11 @@
@@ -271,11 +271,11 @@
} diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html index f2dff76f..1436f6ab 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html @@ -48,10 +48,10 @@ @@ -70,10 +70,10 @@ @@ -92,10 +92,10 @@ @@ -113,10 +113,10 @@ cursor="pointer" [baseCurrency]="user?.settings?.baseCurrency" [colorScheme]="user?.settings?.colorScheme" + [data]="symbols" [isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [keys]="['symbol']" [locale]="user?.settings?.locale" - [positions]="symbols" [showLabels]="deviceType !== 'mobile'" (proportionChartClicked)="onSymbolChartClicked($event)" /> @@ -137,11 +137,11 @@ @@ -160,10 +160,10 @@ @@ -182,9 +182,9 @@ @@ -271,11 +271,11 @@ @@ -290,10 +290,10 @@ cursor="pointer" [baseCurrency]="user?.settings?.baseCurrency" [colorScheme]="user?.settings?.colorScheme" + [data]="accounts" [isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [keys]="['id']" [locale]="user?.settings?.locale" - [positions]="accounts" (proportionChartClicked)="onAccountChartClicked($event)" /> @@ -313,10 +313,10 @@ diff --git a/apps/client/src/app/pages/public/public-page.html b/apps/client/src/app/pages/public/public-page.html index e51aee9a..b5a225c7 100644 --- a/apps/client/src/app/pages/public/public-page.html +++ b/apps/client/src/app/pages/public/public-page.html @@ -72,9 +72,9 @@ @@ -90,10 +90,10 @@ @@ -107,10 +107,10 @@ @@ -126,9 +126,9 @@ @@ -198,10 +198,10 @@
diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf index fd7387a0..3f35305f 100644 --- a/apps/client/src/locales/messages.ca.xlf +++ b/apps/client/src/locales/messages.ca.xlf @@ -6383,7 +6383,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -6691,11 +6691,11 @@ No data available libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index 6f8323fe..e45939fd 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -3106,7 +3106,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -3114,11 +3114,11 @@ Keine Daten verfügbar libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index 02ad6ce5..b2847bd2 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -3091,7 +3091,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -3099,11 +3099,11 @@ Sin datos disponibles libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf index 2fbd5399..98f345db 100644 --- a/apps/client/src/locales/messages.fr.xlf +++ b/apps/client/src/locales/messages.fr.xlf @@ -3162,7 +3162,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -3338,11 +3338,11 @@ Pas de données disponibles libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf index 3b6b222c..b0cd54ea 100644 --- a/apps/client/src/locales/messages.it.xlf +++ b/apps/client/src/locales/messages.it.xlf @@ -3091,7 +3091,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -3099,11 +3099,11 @@ Nessun dato disponibile libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf index fc79a6da..267add80 100644 --- a/apps/client/src/locales/messages.nl.xlf +++ b/apps/client/src/locales/messages.nl.xlf @@ -3090,7 +3090,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -3098,11 +3098,11 @@ Geen gegevens beschikbaar libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.pl.xlf b/apps/client/src/locales/messages.pl.xlf index 50dada8a..57e678fe 100644 --- a/apps/client/src/locales/messages.pl.xlf +++ b/apps/client/src/locales/messages.pl.xlf @@ -5791,7 +5791,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -6091,11 +6091,11 @@ Brak danych libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf index c327b101..9f8b82e0 100644 --- a/apps/client/src/locales/messages.pt.xlf +++ b/apps/client/src/locales/messages.pt.xlf @@ -3002,7 +3002,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -3178,11 +3178,11 @@ Sem dados disponíveis libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf index cf182ffc..1b77f674 100644 --- a/apps/client/src/locales/messages.tr.xlf +++ b/apps/client/src/locales/messages.tr.xlf @@ -5479,7 +5479,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -5727,11 +5727,11 @@ Veri mevcut değil libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.uk.xlf b/apps/client/src/locales/messages.uk.xlf index adba86b1..72ffe96f 100644 --- a/apps/client/src/locales/messages.uk.xlf +++ b/apps/client/src/locales/messages.uk.xlf @@ -7045,7 +7045,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -7533,11 +7533,11 @@ Дані недоступні libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf index c55d4dc9..4ea9995b 100644 --- a/apps/client/src/locales/messages.xlf +++ b/apps/client/src/locales/messages.xlf @@ -5360,7 +5360,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -5623,11 +5623,11 @@ No data available libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf index 6b33fa12..fbf873ce 100644 --- a/apps/client/src/locales/messages.zh.xlf +++ b/apps/client/src/locales/messages.zh.xlf @@ -5848,7 +5848,7 @@ libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 402 + 400 @@ -6148,11 +6148,11 @@ 无可用数据 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 404 + 402 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 417 + 415 diff --git a/libs/common/src/lib/interfaces/admin-users.interface.ts b/libs/common/src/lib/interfaces/admin-users.interface.ts index 89e16575..79031425 100644 --- a/libs/common/src/lib/interfaces/admin-users.interface.ts +++ b/libs/common/src/lib/interfaces/admin-users.interface.ts @@ -4,6 +4,7 @@ export interface AdminUsers { count: number; users: { accountCount: number; + activityCount: number; country: string; createdAt: Date; dailyApiRequests: number; @@ -11,6 +12,5 @@ export interface AdminUsers { id: string; lastActivity: Date; role: Role; - transactionCount: number; }[]; } diff --git a/libs/common/src/lib/interfaces/index.ts b/libs/common/src/lib/interfaces/index.ts index bdf982f5..e401705f 100644 --- a/libs/common/src/lib/interfaces/index.ts +++ b/libs/common/src/lib/interfaces/index.ts @@ -29,8 +29,6 @@ import type { PortfolioChart } from './portfolio-chart.interface'; import type { PortfolioDetails } from './portfolio-details.interface'; import type { PortfolioDividends } from './portfolio-dividends.interface'; import type { PortfolioInvestments } from './portfolio-investments.interface'; -import type { PortfolioItem } from './portfolio-item.interface'; -import type { PortfolioOverview } from './portfolio-overview.interface'; import type { PortfolioPerformance } from './portfolio-performance.interface'; import type { PortfolioPosition } from './portfolio-position.interface'; import type { PortfolioReportRule } from './portfolio-report-rule.interface'; @@ -116,8 +114,6 @@ export { PortfolioHoldingResponse, PortfolioHoldingsResponse, PortfolioInvestments, - PortfolioItem, - PortfolioOverview, PortfolioPerformance, PortfolioPerformanceResponse, PortfolioPosition, diff --git a/libs/common/src/lib/interfaces/portfolio-item.interface.ts b/libs/common/src/lib/interfaces/portfolio-item.interface.ts deleted file mode 100644 index a3e42a05..00000000 --- a/libs/common/src/lib/interfaces/portfolio-item.interface.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Position } from '@ghostfolio/common/interfaces'; - -export interface PortfolioItem { - date: string; - grossPerformancePercent: number; - investment: number; - positions: { [symbol: string]: Position }; - value: number; -} diff --git a/libs/common/src/lib/interfaces/portfolio-overview.interface.ts b/libs/common/src/lib/interfaces/portfolio-overview.interface.ts deleted file mode 100644 index c9c20c28..00000000 --- a/libs/common/src/lib/interfaces/portfolio-overview.interface.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface PortfolioOverview { - cash: number; - committedFunds: number; - fees: number; - ordersCount: number; - totalBuy: number; - totalSell: number; -} diff --git a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.stories.ts b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.stories.ts index 90aa0cee..37010954 100644 --- a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.stories.ts +++ b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.stories.ts @@ -25,15 +25,15 @@ type Story = StoryObj; export const Simple: Story = { args: { baseCurrency: 'USD', - keys: ['name'], - locale: 'en-US', - positions: { + data: { Africa: { name: 'Africa', value: 983.22461479889288 }, Asia: { name: 'Asia', value: 12074.754633964973 }, Europe: { name: 'Europe', value: 34432.837085290535 }, 'North America': { name: 'North America', value: 26539.89987780503 }, Oceania: { name: 'Oceania', value: 1402.220605072031 }, 'South America': { name: 'South America', value: 4938.25202180719859 } - } + }, + keys: ['name'], + locale: 'en-US' } }; diff --git a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts index cc3c40d3..bc15ede0 100644 --- a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts +++ b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts @@ -60,18 +60,18 @@ export class GfPortfolioProportionChartComponent @Input() baseCurrency: string; @Input() colorScheme: ColorScheme; @Input() cursor: string; - @Input() isInPercent = false; - @Input() keys: string[] = []; - @Input() locale = getLocale(); - @Input() maxItems?: number; - @Input() showLabels = false; - @Input() positions: { + @Input() data: { [symbol: string]: Pick & { dataSource?: DataSource; name: string; value: number; }; } = {}; + @Input() isInPercent = false; + @Input() keys: string[] = []; + @Input() locale = getLocale(); + @Input() maxItems?: number; + @Input() showLabels = false; @Output() proportionChartClicked = new EventEmitter(); @@ -91,13 +91,13 @@ export class GfPortfolioProportionChartComponent } public ngAfterViewInit() { - if (this.positions) { + if (this.data) { this.initialize(); } } public ngOnChanges() { - if (this.positions) { + if (this.data) { this.initialize(); } } @@ -122,47 +122,45 @@ export class GfPortfolioProportionChartComponent }; if (this.keys.length > 0) { - Object.keys(this.positions).forEach((symbol) => { - if (this.positions[symbol][this.keys[0]]?.toUpperCase()) { - if (chartData[this.positions[symbol][this.keys[0]].toUpperCase()]) { - chartData[ - this.positions[symbol][this.keys[0]].toUpperCase() - ].value = chartData[ - this.positions[symbol][this.keys[0]].toUpperCase() - ].value.plus(this.positions[symbol].value || 0); + Object.keys(this.data).forEach((symbol) => { + if (this.data[symbol][this.keys[0]]?.toUpperCase()) { + if (chartData[this.data[symbol][this.keys[0]].toUpperCase()]) { + chartData[this.data[symbol][this.keys[0]].toUpperCase()].value = + chartData[ + this.data[symbol][this.keys[0]].toUpperCase() + ].value.plus(this.data[symbol].value || 0); if ( - chartData[this.positions[symbol][this.keys[0]].toUpperCase()] - .subCategory[this.positions[symbol][this.keys[1]]] + chartData[this.data[symbol][this.keys[0]].toUpperCase()] + .subCategory[this.data[symbol][this.keys[1]]] ) { chartData[ - this.positions[symbol][this.keys[0]].toUpperCase() - ].subCategory[this.positions[symbol][this.keys[1]]].value = - chartData[ - this.positions[symbol][this.keys[0]].toUpperCase() - ].subCategory[this.positions[symbol][this.keys[1]]].value.plus( - this.positions[symbol].value || 0 - ); + this.data[symbol][this.keys[0]].toUpperCase() + ].subCategory[this.data[symbol][this.keys[1]]].value = chartData[ + this.data[symbol][this.keys[0]].toUpperCase() + ].subCategory[this.data[symbol][this.keys[1]]].value.plus( + this.data[symbol].value || 0 + ); } else { chartData[ - this.positions[symbol][this.keys[0]].toUpperCase() - ].subCategory[ - this.positions[symbol][this.keys[1]] ?? UNKNOWN_KEY - ] = { value: new Big(this.positions[symbol].value || 0) }; + this.data[symbol][this.keys[0]].toUpperCase() + ].subCategory[this.data[symbol][this.keys[1]] ?? UNKNOWN_KEY] = { + value: new Big(this.data[symbol].value || 0) + }; } } else { - chartData[this.positions[symbol][this.keys[0]].toUpperCase()] = { - name: this.positions[symbol][this.keys[0]], + chartData[this.data[symbol][this.keys[0]].toUpperCase()] = { + name: this.data[symbol][this.keys[0]], subCategory: {}, - value: new Big(this.positions[symbol].value || 0) + value: new Big(this.data[symbol].value || 0) }; - if (this.positions[symbol][this.keys[1]]) { + if (this.data[symbol][this.keys[1]]) { chartData[ - this.positions[symbol][this.keys[0]].toUpperCase() + this.data[symbol][this.keys[0]].toUpperCase() ].subCategory = { - [this.positions[symbol][this.keys[1]]]: { - value: new Big(this.positions[symbol].value || 0) + [this.data[symbol][this.keys[1]]]: { + value: new Big(this.data[symbol].value || 0) } }; } @@ -170,24 +168,24 @@ export class GfPortfolioProportionChartComponent } else { if (chartData[UNKNOWN_KEY]) { chartData[UNKNOWN_KEY].value = chartData[UNKNOWN_KEY].value.plus( - this.positions[symbol].value || 0 + this.data[symbol].value || 0 ); } else { chartData[UNKNOWN_KEY] = { - name: this.positions[symbol].name, + name: this.data[symbol].name, subCategory: this.keys[1] ? { [this.keys[1]]: { value: new Big(0) } } : undefined, - value: new Big(this.positions[symbol].value || 0) + value: new Big(this.data[symbol].value || 0) }; } } }); } else { - Object.keys(this.positions).forEach((symbol) => { + Object.keys(this.data).forEach((symbol) => { chartData[symbol] = { - name: this.positions[symbol].name, - value: new Big(this.positions[symbol].value || 0) + name: this.data[symbol].name, + value: new Big(this.data[symbol].value || 0) }; }); } @@ -321,7 +319,7 @@ export class GfPortfolioProportionChartComponent const dataIndex = activeElements[0].index; const symbol: string = event.chart.data.labels[dataIndex]; - const dataSource = this.positions[symbol]?.dataSource; + const dataSource = this.data[symbol]?.dataSource; this.proportionChartClicked.emit({ dataSource, symbol }); } catch {} @@ -404,7 +402,7 @@ export class GfPortfolioProportionChartComponent symbol = $localize`No data available`; } - const name = translate(this.positions[symbol as string]?.name); + const name = translate(this.data[symbol as string]?.name); let sum = 0; for (const item of context.dataset.data) { diff --git a/libs/ui/src/lib/top-holdings/top-holdings.component.ts b/libs/ui/src/lib/top-holdings/top-holdings.component.ts index 13ceb239..41d0f119 100644 --- a/libs/ui/src/lib/top-holdings/top-holdings.component.ts +++ b/libs/ui/src/lib/top-holdings/top-holdings.component.ts @@ -2,8 +2,7 @@ import { GfSymbolModule } from '@ghostfolio/client/pipes/symbol/symbol.module'; import { getLocale } from '@ghostfolio/common/helper'; import { AssetProfileIdentifier, - HoldingWithParents, - PortfolioPosition + HoldingWithParents } from '@ghostfolio/common/interfaces'; import { GfValueComponent } from '@ghostfolio/ui/value'; @@ -29,7 +28,6 @@ import { import { MatButtonModule } from '@angular/material/button'; import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator'; import { MatTableDataSource, MatTableModule } from '@angular/material/table'; -import { DataSource } from '@prisma/client'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { Subject } from 'rxjs'; @@ -64,13 +62,6 @@ export class GfTopHoldingsComponent implements OnChanges, OnDestroy { @Input() locale = getLocale(); @Input() pageSize = Number.MAX_SAFE_INTEGER; @Input() topHoldings: HoldingWithParents[]; - @Input() positions: { - [symbol: string]: Pick & { - dataSource?: DataSource; - name: string; - value: number; - }; - } = {}; @Output() holdingClicked = new EventEmitter(); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 7bf69c56..6182ebfe 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -245,6 +245,7 @@ model Tag { model User { accessToken String? + activities Order[] authChallenge String? createdAt DateTime @default(now()) id String @id @default(uuid()) @@ -260,7 +261,6 @@ model User { Analytics Analytics? ApiKey ApiKey[] AuthDevice AuthDevice[] - Order Order[] Settings Settings? SymbolProfile SymbolProfile[] Tag Tag[]