Files
2026-07-08 16:15:37 +02:00

108 lines
2.7 KiB
Plaintext

enum GdprExportScope {
user_self
tenant_full
}
enum GdprExportStatus {
queued
processing
ready
failed
expired
}
enum TenantDeletionRequestStatus {
pending
cancelled
executing
completed
failed
}
enum TenantDeletionReason {
voluntary
non_payment
suspended_violation
admin_initiated
}
model GdprExportJob {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
tenantId String
requestedByUserId String
targetUserId String?
scope GdprExportScope
status GdprExportStatus @default(queued)
progressPercent Int @default(0)
resultFileId String?
resultBucket String?
resultKey String?
resultSizeBytes Int?
resultExpiresAt DateTime?
downloadCount Int @default(0)
lastDownloadedAt DateTime?
errorMessage String?
processingStartedAt DateTime?
processingFinishedAt DateTime?
@@index([tenantId, status])
@@index([tenantId, requestedByUserId, scope, createdAt])
@@index([tenantId, targetUserId, scope, createdAt])
@@index([resultExpiresAt])
}
model TenantDeletionRequest {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
tenantId String
requestedByUserId String
reason TenantDeletionReason
reasonText String?
slugConfirmPhrase String
status TenantDeletionRequestStatus @default(pending)
gracePeriodEndsAt DateTime
cancelledAt DateTime?
cancelledByUserId String?
hardDeleteStartedAt DateTime?
hardDeleteEndedAt DateTime?
errorMessage String?
@@index([tenantId, status])
@@index([status, gracePeriodEndsAt])
}
model AvvAcceptance {
id String @id @default(cuid())
createdAt DateTime @default(now())
tenantId String
acceptedByUserId String
acceptedIp String?
acceptedUserAgent String?
avvVersion String
pdfFileId String?
signerName String
signerRole String?
@@unique([tenantId, avvVersion])
@@index([tenantId, createdAt])
}
model Subprocessor {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
purposeText String
country String
isEuEea Boolean @default(true)
dataCategories String[]
dpaUrl String?
activeSince DateTime?
archivedAt DateTime?
@@index([archivedAt])
}