Add AI auto sales replies for inbox
This commit is contained in:
@@ -170,6 +170,7 @@ model Page {
|
||||
generationJobs PostGenerationJob[]
|
||||
teamPage TeamPage?
|
||||
contentAutomation PageContentAutomation?
|
||||
inboxAiAutomation PageInboxAiAutomation?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -361,6 +362,35 @@ model Conversation {
|
||||
@@unique([pageId, platform, psid])
|
||||
}
|
||||
|
||||
// Per-page AI sales assistant. Message bodies remain live in Graph and are
|
||||
// never persisted here; only configuration and source-message dedupe are kept.
|
||||
model PageInboxAiAutomation {
|
||||
id String @id @default(cuid())
|
||||
pageId String @unique
|
||||
page Page @relation(fields: [pageId], references: [id], onDelete: Cascade)
|
||||
enabled Boolean @default(false)
|
||||
personaName String @default("แอดมินพิม")
|
||||
salesGoal String @default("")
|
||||
instructions String @default("")
|
||||
updatedById String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
replies InboxAiReply[]
|
||||
}
|
||||
|
||||
model InboxAiReply {
|
||||
id String @id @default(cuid())
|
||||
automationId String
|
||||
automation PageInboxAiAutomation @relation(fields: [automationId], references: [id], onDelete: Cascade)
|
||||
sourceId String @unique
|
||||
recipientId String
|
||||
outcome String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([automationId, createdAt])
|
||||
}
|
||||
|
||||
model ReplyRule {
|
||||
id String @id @default(cuid())
|
||||
pageId String
|
||||
|
||||
Reference in New Issue
Block a user