Add scheduled automatic content drafts with Codex and image automation
This commit is contained in:
@@ -91,6 +91,7 @@ model User {
|
||||
teamInvitesSent TeamInvite[] @relation("TeamInviteSender")
|
||||
approvalAssignments ApprovalRequest[] @relation("ApprovalAssignee")
|
||||
approvalRequestsSent ApprovalRequest[] @relation("ApprovalRequester")
|
||||
contentAutomations PageContentAutomation[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -168,6 +169,7 @@ model Page {
|
||||
aiUsage AiUsage[]
|
||||
generationJobs PostGenerationJob[]
|
||||
teamPage TeamPage?
|
||||
contentAutomation PageContentAutomation?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -489,6 +491,27 @@ enum PostGenerationStatus {
|
||||
CANCELLED
|
||||
}
|
||||
|
||||
// Recurring draft creation. The existing queue owns content and image generation.
|
||||
model PageContentAutomation {
|
||||
id String @id @default(cuid())
|
||||
pageId String @unique
|
||||
page Page @relation(fields: [pageId], references: [id], onDelete: Cascade)
|
||||
requestedById String
|
||||
requestedBy User @relation(fields: [requestedById], references: [id], onDelete: Restrict)
|
||||
enabled Boolean @default(false)
|
||||
weekdays Int[] @default([1, 2, 3, 4, 5])
|
||||
times String[] @default(["09:00"])
|
||||
brief String @default("")
|
||||
targets Platform[] @default([FACEBOOK])
|
||||
nextRunAt DateTime?
|
||||
lastQueuedAt DateTime?
|
||||
lastError String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([enabled, nextRunAt])
|
||||
}
|
||||
|
||||
// Durable creation queue. The output is always a draft and never a published post.
|
||||
model PostGenerationJob {
|
||||
id String @id @default(cuid())
|
||||
|
||||
Reference in New Issue
Block a user