37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
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
|
|
}
|