Update Dockerfile and package.json to use Prisma migrations, add bcryptjs and next-auth dependencies, and enhance README instructions for database setup. Refactor Prisma schema to include password hashing for users and implement evaluation sharing functionality. Improve admin page with user management features and integrate session handling for authentication. Enhance evaluation detail page with sharing options and update API routes for access control based on user roles.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m4s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m4s
This commit is contained in:
@@ -12,12 +12,15 @@ datasource db {
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
email String @unique
|
||||
name String?
|
||||
role String @default("evaluator") // evaluator | admin
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
id String @id @default(cuid())
|
||||
email String @unique
|
||||
name String?
|
||||
passwordHash String?
|
||||
role String @default("evaluator") // evaluator | admin
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
evaluations Evaluation[] @relation("Evaluator")
|
||||
sharedEvaluations EvaluationShare[]
|
||||
}
|
||||
|
||||
model Template {
|
||||
@@ -48,17 +51,31 @@ model Evaluation {
|
||||
candidateName String
|
||||
candidateRole String
|
||||
candidateTeam String? // équipe du candidat
|
||||
evaluatorName String
|
||||
evaluationDate DateTime
|
||||
templateId String
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
status String @default("draft") // draft | submitted
|
||||
findings String? // auto-generated summary
|
||||
evaluatorName String
|
||||
evaluatorId String?
|
||||
evaluator User? @relation("Evaluator", fields: [evaluatorId], references: [id], onDelete: SetNull)
|
||||
evaluationDate DateTime
|
||||
templateId String
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
status String @default("draft") // draft | submitted
|
||||
findings String? // auto-generated summary
|
||||
recommendations String?
|
||||
dimensionScores DimensionScore[]
|
||||
auditLogs AuditLog[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
auditLogs AuditLog[]
|
||||
sharedWith EvaluationShare[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model EvaluationShare {
|
||||
id String @id @default(cuid())
|
||||
evaluationId String
|
||||
evaluation Evaluation @relation(fields: [evaluationId], references: [id], onDelete: Cascade)
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([evaluationId, userId])
|
||||
}
|
||||
|
||||
model DimensionScore {
|
||||
|
||||
Reference in New Issue
Block a user