From f44f5420192aca5a84c6fcf6f0566d6da92976fd Mon Sep 17 00:00:00 2001 From: Shaik Aftab Date: Sat, 4 Jul 2026 14:49:26 +0530 Subject: [PATCH 1/3] Task/improve integer query parameter parsing in various controllers (#7189) * Improve integer query parameter parsing of skip and take * Update changelog --- CHANGELOG.md | 2 ++ apps/api/src/app/admin/admin.controller.ts | 9 +++++---- .../asset-profiles/asset-profiles.controller.ts | 9 +++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ec0188553..fdc3c99fc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Restricted the modification of activity tags in the impersonation mode - Hardened the endpoint of the public access for portfolio sharing by restricting it to public accesses +- Improved the parsing of integer query parameters (`skip` and `take`) in the `GET api/v1/admin/user` endpoint +- Improved the parsing of integer query parameters (`skip` and `take`) in the `GET api/v1/asset-profiles` endpoint - Improved the language localization by translating various tooltips across the application - Improved the language localization for Ukrainian (`uk`) - Upgraded `yahoo-finance2` from version `3.14.3` to `3.15.4` diff --git a/apps/api/src/app/admin/admin.controller.ts b/apps/api/src/app/admin/admin.controller.ts index a6f6e8b6f3..019468dfdf 100644 --- a/apps/api/src/app/admin/admin.controller.ts +++ b/apps/api/src/app/admin/admin.controller.ts @@ -40,6 +40,7 @@ import { Inject, Logger, Param, + ParseIntPipe, Patch, Post, Put, @@ -319,12 +320,12 @@ export class AdminController { @HasPermission(permissions.accessAdminControl) @UseGuards(AuthGuard('jwt'), HasPermissionGuard) public async getUsers( - @Query('skip') skip?: number, - @Query('take') take?: number + @Query('skip', new ParseIntPipe({ optional: true })) skip?: number, + @Query('take', new ParseIntPipe({ optional: true })) take?: number ): Promise { return this.adminService.getUsers({ - skip: isNaN(skip) ? undefined : skip, - take: isNaN(take) ? undefined : take + skip, + take }); } diff --git a/apps/api/src/app/endpoints/asset-profiles/asset-profiles.controller.ts b/apps/api/src/app/endpoints/asset-profiles/asset-profiles.controller.ts index fcddb0bc3a..d74f167a63 100644 --- a/apps/api/src/app/endpoints/asset-profiles/asset-profiles.controller.ts +++ b/apps/api/src/app/endpoints/asset-profiles/asset-profiles.controller.ts @@ -22,6 +22,7 @@ import { HttpException, Inject, Param, + ParseIntPipe, Patch, Query, UseGuards, @@ -51,10 +52,10 @@ export class AssetProfilesController { @Query('dataSource') filterByDataSource?: string, @Query('presetId') presetId?: MarketDataPreset, @Query('query') filterBySearchQuery?: string, - @Query('skip') skip?: number, + @Query('skip', new ParseIntPipe({ optional: true })) skip?: number, @Query('sortColumn') sortColumn?: string, @Query('sortDirection') sortDirection?: Prisma.SortOrder, - @Query('take') take?: number + @Query('take', new ParseIntPipe({ optional: true })) take?: number ): Promise { const filters = this.apiService.buildFiltersFromQueryParams({ filterByAssetSubClasses, @@ -65,10 +66,10 @@ export class AssetProfilesController { return this.assetProfilesService.getAssetProfiles({ filters, presetId, + skip, sortColumn, sortDirection, - skip: isNaN(skip) ? undefined : skip, - take: isNaN(take) ? undefined : take + take }); } From 818411b10d7ac5dcbd3e3c3af95e11bd3b2c5589 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 4 Jul 2026 11:22:45 +0200 Subject: [PATCH 2/3] Task/clean up get holding call in import service (#7207) Clean up --- apps/api/src/app/import/import.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index ba704d5add..c7dab98236 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -69,8 +69,7 @@ export class ImportService { const holding = await this.portfolioService.getHolding({ dataSource, symbol, - userId, - impersonationId: undefined + userId }); if (!holding) { From ca6716e7bafd056edadadb03294895b6884563fe Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 4 Jul 2026 11:36:33 +0200 Subject: [PATCH 3/3] Task/refactor rounding logic in treemap chart component (#7200) * Refactor rounding logic * Update changelog --- CHANGELOG.md | 1 + .../treemap-chart/treemap-chart.component.ts | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdc3c99fc5..f8f19142d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Refactored the rounding logic in the treemap chart component - Restricted the modification of activity tags in the impersonation mode - Hardened the endpoint of the public access for portfolio sharing by restricting it to public accesses - Improved the parsing of integer query parameters (`skip` and `take`) in the `GET api/v1/admin/user` endpoint diff --git a/libs/ui/src/lib/treemap-chart/treemap-chart.component.ts b/libs/ui/src/lib/treemap-chart/treemap-chart.component.ts index 36ea0023ac..2a04ba6ba7 100644 --- a/libs/ui/src/lib/treemap-chart/treemap-chart.component.ts +++ b/libs/ui/src/lib/treemap-chart/treemap-chart.component.ts @@ -30,7 +30,7 @@ import { Chart, Tooltip } from 'chart.js'; import { TreemapController, TreemapElement } from 'chartjs-chart-treemap'; import { isUUID } from 'class-validator'; import { differenceInDays, max } from 'date-fns'; -import { orderBy } from 'lodash'; +import { orderBy, round } from 'lodash'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import OpenColor from 'open-color'; @@ -221,9 +221,10 @@ export class GfTreemapChartComponent ) }).toNumber(); - // Round to 2 decimal places - annualizedNetPerformancePercent = - Math.round(annualizedNetPerformancePercent * 100) / 100; + annualizedNetPerformancePercent = round( + annualizedNetPerformancePercent, + 2 + ); const { backgroundColor } = this.getColor({ annualizedNetPerformancePercent, @@ -252,9 +253,10 @@ export class GfTreemapChartComponent ) }).toNumber(); - // Round to 2 decimal places - annualizedNetPerformancePercent = - Math.round(annualizedNetPerformancePercent * 100) / 100; + annualizedNetPerformancePercent = round( + annualizedNetPerformancePercent, + 2 + ); const { fontColor } = this.getColor({ annualizedNetPerformancePercent, @@ -267,11 +269,10 @@ export class GfTreemapChartComponent display: true, font: [{ size: 16 }, { lineHeight: 1.5, size: 14 }], formatter: ({ raw }: GfTreemapScriptableContext) => { - // Round to 4 decimal places - let netPerformancePercentWithCurrencyEffect = - Math.round( - raw._data.netPerformancePercentWithCurrencyEffect * 10000 - ) / 10000; + let netPerformancePercentWithCurrencyEffect = round( + raw._data.netPerformancePercentWithCurrencyEffect, + 4 + ); if (Math.abs(netPerformancePercentWithCurrencyEffect) === 0) { netPerformancePercentWithCurrencyEffect = Math.abs(