58 lines
1.3 KiB
Plaintext
58 lines
1.3 KiB
Plaintext
model User {
|
|
id String @id @default(uuid())
|
|
email String @unique
|
|
password String?
|
|
role USER_ROLE @default(user)
|
|
refreshToken String?
|
|
status USER_ACCOUNT_STATUS @default(pending)
|
|
isDeleted Boolean? @default(false)
|
|
deletedAt DateTime?
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
organizations OrganizationUserJoinTable[]
|
|
organizationsRequested OrganizationJoinRequest[]
|
|
userAdditionalInformation UserAdditionalInformation?
|
|
|
|
@@map("user")
|
|
}
|
|
|
|
model UserAdditionalInformation {
|
|
id String @id @default(uuid())
|
|
userId String @unique
|
|
firstName String
|
|
middleName String?
|
|
lastName String
|
|
profilePicture String?
|
|
address String?
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model UserOTP {
|
|
email String @unique
|
|
otp Int
|
|
// ExipresAt is also saved so its easier to check and also
|
|
// run cron job to remove expired OTPs
|
|
createdAt DateTime @default(now())
|
|
expiresAt DateTime
|
|
|
|
@@map("user_otp")
|
|
}
|
|
|
|
enum USER_ROLE {
|
|
superadmin
|
|
user
|
|
}
|
|
|
|
enum USER_ACCOUNT_STATUS {
|
|
pending
|
|
active
|
|
suspended
|
|
deleted
|
|
}
|