addd TG integration

This commit is contained in:
xCyanGrizzly
2026-03-02 11:57:17 +01:00
parent b427193d17
commit 4d0df6b1a4
35 changed files with 4436 additions and 242 deletions

View File

@@ -384,6 +384,13 @@ enum IngestionStatus {
CANCELLED
}
enum FetchStatus {
PENDING
IN_PROGRESS
COMPLETED
FAILED
}
model TelegramAccount {
id String @id @default(cuid())
phone String @unique
@@ -397,6 +404,7 @@ model TelegramAccount {
channelMaps AccountChannelMap[]
ingestionRuns IngestionRun[]
fetchRequests ChannelFetchRequest[]
@@index([isActive])
@@map("telegram_accounts")
@@ -535,3 +543,26 @@ model TopicProgress {
@@index([accountChannelMapId])
@@map("topic_progress")
}
model GlobalSetting {
key String @id @db.VarChar(64)
value String @db.Text
updatedAt DateTime @updatedAt
@@map("global_settings")
}
model ChannelFetchRequest {
id String @id @default(cuid())
accountId String
status FetchStatus @default(PENDING)
resultJson String? @db.Text
error String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
account TelegramAccount @relation(fields: [accountId], references: [id], onDelete: Cascade)
@@index([accountId, status])
@@map("channel_fetch_requests")
}