Skip to content

Commit

Permalink
feat: add some premium tier stuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vann-Dev committed Apr 30, 2024
1 parent 10fddd3 commit 3f1c412
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ enum Locale {
en
}

enum Tier {
FREE
SILVER
GOLD
DIAMOND
}

// ! AFTER ADDING MORE SETTING MAKE SURE TO EDIT src/typings/index.ts
model Guild {
id String @id @default(auto()) @map("_id") @db.ObjectId
Expand All @@ -26,7 +33,8 @@ model Guild {
volume Int @default(75)
language Locale @default(en)
premium Boolean @default(false)
subscription Subscription? @relation(fields: [subscriptionId], references: [id])
subscriptionId String? @db.ObjectId
}

model User {
Expand Down Expand Up @@ -55,6 +63,18 @@ model Song {
info SongInfo
}

model Subscription {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @unique
premiumCount Int @default(0)
premiumTier Tier @default(FREE)
purchasedAt DateTime
premiumGuild Guild[]
}

type SongInfo {
isSeekable Boolean
isStream Boolean
Expand Down

0 comments on commit 3f1c412

Please sign in to comment.