diff --git a/CHANGELOG.md b/CHANGELOG.md index eb5e53a14..87858a76b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## Unreleased ### Fixed diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 73aaf0572..2ec28365e 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -539,9 +539,9 @@ export class ImportService { connectOrCreate: { create: { dataSource, + name, symbol, currency: assetProfile.currency, - name, userId: dataSource === 'MANUAL' ? user.id : undefined }, where: { diff --git a/apps/api/src/app/order/create-order.dto.ts b/apps/api/src/app/order/create-order.dto.ts index ba7a1d868..af87fd93e 100644 --- a/apps/api/src/app/order/create-order.dto.ts +++ b/apps/api/src/app/order/create-order.dto.ts @@ -44,7 +44,8 @@ export class CreateOrderDto { customCurrency?: string; @IsEnum(DataSource) - dataSource: DataSource; + @IsOptional() + dataSource?: DataSource; @IsISO8601() @Validate(IsAfter1970Constraint) diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts index 5f5757aae..2b5d14150 100644 --- a/apps/api/src/app/order/order.service.ts +++ b/apps/api/src/app/order/order.service.ts @@ -129,7 +129,7 @@ export class OrderService { const assetSubClass = data.assetSubClass; const dataSource: DataSource = 'MANUAL'; - let name: string = data.SymbolProfile.connectOrCreate.create.name; + let name = data.SymbolProfile.connectOrCreate.create.name; let symbol: string; if ( diff --git a/apps/client/src/app/services/import-activities.service.ts b/apps/client/src/app/services/import-activities.service.ts index 36b52cc81..438bce6d1 100644 --- a/apps/client/src/app/services/import-activities.service.ts +++ b/apps/client/src/app/services/import-activities.service.ts @@ -58,19 +58,10 @@ export class ImportActivitiesService { for (const [index, item] of content.entries()) { const currency = this.parseCurrency({ content, index, item }); + const dataSource = this.parseDataSource({ item }); const type = this.parseType({ content, index, item }); + const symbol = this.parseSymbol({ content, index, item }); - let dataSource = this.parseDataSource({ item }); - - // Set default dataSource if not provided in CSV - if (!dataSource) { - if (['FEE', 'INTEREST', 'LIABILITY'].includes(type)) { - dataSource = DataSource.MANUAL; - } else { - // For other types, try to determine from symbol or default to YAHOO - dataSource = DataSource.YAHOO; - } - } activities.push({ currency,