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;
}
const assetProfile = {
currency,
...(
let assetProfile: Partial<SymbolProfile> = { 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}")`

Loading…
Cancel
Save