feat(auth): setup base auth domain
This commit is contained in:
36
prisma/schema/organizations.prisma
Normal file
36
prisma/schema/organizations.prisma
Normal file
@@ -0,0 +1,36 @@
|
||||
model OrganizationInvitation {
|
||||
id String @id @default(uuid())
|
||||
senderId String
|
||||
organizationId String
|
||||
inviteToken String
|
||||
emailRecipient String
|
||||
createdAt DateTime @default(now())
|
||||
acceptedAt DateTime?
|
||||
isAccepted Boolean @default(false)
|
||||
isRevoked Boolean @default(false)
|
||||
organization Organization @relation(fields: [organizationId], references: [id])
|
||||
inviteSender AuthIdentity @relation(fields: [senderId], references: [id])
|
||||
}
|
||||
|
||||
model Organization {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
createdAt DateTime @default(now())
|
||||
organizationUsers OrganizationUserMembership[]
|
||||
invitations OrganizationInvitation[]
|
||||
}
|
||||
|
||||
model OrganizationUserMembership {
|
||||
id String @id @default(uuid())
|
||||
organizationId String
|
||||
identityId String
|
||||
createdAt DateTime @default(now())
|
||||
organization Organization @relation(fields: [organizationId], references: [id])
|
||||
identity AuthIdentity @relation(fields: [identityId], references: [id])
|
||||
}
|
||||
|
||||
enum OrganizationRole {
|
||||
OWNER
|
||||
ADMIN
|
||||
MEMBER
|
||||
}
|
||||
Reference in New Issue
Block a user