|
|
@ -1075,19 +1075,20 @@ export class ImportService { |
|
|
const date = parseISO(dateString); |
|
|
const date = parseISO(dateString); |
|
|
|
|
|
|
|
|
const isDuplicate = existingActivities.some((activity) => { |
|
|
const isDuplicate = existingActivities.some((activity) => { |
|
|
return ( |
|
|
return ( |
|
|
(activity.comment || null) === (comment || null) && |
|
|
(!accountId || activity.accountId === accountId) && |
|
|
(activity.currency === currency || |
|
|
(activity.comment || null) === (comment || null) && |
|
|
activity.assetProfile.currency === currency) && |
|
|
((activity.currency || null) === (currency || null) || |
|
|
activity.assetProfile.dataSource === dataSource && |
|
|
activity.assetProfile.currency === currency) && |
|
|
isSameSecond(activity.date, date) && |
|
|
activity.assetProfile.dataSource === dataSource && |
|
|
activity.fee === fee && |
|
|
isSameSecond(activity.date, date) && |
|
|
activity.quantity === quantity && |
|
|
activity.fee === fee && |
|
|
activity.assetProfile.symbol === symbol && |
|
|
activity.quantity === quantity && |
|
|
activity.type === type && |
|
|
activity.assetProfile.symbol === symbol && |
|
|
activity.unitPrice === unitPrice |
|
|
activity.type === type && |
|
|
); |
|
|
activity.unitPrice === unitPrice |
|
|
}); |
|
|
); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
const error: ActivityError = isDuplicate |
|
|
const error: ActivityError = isDuplicate |
|
|
? { code: 'IS_DUPLICATE' } |
|
|
? { code: 'IS_DUPLICATE' } |
|
|
|