From 795d74a7aa9ef3bbda7826e348a8fad0c747f216 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 25 Aug 2026 16:50:24 +0200 Subject: [PATCH] Improve validation of activities and asset profiles when combining custom asset profile symbol with data source other than MANUAL --- apps/api/src/app/import/import.service.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 45fd0f714..909983e23 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -221,13 +221,6 @@ export class ImportService { throw new Error( `assetProfiles.${index}.symbol ("${symbol}") must be a UUID or start with the prefix "${ghostfolioPrefix}_" for the data source ("${DataSource.MANUAL}")` ); - } else if ( - dataSource !== DataSource.MANUAL && - isValidCustomAssetProfileSymbol(symbol) - ) { - throw new Error( - `assetProfiles.${index}.symbol ("${symbol}") is not valid for the data source ("${dataSource}")` - ); } } @@ -249,6 +242,13 @@ export class ImportService { throw new Error( `activities.${index}.symbol ("${activity.symbol}") must be a UUID or start with the prefix "${ghostfolioPrefix}_" for the data source ("${DataSource.MANUAL}")` ); + } else if ( + activity.dataSource !== DataSource.MANUAL && + isValidCustomAssetProfileSymbol(activity.symbol) + ) { + throw new Error( + `activities.${index}.symbol ("${activity.symbol}") is not valid for the data source ("${activity.dataSource}")` + ); } }