Deals Excel import/export aligned with Didar: browser-side import, new deal fields (code, probability, closedAt, creator, lostNote, referrer), Didar custom fields
This commit is contained in:
@@ -240,6 +240,7 @@ model User {
|
||||
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
||||
ownedDeals Deal[] @relation("DealOwner")
|
||||
assignedDeals Deal[] @relation("DealAssignees")
|
||||
createdDeals Deal[] @relation("DealCreator")
|
||||
ownedQuotes Quote[] @relation("QuoteOwner")
|
||||
ownedInvoices Invoice[] @relation("InvoiceOwner")
|
||||
ownedPeople Person[] @relation("PersonOwner")
|
||||
@@ -557,11 +558,26 @@ model Deal {
|
||||
stageId String
|
||||
stage PipelineStage @relation(fields: [stageId], references: [id], onDelete: Restrict)
|
||||
title String
|
||||
/// کد دستی معامله
|
||||
code String?
|
||||
/// منبع ورود: manual | didar | excel
|
||||
importSource String @default("manual")
|
||||
/// شناسه در مبدأ (کد دیدار معامله)
|
||||
sourceRef String?
|
||||
amount Decimal? @db.Decimal(18, 2)
|
||||
currency String @default("IRR")
|
||||
status DealStatus @default(open)
|
||||
/// احتمال موفقیت (۰ تا ۱۰۰)
|
||||
probability Int?
|
||||
/// شیوه آشنایی
|
||||
source String?
|
||||
/// شیوه آشنایی دلخواه
|
||||
sourceDetail String?
|
||||
referrer String?
|
||||
lostReason String?
|
||||
lostNote String?
|
||||
/// تاریخ انجام (موفق/ناموفق شدن)
|
||||
closedAt DateTime?
|
||||
notes String?
|
||||
tags String[] @default([])
|
||||
isStale Boolean @default(false)
|
||||
@@ -574,6 +590,8 @@ model Deal {
|
||||
company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull)
|
||||
ownerId String?
|
||||
owner User? @relation("DealOwner", fields: [ownerId], references: [id], onDelete: SetNull)
|
||||
createdById String?
|
||||
createdBy User? @relation("DealCreator", fields: [createdById], references: [id], onDelete: SetNull)
|
||||
assignees User[] @relation("DealAssignees")
|
||||
position Int @default(0)
|
||||
activities Activity[]
|
||||
@@ -592,6 +610,7 @@ model Deal {
|
||||
@@index([personId])
|
||||
@@index([companyId])
|
||||
@@index([ownerId])
|
||||
@@index([organizationId, sourceRef])
|
||||
}
|
||||
|
||||
model Activity {
|
||||
|
||||
Reference in New Issue
Block a user