feat: Organization services

This commit is contained in:
sauravdhakal12
2026-02-22 15:47:45 +05:45
parent f4c9174752
commit afed1731d2
42 changed files with 862 additions and 17 deletions

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}