first commit
This commit is contained in:
parent
c479637d04
commit
ad91d5c150
@ -50,22 +50,23 @@ model Operator {
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
msisdn String @unique
|
||||
userToken String @unique
|
||||
userAlias String
|
||||
operatorId String
|
||||
partnerId String
|
||||
country String
|
||||
metadata Json?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
id String @id @default(cuid())
|
||||
msisdn String @unique
|
||||
userToken String @unique
|
||||
userAlias String
|
||||
operatorId String
|
||||
partnerId String
|
||||
country String
|
||||
metadata Json?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
operator Operator @relation(fields: [operatorId], references: [id])
|
||||
partner Partner @relation(fields: [partnerId], references: [id])
|
||||
subscriptions Subscription[]
|
||||
payments Payment[]
|
||||
invoices Invoice[] // Added relation
|
||||
invoices Invoice[]
|
||||
notifications Notification[] // Added relation
|
||||
}
|
||||
|
||||
model Plan {
|
||||
@ -146,7 +147,7 @@ model Subscription {
|
||||
plan Plan @relation(fields: [planId], references: [id])
|
||||
partner Partner @relation(fields: [partnerId], references: [id])
|
||||
payments Payment[]
|
||||
invoices Invoice[] // Added relation
|
||||
invoices Invoice[]
|
||||
}
|
||||
|
||||
model Payment {
|
||||
@ -170,7 +171,7 @@ model Payment {
|
||||
partner Partner @relation(fields: [partnerId], references: [id])
|
||||
subscription Subscription? @relation(fields: [subscriptionId], references: [id])
|
||||
refunds Refund[]
|
||||
invoice Invoice? // Added relation
|
||||
invoice Invoice?
|
||||
}
|
||||
|
||||
model Refund {
|
||||
@ -187,6 +188,7 @@ model Refund {
|
||||
|
||||
model Webhook {
|
||||
id String @id @default(cuid())
|
||||
partnerId String? // Made optional for system webhooks
|
||||
url String
|
||||
event String
|
||||
payload Json
|
||||
@ -196,6 +198,8 @@ model Webhook {
|
||||
lastAttempt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
partner Partner? @relation(fields: [partnerId], references: [id])
|
||||
}
|
||||
|
||||
model Partner {
|
||||
@ -218,8 +222,10 @@ model Partner {
|
||||
subscriptions Subscription[]
|
||||
payments Payment[]
|
||||
authSessions AuthSession[]
|
||||
plans Plan[] // Added relation
|
||||
invoices Invoice[] // Added relation
|
||||
plans Plan[]
|
||||
invoices Invoice[]
|
||||
notifications Notification[] // Added relation
|
||||
webhooks Webhook[] // Added relation
|
||||
}
|
||||
|
||||
model AuthSession {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user