|
@ -200,9 +200,9 @@ export class ImportService { |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
if (isDryRun) { |
|
|
if (isDryRun) { |
|
|
accountsDto.forEach((accountsDto) => |
|
|
accountsDto.forEach(({ id, name }) => { |
|
|
accounts.push({ id: accountsDto.id, name: accountsDto.name }) |
|
|
accounts.push({ id, name }); |
|
|
); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const activities: Activity[] = []; |
|
|
const activities: Activity[] = []; |
|
@ -220,9 +220,9 @@ export class ImportService { |
|
|
unitPrice |
|
|
unitPrice |
|
|
} of activitiesDto) { |
|
|
} of activitiesDto) { |
|
|
const date = parseISO(<string>(<unknown>dateString)); |
|
|
const date = parseISO(<string>(<unknown>dateString)); |
|
|
const validatedAccount = accounts.find( |
|
|
const validatedAccount = accounts.find(({ id }) => { |
|
|
(account) => account.id === accountId |
|
|
return id === accountId; |
|
|
); |
|
|
}); |
|
|
|
|
|
|
|
|
let order: |
|
|
let order: |
|
|
| OrderWithAccount |
|
|
| OrderWithAccount |
|
@ -239,7 +239,7 @@ export class ImportService { |
|
|
type, |
|
|
type, |
|
|
unitPrice, |
|
|
unitPrice, |
|
|
userId, |
|
|
userId, |
|
|
accountId: validatedAccount.id, |
|
|
accountId: validatedAccount?.id, |
|
|
accountUserId: undefined, |
|
|
accountUserId: undefined, |
|
|
createdAt: new Date(), |
|
|
createdAt: new Date(), |
|
|
id: uuidv4(), |
|
|
id: uuidv4(), |
|
@ -275,7 +275,7 @@ export class ImportService { |
|
|
type, |
|
|
type, |
|
|
unitPrice, |
|
|
unitPrice, |
|
|
userId, |
|
|
userId, |
|
|
accountId: validatedAccount.id, |
|
|
accountId: validatedAccount?.id, |
|
|
SymbolProfile: { |
|
|
SymbolProfile: { |
|
|
connectOrCreate: { |
|
|
connectOrCreate: { |
|
|
create: { |
|
|
create: { |
|
|