feat: new importer (#214)

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-11-05 09:49:36 +01:00
committed by GitHub
parent b51bc8f3f6
commit 212254d31a
80 changed files with 4884 additions and 842 deletions

View File

@@ -194,6 +194,7 @@ model Project {
notificationRules NotificationRule[]
notifications Notification[]
imports Import[]
// When deleteAt > now(), the project will be deleted
deleteAt DateTime?
@@ -467,3 +468,31 @@ model ResetPassword {
@@map("reset_password")
}
enum ImportStatus {
pending
processing
completed
failed
}
model Import {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
projectId String
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
jobId String? // BullMQ job ID
status ImportStatus
statusMessage String? // Human-readable current step like "Importing events (Feb 2025)", "Generating session IDs"
errorMessage String?
/// [IPrismaImportConfig]
config Json
totalEvents Int @default(0)
processedEvents Int @default(0)
currentStep String?
currentBatch String? // String date 2020-01-01
createdAt DateTime @default(now())
completedAt DateTime?
updatedAt DateTime @default(now()) @updatedAt
@@map("imports")
}