Price
- Belongs to a Product.
- Tenants can subscribe to a Price, linked by a Tenant Subscription.
Life Cycle
Route | Create | Read | Update | Delete |
---|---|---|---|---|
/pricing | ||||
/admin/settings/pricing | ||||
/admin/settings/pricing/new | ||||
/admin/settings/pricing/:id |
Properties
Name | Title | Type | Description |
---|---|---|---|
subscriptionProductId * | Product | SubscriptionProduct | Parent Subscription Product |
stripeId * | Stripe ID | String | Stripe price ID |
type * | Type | SubscriptionPriceType | RECURRING |
billingPeriod * | Billing Period | SubscriptionBillingPeriod | MONTHLY, or YEARLY |
price * | Price | Decimal | |
currency * | Currency | String | Default: usd. |
active * | Active | Boolean | |
tenantSubscriptions * | Tenant Subscriptions | TenantSubscriptions |
Model
model SubscriptionPrice {
id String @id @default(cuid())
subscriptionProductId String
subscriptionProduct SubscriptionProduct @relation(fields: [subscriptionProductId], references: [id], onDelete: Cascade)
stripeId String
type Int // 0 = ONE_TIME, 1 = RECURRING
billingPeriod Int // 3 = MONTHLY, 4 = YEARLY
price Int
currency String
trialDays Int
active Boolean
tenantSubscriptions TenantSubscription[]
}