feat(automations): form-driven branching rules, round-robin assignment, lead-linked activities
This commit is contained in:
@@ -725,11 +725,15 @@ model Activity {
|
||||
fields Json?
|
||||
/// کاربران شرکتکننده؛ فعالیت در لیست آنها هم دیده میشود
|
||||
participantIds String[] @default([])
|
||||
/// لید مرتبط (مثلاً فعالیت ساختهشده از ارسال فرم)
|
||||
leadId String?
|
||||
lead Lead? @relation(fields: [leadId], references: [id], onDelete: SetNull)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([stageId])
|
||||
@@index([typeDefId])
|
||||
@@index([leadId])
|
||||
@@index([organizationId, status, dueAt])
|
||||
@@index([organizationId, assigneeId])
|
||||
@@index([organizationId, createdById])
|
||||
@@ -1443,12 +1447,25 @@ model AutomationRule {
|
||||
action AutomationAction
|
||||
/// عنوان فعالیت/اعلان، assigneeId، notifyUserId، points، activityType
|
||||
config Json @default("{}")
|
||||
cursors AutomationCursor[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([organizationId, isActive, trigger])
|
||||
}
|
||||
|
||||
/// شمارندهٔ تقسیم نوبتی برای هر گام عمل در یک قانون اتوماسیون
|
||||
model AutomationCursor {
|
||||
id String @id @default(cuid())
|
||||
ruleId String
|
||||
rule AutomationRule @relation(fields: [ruleId], references: [id], onDelete: Cascade)
|
||||
stepId String
|
||||
counter Int @default(0)
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([ruleId, stepId])
|
||||
}
|
||||
|
||||
enum MessageAutomationTrigger {
|
||||
person_created
|
||||
lead_submitted
|
||||
@@ -2400,6 +2417,7 @@ model Lead {
|
||||
trackingLinks TrackingLink[]
|
||||
trackingEvents TrackingEvent[]
|
||||
routineTasks RoutineTask[]
|
||||
activities Activity[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user