model AdsHourlyStats { id String @id @map("_id") @default(auto()) @db.ObjectId adsId String @db.ObjectId // Hour bucket start time (epoch seconds, GMT+8 aligned in code) hourStartAt BigInt clicks BigInt @default(0) createAt BigInt updateAt BigInt @@index([hourStartAt]) @@unique([adsId, hourStartAt]) @@map("adsHourlyStats") } model AdsDailyStats { id String @id @map("_id") @default(auto()) @db.ObjectId adsId String @db.ObjectId // Day bucket start time (epoch seconds, GMT+8 aligned in code) dayStartAt BigInt clicks BigInt @default(0) createAt BigInt updateAt BigInt @@index([dayStartAt]) @@unique([adsId, dayStartAt]) @@map("adsDailyStats") } model ChannelHourlyUserStats { id String @id @map("_id") @default(auto()) @db.ObjectId channelId String // Hour bucket start time (epoch seconds, GMT+8 aligned in code) hourStartAt BigInt // Total events in this hour (e.g. login count) total BigInt @default(0) // Unique user count (dedup by uid during aggregation) uniqueUsers BigInt @default(0) createAt BigInt updateAt BigInt @@index([hourStartAt]) @@unique([channelId, hourStartAt]) @@map("channelHourlyUserStats") } model ChannelDailyUserStats { id String @id @map("_id") @default(auto()) @db.ObjectId channelId String // Day bucket start time (epoch seconds, GMT+8 aligned in code) dayStartAt BigInt total BigInt @default(0) uniqueUsers BigInt @default(0) createAt BigInt updateAt BigInt @@index([dayStartAt]) @@unique([channelId, dayStartAt]) @@map("channelDailyUserStats") }