Align companies with the Didar export: new fields, Didar-format Excel import/export, and people linked to companies by Didar code

This commit is contained in:
2026-10-06 12:25:20 +03:30
parent f88786ef61
commit f71f09c85d
8 changed files with 630 additions and 85 deletions
+18
View File
@@ -398,12 +398,28 @@ model Company {
organizationId String
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
name String
/// کد داخلی شرکت (مثل «کد شرکت» در دیدار)
code String?
/// منبع ورود: manual | didar | tahesab | excel | other
importSource String @default("manual")
/// شناسه در مبدأ (مثلاً کد دیدار شرکت)
sourceRef String?
nationalId String?
economicCode String?
registrationNumber String?
phone String?
otherPhones String?
fax String?
email String?
otherEmails String?
website String?
province String?
city String?
postalCode String?
address String?
groupName String?
notes String?
registeredAt DateTime?
tags String[] @default([])
customFields Json @default("{}")
people Person[]
@@ -423,6 +439,8 @@ model Company {
@@index([organizationId, name])
@@index([organizationId, email])
@@index([organizationId, phone])
@@index([organizationId, sourceRef])
@@index([organizationId, code])
@@index([ownerId])
}