// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init

generator client {
  provider = "prisma-client"
  output   = "generated"
}

datasource db {
  provider = "mongodb"
  url      = env("DATABASE_URL")
}

model Group {
  telegramID Int      @id @map("_id") @db.Int
  name       String
  createdAt  DateTime @default(now())
  updatedAt  DateTime @default(now()) @updatedAt
}

model TotalStats {
  createdAt        DateTime @id @default(now()) @map("_id")
  updatedAt        DateTime @default(now()) @updatedAt
  linksDeleted     BigInt   @default(0)
  commandResponses BigInt   @default(0)
  timesTriggered   BigInt   @default(0)
}

model DailyStats {
  createdAt        DateTime @id @default(now()) @map("_id")
  updatedAt        DateTime @default(now()) @updatedAt
  linksDeleted     BigInt   @default(0)
  commandResponses BigInt   @default(0)
  timesTriggered   BigInt   @default(0)
}

model WeeklyStats {
  createdAt        DateTime @id @default(now()) @map("_id")
  updatedAt        DateTime @default(now()) @updatedAt
  linksDeleted     BigInt   @default(0)
  commandResponses BigInt   @default(0)
  timesTriggered   BigInt   @default(0)
}

model MonthlyStats {
  createdAt        DateTime @id @default(now()) @map("_id")
  updatedAt        DateTime @default(now()) @updatedAt()
  linksDeleted     BigInt   @default(0)
  commandResponses BigInt   @default(0)
  timesTriggered   BigInt   @default(0)
}
