Browse Source

Improve validation of activities and asset profiles when combining custom asset profile symbol with data source other than MANUAL

pull/7721/head
Thomas Kaul 4 days ago
parent
commit
795d74a7aa
  1. 14
      apps/api/src/app/import/import.service.ts

14
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}")`
);
}
}

Loading…
Cancel
Save