backend project
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(uuid())
|
||||
firstName String
|
||||
middleName String?
|
||||
lastName String
|
||||
email String @unique
|
||||
phoneNumber String?
|
||||
department String?
|
||||
password String
|
||||
riskStatus RiskStatus
|
||||
imageUrl String?
|
||||
title String
|
||||
isLocked Boolean @default(false)
|
||||
isActivated Boolean @default(false)
|
||||
role Role
|
||||
managerId String?
|
||||
comments Comment[]
|
||||
PasswordResetToken PasswordResetToken[]
|
||||
createdTodos Todo[] @relation("CreatedTodos")
|
||||
manager User? @relation("ManagerMembers", fields: [managerId], references: [id])
|
||||
teamMembers User[] @relation("ManagerMembers")
|
||||
assignedTodos Todo[] @relation("AssignedTodos")
|
||||
securityType SecurityType @default(BASIC)
|
||||
}
|
||||
|
||||
model Todo {
|
||||
id String @id @default(cuid())
|
||||
title String
|
||||
task String
|
||||
status TodoStatus
|
||||
priority PriorityStatus
|
||||
dueDate DateTime
|
||||
createdAt DateTime @default(now())
|
||||
createdById String
|
||||
comments Comment[]
|
||||
createdBy User @relation("CreatedTodos", fields: [createdById], references: [id])
|
||||
assignees User[] @relation("AssignedTodos")
|
||||
}
|
||||
|
||||
model Comment {
|
||||
id String @id @default(cuid())
|
||||
content String
|
||||
createdAt DateTime @default(now())
|
||||
todoId String
|
||||
userId String
|
||||
todo Todo @relation(fields: [todoId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model PasswordResetToken {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
tokenHash String @unique
|
||||
expiresAt DateTime
|
||||
usedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([userId])
|
||||
@@index([expiresAt])
|
||||
}
|
||||
|
||||
enum TodoStatus {
|
||||
NEW
|
||||
IN_PROGRESS
|
||||
COMPLETED
|
||||
ARCHIVED
|
||||
}
|
||||
|
||||
enum Role {
|
||||
MANAGER
|
||||
ADMIN
|
||||
USER
|
||||
}
|
||||
|
||||
enum RiskStatus {
|
||||
LOW_RISK
|
||||
MODERATE_RISK
|
||||
HIGH_RISK
|
||||
NO_RISK
|
||||
}
|
||||
|
||||
enum PriorityStatus {
|
||||
LOW_PRIORITY
|
||||
MODERATE_PRIORITY
|
||||
HIGH_PRIORITY
|
||||
}
|
||||
|
||||
enum SecurityType {
|
||||
BASIC
|
||||
ASSISTANCE
|
||||
MAXIMUM
|
||||
}
|
||||
Reference in New Issue
Block a user