From b4e7d1cafdc891e46b5b03e637311962422124ab Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 17 Oct 2025 21:13:33 +0200 Subject: [PATCH] Refactoring --- apps/api/src/app/import/import.service.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 8850495cc..2725747aa 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -755,14 +755,15 @@ export class ImportService { continue; } - const assetProfile = { - currency, - ...( + let assetProfile: Partial = { currency }; + + try { + assetProfile = ( await this.dataProviderService.getAssetProfiles([ { dataSource, symbol } ]) - )?.[symbol] - }; + )?.[symbol]; + } catch {} if (!assetProfile?.name) { const assetProfileInImport = assetProfilesWithMarketDataDto?.find( @@ -799,11 +800,7 @@ export class ImportService { } } - if ( - (dataSource !== 'MANUAL' && type === 'BUY') || - type === 'DIVIDEND' || - type === 'SELL' - ) { + if (!['FEE', 'INTEREST', 'LIABILITY'].includes(type)) { if (!assetProfile?.name) { throw new Error( `activities.${index}.symbol ("${symbol}") is not valid for the specified data source ("${dataSource}")`