feat: Add Smart Auto-Sorting and Auto-Tagging Rules (Inbox Triage Engine)

This commit is contained in:
chrisf committed 2026-10-22 17:38:00 -06:00
1 parent 2f14f48ac1
commit 44d1dec42b
11 files changed
+1782 -20

No files matched your search

+23
View File
@@ -41,6 +41,7 @@ model Notebook {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
notes Note[]
autoSortRules AutoSortRule[]
@@unique([userId, name])
@@index([userId])
@@ -185,3 +186,25 @@ model EmailConfig {
emailsImported Int @default(0)
updatedAt DateTime @updatedAt
}
model AutoSortRule {
id String @id @default(cuid())
userId String @default("default")
name String
enabled Boolean @default(true)
priority Int @default(0)
conditionField String @default("title") // title | content | sourceUrl | author | attachmentType | hasTodo
conditionOperator String @default("contains") // contains | not_contains | equals | startsWith | endsWith | matchesRegex
conditionValue String @default("")
targetNotebookId String?
targetNotebook Notebook? @relation(fields: [targetNotebookId], references: [id], onDelete: SetNull)
addTags String @default("") // comma-separated tag names
isPinned Boolean?
isShortcut Boolean?
stopOnMatch Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([userId, enabled, priority])
@@index([targetNotebookId])
}