Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -1,6 +1,8 @@
|
||||
model SubscriptionProduct {
|
||||
id String @id @default(cuid())
|
||||
stripeId String
|
||||
billingProviderId String
|
||||
code String?
|
||||
lagoPlanCode String?
|
||||
order Int
|
||||
title String
|
||||
active Boolean
|
||||
@@ -18,13 +20,18 @@ model SubscriptionProduct {
|
||||
tenantProducts TenantSubscriptionProduct[]
|
||||
usageBasedPrices SubscriptionUsageBasedPrice[]
|
||||
assignsTenantTypes TenantType[]
|
||||
|
||||
@@index([code])
|
||||
@@index([lagoPlanCode])
|
||||
}
|
||||
|
||||
model SubscriptionPrice {
|
||||
id String @id @default(cuid())
|
||||
subscriptionProductId String
|
||||
subscriptionProduct SubscriptionProduct @relation(fields: [subscriptionProductId], references: [id], onDelete: Cascade)
|
||||
stripeId String
|
||||
billingProviderId String
|
||||
lagoFeeCode String?
|
||||
molliePriceReference String?
|
||||
type Int
|
||||
billingPeriod Int
|
||||
price Decimal
|
||||
@@ -32,13 +39,16 @@ model SubscriptionPrice {
|
||||
trialDays Int
|
||||
active Boolean
|
||||
tenantProductPrices TenantSubscriptionProductPrice[]
|
||||
|
||||
@@index([lagoFeeCode])
|
||||
@@index([molliePriceReference])
|
||||
}
|
||||
|
||||
model SubscriptionUsageBasedPrice {
|
||||
id String @id @default(cuid())
|
||||
subscriptionProductId String
|
||||
subscriptionProduct SubscriptionProduct @relation(fields: [subscriptionProductId], references: [id], onDelete: Cascade)
|
||||
stripeId String
|
||||
billingProviderId String
|
||||
billingPeriod Int
|
||||
currency String
|
||||
unit String
|
||||
@@ -68,20 +78,47 @@ model SubscriptionFeature {
|
||||
order Int
|
||||
title String
|
||||
name String
|
||||
code String?
|
||||
type Int
|
||||
value Int
|
||||
quotaValue Json?
|
||||
href String?
|
||||
badge String?
|
||||
accumulate Boolean @default(false)
|
||||
subscriptionProduct SubscriptionProduct @relation(fields: [subscriptionProductId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([code])
|
||||
}
|
||||
|
||||
model TenantSubscription {
|
||||
id String @id @default(cuid())
|
||||
tenantId String @unique
|
||||
stripeCustomerId String?
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
||||
products TenantSubscriptionProduct[]
|
||||
id String @id @default(cuid())
|
||||
tenantId String @unique
|
||||
billingProviderCustomerId String?
|
||||
lagoCustomerId String?
|
||||
mollieCustomerId String?
|
||||
planCode String?
|
||||
seatQuantity Int @default(1)
|
||||
lastInvoiceExternalId String?
|
||||
lastPaymentExternalId String?
|
||||
status String @default("trial")
|
||||
trialStartsAt DateTime?
|
||||
trialEndsAt DateTime?
|
||||
pastDueSince DateTime?
|
||||
frozenAt DateTime?
|
||||
cancelledAt DateTime?
|
||||
dunningAttemptCount Int @default(0)
|
||||
lastDunningSentAt DateTime?
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
||||
products TenantSubscriptionProduct[]
|
||||
usageRecords TenantSubscriptionUsageRecord[]
|
||||
|
||||
@@index([status])
|
||||
@@index([planCode])
|
||||
@@index([lagoCustomerId])
|
||||
@@index([mollieCustomerId])
|
||||
@@index([trialEndsAt])
|
||||
@@index([pastDueSince])
|
||||
@@index([frozenAt])
|
||||
}
|
||||
|
||||
model TenantSubscriptionProduct {
|
||||
@@ -92,7 +129,10 @@ model TenantSubscriptionProduct {
|
||||
customEntitlementPlanId String?
|
||||
cancelledAt DateTime?
|
||||
endsAt DateTime?
|
||||
stripeSubscriptionId String?
|
||||
billingProviderSubscriptionId String?
|
||||
lagoSubscriptionId String?
|
||||
planCode String?
|
||||
seatQuantity Int?
|
||||
quantity Int?
|
||||
fromCheckoutSessionId String?
|
||||
currentPeriodStart DateTime?
|
||||
@@ -100,6 +140,9 @@ model TenantSubscriptionProduct {
|
||||
tenantSubscription TenantSubscription @relation(fields: [tenantSubscriptionId], references: [id], onDelete: Cascade)
|
||||
subscriptionProduct SubscriptionProduct @relation(fields: [subscriptionProductId], references: [id])
|
||||
prices TenantSubscriptionProductPrice[]
|
||||
|
||||
@@index([lagoSubscriptionId])
|
||||
@@index([planCode])
|
||||
}
|
||||
|
||||
model TenantSubscriptionProductPrice {
|
||||
@@ -110,16 +153,24 @@ model TenantSubscriptionProductPrice {
|
||||
subscriptionPrice SubscriptionPrice? @relation(fields: [subscriptionPriceId], references: [id])
|
||||
subscriptionUsageBasedPriceId String?
|
||||
subscriptionUsageBasedPrice SubscriptionUsageBasedPrice? @relation(fields: [subscriptionUsageBasedPriceId], references: [id])
|
||||
usageRecords TenantSubscriptionUsageRecord[]
|
||||
quantity Int @default(1)
|
||||
isMetered Boolean @default(false)
|
||||
}
|
||||
|
||||
model TenantSubscriptionUsageRecord {
|
||||
id String @id @default(cuid())
|
||||
tenantId String
|
||||
tenantSubscriptionId String
|
||||
tenantSubscriptionProductPriceId String
|
||||
tenantSubscriptionProductPrice TenantSubscriptionProductPrice @relation(fields: [tenantSubscriptionProductPriceId], references: [id], onDelete: Cascade)
|
||||
tenantSubscription TenantSubscription @relation(fields: [tenantSubscriptionId], references: [id], onDelete: Cascade)
|
||||
metricCode String @default("legacy")
|
||||
timestamp Int
|
||||
quantity Int
|
||||
stripeSubscriptionItemId String?
|
||||
idempotencyKey String?
|
||||
billingProviderSubscriptionItemId String?
|
||||
|
||||
@@unique([tenantId, metricCode, idempotencyKey])
|
||||
@@index([tenantId, metricCode, timestamp])
|
||||
}
|
||||
|
||||
model TenantProductConfiguration {
|
||||
@@ -147,16 +198,44 @@ model TenantFeatureOverride {
|
||||
}
|
||||
|
||||
model CheckoutSessionStatus {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
id String @unique
|
||||
pending Boolean @default(true) // has not added products to tenant
|
||||
email String
|
||||
fromUrl String
|
||||
fromUserId String?
|
||||
fromTenantId String?
|
||||
createdUserId String?
|
||||
createdTenantId String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
id String @unique
|
||||
pending Boolean @default(true) // has not added products to tenant
|
||||
email String
|
||||
fromUrl String
|
||||
fromUserId String?
|
||||
fromTenantId String?
|
||||
createdUserId String?
|
||||
createdTenantId String?
|
||||
provider String?
|
||||
providerPaymentId String?
|
||||
invoiceExternalId String?
|
||||
subscriptionProductId String?
|
||||
subscriptionPriceId String?
|
||||
lagoSubscriptionId String?
|
||||
planCode String?
|
||||
quantity Int @default(1)
|
||||
amountCents Int?
|
||||
currency String?
|
||||
checkoutUrl String?
|
||||
status String @default("open")
|
||||
|
||||
@@index([providerPaymentId])
|
||||
@@index([fromTenantId, pending])
|
||||
}
|
||||
|
||||
model BillingWebhookLog {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
providerEventId String @unique
|
||||
eventType String
|
||||
processedAt DateTime?
|
||||
relatedTenantId String?
|
||||
error String?
|
||||
|
||||
@@index([eventType, createdAt])
|
||||
@@index([relatedTenantId, createdAt])
|
||||
}
|
||||
|
||||
model Credit {
|
||||
|
||||
Reference in new issue
Block a user