Track person import source and previous names; add source report and edit UX.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-04 12:01:21 +03:30
co-authored by Cursor
parent e144b2277a
commit 8b37525f2f
15 changed files with 632 additions and 25 deletions
+9
View File
@@ -433,6 +433,13 @@ model Person {
company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull)
firstName String
lastName String
/// نام قبل از همگام‌سازی مبدأ (مثلاً ته‌حساب)
previousFirstName String?
previousLastName String?
/// منبع ورود: manual | tahesab | didar | excel | phone | lead_form | other
importSource String @default("manual")
/// شناسه در مبدأ (کد دیدار، کد مشتری ته‌حساب، …)
sourceRef String?
email String?
phone String?
mobile String?
@@ -478,6 +485,8 @@ model Person {
@@index([organizationId, email])
@@index([organizationId, mobile])
@@index([organizationId, lastName, firstName])
@@index([organizationId, importSource])
@@index([organizationId, sourceRef])
@@index([organizationId, loyaltyPoints])
@@index([companyId])
@@index([ownerId])