From b26aa7f51d1bcc2244074184e44e6fda8c3ce747 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 29 Oct 2023 08:40:42 +0100 Subject: [PATCH] Feature/improve duplicate check in activities import (#2561) * Allow different accounts * Update changelog --- CHANGELOG.md | 1 + apps/api/src/app/import/import.service.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d228c76b..87ebc2c74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Improved the check for duplicates in the preview step of the activities import (allow different accounts) - Improved the usability and validation in the cash balance transfer from one to another account - Changed the checkboxes to slide toggles in the overview of the admin control panel - Switched from the deprecated (`PUT`) to the new endpoint (`POST`) to manage historical market data in the asset profile details dialog of the admin control panel diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 8fd35f8dd..96cceff54 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -83,6 +83,7 @@ export class ImportService { const isDuplicate = orders.some((activity) => { return ( + activity.accountId === Account?.id && activity.SymbolProfile.currency === assetProfile.currency && activity.SymbolProfile.dataSource === assetProfile.dataSource && isSameDay(activity.date, parseDate(dateString)) && @@ -482,6 +483,7 @@ export class ImportService { const date = parseISO((dateString)); const isDuplicate = existingActivities.some((activity) => { return ( + activity.accountId === accountId && activity.SymbolProfile.currency === currency && activity.SymbolProfile.dataSource === dataSource && isSameDay(activity.date, date) &&