feat: Organization services
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
model OrganizationJoinRequest {
|
||||
userId String
|
||||
orgId String
|
||||
status ORGANIZATION_JOIN_REQUEST @default(PENDING)
|
||||
requestedOn DateTime @default(now())
|
||||
status ORGANIZATION_JOIN_REQUEST @default(PENDING)
|
||||
requestType ORGANIZATION_JOIN_REQUEST_TYPE
|
||||
requestedOn DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
rejectReason String?
|
||||
|
||||
@@unique([userId, orgId])
|
||||
@@ -14,3 +16,8 @@ enum ORGANIZATION_JOIN_REQUEST {
|
||||
ACCEPTED
|
||||
REJECTED
|
||||
}
|
||||
|
||||
enum ORGANIZATION_JOIN_REQUEST_TYPE {
|
||||
INVITED
|
||||
REQUESTED
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
model OrganizationUserJoinTable {
|
||||
userId String
|
||||
orgId String
|
||||
role ORG_ROLE @default(user)
|
||||
role ORG_ROLE @default(member)
|
||||
joinedDate DateTime @default(now())
|
||||
|
||||
@@unique([userId, orgId])
|
||||
@@ -9,6 +9,7 @@ model OrganizationUserJoinTable {
|
||||
}
|
||||
|
||||
enum ORG_ROLE {
|
||||
owner
|
||||
admin
|
||||
user
|
||||
member
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ model User {
|
||||
lastName String
|
||||
email String @unique
|
||||
password String
|
||||
role USER_ROLE @default(ordinary)
|
||||
role USER_ROLE @default(user)
|
||||
isVerified Boolean? @default(false) // TODO: Email using queue
|
||||
refreshToken String?
|
||||
profilePicture String?
|
||||
@@ -20,5 +20,5 @@ model User {
|
||||
|
||||
enum USER_ROLE {
|
||||
superadmin
|
||||
ordinary
|
||||
user
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user