Browse Source

Refactoring

pull/5749/head
Thomas Kaul 2 weeks ago
parent
commit
b4e7d1cafd
  1. 17
      apps/api/src/app/import/import.service.ts

17
apps/api/src/app/import/import.service.ts

@ -755,14 +755,15 @@ export class ImportService {
continue; continue;
} }
const assetProfile = { let assetProfile: Partial<SymbolProfile> = { currency };
currency,
...( try {
assetProfile = (
await this.dataProviderService.getAssetProfiles([ await this.dataProviderService.getAssetProfiles([
{ dataSource, symbol } { dataSource, symbol }
]) ])
)?.[symbol] )?.[symbol];
}; } catch {}
if (!assetProfile?.name) { if (!assetProfile?.name) {
const assetProfileInImport = assetProfilesWithMarketDataDto?.find( const assetProfileInImport = assetProfilesWithMarketDataDto?.find(
@ -799,11 +800,7 @@ export class ImportService {
} }
} }
if ( if (!['FEE', 'INTEREST', 'LIABILITY'].includes(type)) {
(dataSource !== 'MANUAL' && type === 'BUY') ||
type === 'DIVIDEND' ||
type === 'SELL'
) {
if (!assetProfile?.name) { if (!assetProfile?.name) {
throw new Error( throw new Error(
`activities.${index}.symbol ("${symbol}") is not valid for the specified data source ("${dataSource}")` `activities.${index}.symbol ("${symbol}") is not valid for the specified data source ("${dataSource}")`

Loading…
Cancel
Save