|
@ -139,17 +139,16 @@ export class ImportService { |
|
|
activitiesDto, |
|
|
activitiesDto, |
|
|
isDryRun = false, |
|
|
isDryRun = false, |
|
|
maxActivitiesToImport, |
|
|
maxActivitiesToImport, |
|
|
userCurrency, |
|
|
|
|
|
user |
|
|
user |
|
|
}: { |
|
|
}: { |
|
|
accountsDto: Partial<CreateAccountDto>[]; |
|
|
accountsDto: Partial<CreateAccountDto>[]; |
|
|
activitiesDto: Partial<CreateOrderDto>[]; |
|
|
activitiesDto: Partial<CreateOrderDto>[]; |
|
|
isDryRun?: boolean; |
|
|
isDryRun?: boolean; |
|
|
maxActivitiesToImport: number; |
|
|
maxActivitiesToImport: number; |
|
|
userCurrency: string; |
|
|
|
|
|
user: UserWithSettings; |
|
|
user: UserWithSettings; |
|
|
}): Promise<Activity[]> { |
|
|
}): Promise<Activity[]> { |
|
|
const accountIdMapping: { [oldAccountId: string]: string } = {}; |
|
|
const accountIdMapping: { [oldAccountId: string]: string } = {}; |
|
|
|
|
|
const userCurrency = user.Settings.settings.baseCurrency; |
|
|
|
|
|
|
|
|
if (!isDryRun && accountsDto?.length) { |
|
|
if (!isDryRun && accountsDto?.length) { |
|
|
const [existingAccounts, existingPlatforms] = await Promise.all([ |
|
|
const [existingAccounts, existingPlatforms] = await Promise.all([ |
|
@ -406,9 +405,9 @@ export class ImportService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
userId: user.id, |
|
|
|
|
|
updateAccountBalance: false, |
|
|
updateAccountBalance: false, |
|
|
User: { connect: { id: user.id } } |
|
|
User: { connect: { id: user.id } }, |
|
|
|
|
|
userId: user.id |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|