Enhance project setup with Prisma, new scripts, and dependencies; update README for clarity and add API routes; improve layout and styling for better user experience
This commit is contained in:
89
prisma/schema.prisma
Normal file
89
prisma/schema.prisma
Normal file
@@ -0,0 +1,89 @@
|
||||
// IA Gen Maturity Evaluator - Prisma Schema
|
||||
// SQLite for local dev; switch to Postgres for production
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
model Template {
|
||||
id String @id // "full-15"
|
||||
name String
|
||||
dimensions TemplateDimension[]
|
||||
evaluations Evaluation[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model TemplateDimension {
|
||||
id String @id @default(cuid())
|
||||
templateId String
|
||||
template Template @relation(fields: [templateId], references: [id], onDelete: Cascade)
|
||||
slug String // "tools", "prompts", etc.
|
||||
orderIndex Int
|
||||
title String
|
||||
rubric String // "1:X;2:Y;3:Z;4:A;5:B" or "1-5"
|
||||
suggestedQuestions String? // JSON array: ["Q1", "Q2", "Q3"]
|
||||
dimensionScores DimensionScore[]
|
||||
|
||||
@@unique([templateId, slug])
|
||||
}
|
||||
|
||||
model Evaluation {
|
||||
id String @id @default(cuid())
|
||||
candidateName String
|
||||
candidateRole String
|
||||
evaluatorName String
|
||||
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
|
||||
}
|
||||
|
||||
model DimensionScore {
|
||||
id String @id @default(cuid())
|
||||
evaluationId String
|
||||
evaluation Evaluation @relation(fields: [evaluationId], references: [id], onDelete: Cascade)
|
||||
dimensionId String
|
||||
dimension TemplateDimension @relation(fields: [dimensionId], references: [id], onDelete: Cascade)
|
||||
score Int? // 1-5
|
||||
justification String?
|
||||
examplesObserved String?
|
||||
confidence String? // low | med | high
|
||||
candidateNotes String? // evaluator's notes from interview
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([evaluationId, dimensionId])
|
||||
}
|
||||
|
||||
model AuditLog {
|
||||
id String @id @default(cuid())
|
||||
evaluationId String
|
||||
evaluation Evaluation @relation(fields: [evaluationId], references: [id], onDelete: Cascade)
|
||||
action String // created | updated | submitted | score_changed
|
||||
field String?
|
||||
oldValue String?
|
||||
newValue String?
|
||||
userId String?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
Reference in New Issue
Block a user