update subscription module

This commit is contained in:
root
2026-05-25 04:58:56 -04:00
parent 1606ea0053
commit 8d0b7a5ceb
17 changed files with 4394 additions and 157 deletions
+34
View File
@@ -1179,3 +1179,37 @@ model PricingConfig {
@@unique([plan, billingPeriod])
@@map("pricing_configs")
}
model PlanFeature {
id String @id @default(cuid())
plan Plan
label String
sortOrder Int @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([plan, sortOrder])
@@map("plan_features")
}
model PricingPromotion {
id String @id @default(cuid())
code String @unique
name String
description String?
discountType String // 'PERCENTAGE' | 'FIXED'
discountValue Int // percentage (1-100) or centimes for FIXED
plans String[] // empty array = all plans
periods String[] // empty array = all periods
maxUses Int?
usedCount Int @default(0)
validFrom DateTime
validUntil DateTime?
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy String?
@@index([isActive])
@@map("pricing_promotions")
}