feat(admin): track and display per-user download egress for Bunny version downloads

This commit is contained in:
Yusuf İpek
2026-02-22 20:19:55 +03:00
parent bbae612a70
commit 609b33bbcb
5 changed files with 116 additions and 5 deletions
+24
View File
@@ -36,6 +36,30 @@ model User {
@@map("users")
}
enum DownloadEgressSource {
ORIGINAL
COMPRESSED
}
model DownloadEgressEvent {
id String @id @default(cuid())
versionId String
videoId String
projectId String
workspaceId String
billedUserId String
downloaderUserId String?
source DownloadEgressSource
quality Int?
estimatedBytes BigInt @default(0)
createdAt DateTime @default(now())
@@index([billedUserId, createdAt])
@@index([workspaceId, createdAt])
@@index([versionId, createdAt])
@@map("download_egress_events")
}
model Account {
id String @id @default(cuid())
userId String