Keep previous import source and code when a person is re-imported from another source

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-05 20:54:23 +03:30
co-authored by Cursor
parent c8753a4c4e
commit 46dcf296d3
8 changed files with 103 additions and 11 deletions
+5
View File
@@ -53,6 +53,8 @@ type PersonRow = {
previousLastName: string | null;
importSource: string;
sourceRef: string | null;
previousImportSource: string | null;
previousSourceRef: string | null;
email: string | null;
phone: string | null;
mobile: string | null;
@@ -119,6 +121,7 @@ export class PeopleService {
{ mobile: { contains: q.trim() } },
{ phone: { contains: q.trim() } },
{ sourceRef: { contains: q.trim() } },
{ previousSourceRef: { contains: q.trim() } },
{ company: { name: { contains: q.trim(), mode: 'insensitive' } } },
],
}
@@ -373,6 +376,8 @@ export class PeopleService {
previousFullName: previousFullName || null,
importSource,
sourceRef: row.sourceRef,
previousImportSource: row.previousImportSource,
previousSourceRef: row.previousSourceRef,
fullName: `${row.firstName} ${row.lastName}`.trim(),
email: row.email,
phone: row.phone,