@adaptware/eagles-db 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +110 -0
  2. package/bin/db-cli.js +113 -0
  3. package/client/client.d.ts +1 -0
  4. package/client/client.js +4 -0
  5. package/client/default.d.ts +1 -0
  6. package/client/default.js +4 -0
  7. package/client/edge.d.ts +1 -0
  8. package/client/edge.js +1039 -0
  9. package/client/index-browser.js +1022 -0
  10. package/client/index.d.ts +94904 -0
  11. package/client/index.js +1064 -0
  12. package/client/libquery_engine-darwin.dylib.node +0 -0
  13. package/client/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
  14. package/client/package.json +150 -0
  15. package/client/runtime/edge-esm.js +34 -0
  16. package/client/runtime/edge.js +34 -0
  17. package/client/runtime/index-browser.d.ts +370 -0
  18. package/client/runtime/index-browser.js +16 -0
  19. package/client/runtime/library.d.ts +3976 -0
  20. package/client/runtime/library.js +146 -0
  21. package/client/runtime/react-native.js +83 -0
  22. package/client/runtime/wasm-compiler-edge.js +83 -0
  23. package/client/runtime/wasm-engine-edge.js +35 -0
  24. package/client/schema.prisma +1158 -0
  25. package/client/wasm.d.ts +1 -0
  26. package/client/wasm.js +1022 -0
  27. package/package.json +55 -0
  28. package/prisma/schema/CandidateQuestionResponse.prisma +21 -0
  29. package/prisma/schema/UserRole.prisma +20 -0
  30. package/prisma/schema/action.prisma +35 -0
  31. package/prisma/schema/applications.prisma +44 -0
  32. package/prisma/schema/approval.prisma +14 -0
  33. package/prisma/schema/assessment.prisma +40 -0
  34. package/prisma/schema/assessmentLibrary.prisma +33 -0
  35. package/prisma/schema/assessmentQuestion.prisma +17 -0
  36. package/prisma/schema/assignmentLibrary.prisma +20 -0
  37. package/prisma/schema/budget.prisma +38 -0
  38. package/prisma/schema/calendly.prisma +18 -0
  39. package/prisma/schema/candidateProfile.prisma +26 -0
  40. package/prisma/schema/contactUs.prisma +12 -0
  41. package/prisma/schema/evaluationPlan.prisma +91 -0
  42. package/prisma/schema/feedback.prisma +18 -0
  43. package/prisma/schema/fitCheck.prisma +54 -0
  44. package/prisma/schema/google.prisma +16 -0
  45. package/prisma/schema/intermediateFeedback.prisma +18 -0
  46. package/prisma/schema/interview.prisma +65 -0
  47. package/prisma/schema/interviewLibrary.prisma +33 -0
  48. package/prisma/schema/interviewNotes.prisma +17 -0
  49. package/prisma/schema/jobDescription.prisma +43 -0
  50. package/prisma/schema/jobDescriptionData.prisma +16 -0
  51. package/prisma/schema/message.prisma +15 -0
  52. package/prisma/schema/ongoingEvaluation.prisma +59 -0
  53. package/prisma/schema/organisation.prisma +44 -0
  54. package/prisma/schema/overallFeedback.prisma +35 -0
  55. package/prisma/schema/panelist.prisma +24 -0
  56. package/prisma/schema/permission.prisma +13 -0
  57. package/prisma/schema/questions.prisma +36 -0
  58. package/prisma/schema/resume.prisma +26 -0
  59. package/prisma/schema/resumeData.prisma +15 -0
  60. package/prisma/schema/schema.prisma +16 -0
  61. package/prisma/schema/suggestion.prisma +21 -0
  62. package/prisma/schema/transcript.prisma +26 -0
  63. package/prisma/schema/user.prisma +68 -0
  64. package/prisma/schema/userProfile.prisma +15 -0
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@adaptware/eagles-db",
3
+ "version": "0.1.1",
4
+ "description": "A Prisma client package for Treadspace database operations",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "dev": "tsc --watch",
19
+ "migrate:dev": "prisma migrate dev --schema prisma/schema",
20
+ "migrate:deploy": "prisma migrate deploy --schema prisma/schema",
21
+ "studio": "prisma studio --schema prisma/schema",
22
+ "generate": "prisma generate --schema prisma/schema",
23
+ "update": "yarn run generate && yarn run build"
24
+ },
25
+ "keywords": [
26
+ "prisma",
27
+ "database",
28
+ "eagles",
29
+ "client"
30
+ ],
31
+ "author": "",
32
+ "license": "MIT",
33
+ "dependencies": {
34
+ "@prisma/client": "6.15.0",
35
+ "prisma": "6.15.0",
36
+ "zod": "^4.1.5"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^20.10.5",
40
+ "typescript": "^5.3.3"
41
+ },
42
+ "bin": {
43
+ "treadspace-db": "./bin/db-cli.js"
44
+ },
45
+ "peerDependencies": {},
46
+ "files": [
47
+ "dist",
48
+ "prisma",
49
+ "bin",
50
+ "client"
51
+ ],
52
+ "engines": {
53
+ "node": ">=18.0.0"
54
+ }
55
+ }
@@ -0,0 +1,21 @@
1
+ model CandidateQuestionResponse {
2
+ id String @id @default(uuid())
3
+ question_id String
4
+ candidate_id String
5
+ assessment_id String
6
+ response String
7
+ score Float?
8
+ created_by String
9
+ updated_by String
10
+ created_at DateTime @default(now())
11
+ updated_at DateTime @updatedAt
12
+ is_active Boolean @default(true)
13
+ // Relations
14
+ question Question @relation(fields: [question_id], references: [id], onDelete: Cascade)
15
+ assessment Assessment @relation(fields: [assessment_id], references: [id], onDelete: Cascade)
16
+ candidate User @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
17
+
18
+ @@index([candidate_id])
19
+ @@index([question_id])
20
+ @@index([assessment_id])
21
+ }
@@ -0,0 +1,20 @@
1
+ model UserRole {
2
+ id String @id @default(uuid())
3
+ role String
4
+ organisation_id String?
5
+ is_custom Boolean @default(false)
6
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
7
+ permission_id String? @unique
8
+ permission Permission? @relation(fields: [permission_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
9
+ users User[]
10
+ created_at DateTime @default(now())
11
+ updated_at DateTime @updatedAt
12
+ created_by String
13
+ updated_by String
14
+ is_active Boolean @default(true)
15
+
16
+ @@unique([role, organisation_id])
17
+ @@index([role, organisation_id])
18
+ @@index([organisation_id])
19
+ @@index([permission_id])
20
+ }
@@ -0,0 +1,35 @@
1
+ enum ActionType {
2
+ TAKE_INTERVIEW
3
+ PROVIDE_FEEDBACK
4
+ SCHEDULE_INTERVIEW
5
+ }
6
+
7
+ enum ActionStatus {
8
+ PENDING
9
+ COMPLETED
10
+ CANCELLED
11
+ }
12
+
13
+ model Action {
14
+ id String @id @default(uuid())
15
+ assignee_id String
16
+ title String
17
+ action_type ActionType
18
+ action_id String // Generic foreign key that can link to any entity
19
+ due_date DateTime?
20
+ organisation_id String
21
+ status ActionStatus @default(PENDING)
22
+ // Relations
23
+ user User @relation(fields: [assignee_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
24
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
25
+ // Audit fields
26
+ created_at DateTime @default(now())
27
+ updated_at DateTime @updatedAt
28
+ created_by String
29
+ updated_by String
30
+ is_active Boolean @default(true)
31
+
32
+ @@index([assignee_id, action_type])
33
+ @@index([status])
34
+ @@index([due_date])
35
+ }
@@ -0,0 +1,44 @@
1
+ // PENDING could be understood as unscreened
2
+ enum ApplicationStatus {
3
+ PENDING
4
+ IN_PROGRESS
5
+ SHORTLISTED
6
+ REJECTED
7
+ }
8
+
9
+ model Application {
10
+ id String @id @default(uuid())
11
+ candidate_id String
12
+ resume_id String
13
+ organisation_id String
14
+ job_description_id String
15
+ status ApplicationStatus @default(PENDING)
16
+ fit_check_score Float?
17
+ fit_check_status FitCheckStatus?
18
+ applied_at DateTime @default(now())
19
+ evaluation_plan_id String?
20
+ evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id])
21
+ fit_check_id String? @unique
22
+ round_no Int @default(0)
23
+
24
+ // Relations
25
+ candidate User @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
26
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
27
+ resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
28
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
29
+ fit_check FitCheck? @relation(fields: [fit_check_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
30
+ interviews Interview[]
31
+ ongoing_evaluations OngoingEvaluation[]
32
+
33
+ created_at DateTime @default(now())
34
+ updated_at DateTime @updatedAt
35
+ created_by String
36
+ updated_by String
37
+ is_active Boolean @default(true)
38
+
39
+ @@unique([candidate_id, job_description_id]) // Ensures candidate applies only once per job
40
+ @@index([candidate_id])
41
+ @@index([job_description_id])
42
+ @@index([organisation_id])
43
+ @@index([resume_id])
44
+ }
@@ -0,0 +1,14 @@
1
+ model Approval {
2
+ id String @id @default(uuid())
3
+ job_description_id String
4
+ user_id String
5
+ organisaton_id String
6
+ created_at DateTime @default(now())
7
+ updated_at DateTime @updatedAt
8
+ created_by String
9
+ updated_by String
10
+ is_active Boolean @default(true)
11
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
12
+ user User @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
13
+ organisation Organisation @relation(fields: [organisaton_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
14
+ }
@@ -0,0 +1,40 @@
1
+ enum AssessmentStatus {
2
+ SCHEDULED // Assessment has been created and scheduled
3
+ IN_PROGRESS // Candidate is currently giving the assessment
4
+ COMPLETED // Assessment completed by candidate
5
+ CANCELLED // Assessment cancelled by admin or system
6
+ RESCHEDULED // Assessment rescheduled to a new time
7
+ NO_SHOW // Candidate failed to take the assessment
8
+ EVALUATION_PENDING // Waiting for manual/AI review of answers
9
+ EVALUATED // Final evaluation completed and locked
10
+ }
11
+
12
+ model Assessment {
13
+ id String @id @default(uuid())
14
+ assessment_id String
15
+ candidate_id String
16
+ reviewer_id String?
17
+ score Float?
18
+ feedback String?
19
+ scheduled_start_time DateTime? @default(now()) // Start Time to start the assessment
20
+ assessment_status AssessmentStatus @default(SCHEDULED)
21
+ created_at DateTime @default(now())
22
+ updated_at DateTime @updatedAt
23
+ created_by String
24
+ updated_by String
25
+ is_active Boolean @default(true)
26
+ // Relations
27
+ assessment_libarary AssessmentLibrary @relation(fields: [assessment_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
28
+ candidate User @relation("CandidateAssessments", fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
29
+ reviewer User? @relation("ReviewerAssessments", fields: [reviewer_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
30
+ questions AssessmentQuestion[] @relation("AssessmentToAssessmentQuestion")
31
+ candidateResponse CandidateQuestionResponse[]
32
+ Panelist Panelist? @relation(fields: [panelistId], references: [id])
33
+ panelistId String?
34
+ User User? @relation(fields: [userId], references: [id])
35
+ userId String?
36
+
37
+ @@unique([assessment_id, candidate_id])
38
+ @@index([assessment_id])
39
+ @@index([candidate_id])
40
+ }
@@ -0,0 +1,33 @@
1
+ /// Defines how an assessment is conducted.
2
+
3
+ enum AssessmentCategory {
4
+ MCQ
5
+ COMPETENCY
6
+ CASE_STUDY
7
+ ASSIGNMENT
8
+ }
9
+
10
+ model AssessmentLibrary {
11
+ id String @id @default(uuid())
12
+ title String
13
+ assessment_type String?
14
+ description String?
15
+ assessment_category AssessmentCategory
16
+ time_required Int
17
+ passing_score Float?
18
+ max_score Float?
19
+ organisation_id String
20
+ created_by_ai Boolean @default(false)
21
+ created_at DateTime @default(now())
22
+ updated_at DateTime @updatedAt
23
+ created_by String
24
+ updated_by String
25
+ is_active Boolean @default(true)
26
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
27
+ questions Question[] // One assessment → many questions
28
+ assessments Assessment[]
29
+ evaluation_Plans EvaluationPlan[]
30
+
31
+ @@index([organisation_id])
32
+ @@index([created_at])
33
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Join table linking Assessments and Questions in a many-to-many relationship.
3
+ * - Each row represents one link between a specific Assessment and a specific Question.
4
+ * - Composite ID ensures no duplicate pairings exist.
5
+ * - Cascade delete ensures join rows are removed when either side is deleted.
6
+ * - Enables sharing the same Question across multiple Assessments.
7
+ */
8
+ model AssessmentQuestion {
9
+ assessment_id String
10
+ question_id String
11
+ assessment Assessment @relation("AssessmentToAssessmentQuestion", fields: [assessment_id], references: [id], onDelete: Cascade)
12
+ question Question @relation("QuestionToAssessmentQuestion", fields: [question_id], references: [id], onDelete: Cascade)
13
+ created_at DateTime @default(now())
14
+ updated_at DateTime @updatedAt
15
+
16
+ @@id([assessment_id, question_id])
17
+ }
@@ -0,0 +1,20 @@
1
+
2
+ model AssignmentLibrary {
3
+ id String @id @default(uuid())
4
+ deadline Int
5
+ /// Flexible JSON for assignment-specific config (rubrics, instructions, criteria, etc.)
6
+ assignment Json?
7
+ job_description_id String
8
+ organisation_id String
9
+ created_at DateTime @default(now())
10
+ updated_at DateTime @updatedAt
11
+ created_by String
12
+ updated_by String
13
+ is_active Boolean @default(true)
14
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
15
+ jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
16
+ /// Back-relation: one-to-one from EvaluationPlan (FK lives on EvaluationPlan.assignment_library_id)
17
+ evaluationPlan EvaluationPlan[]
18
+ @@index([job_description_id])
19
+ @@index([created_at])
20
+ }
@@ -0,0 +1,38 @@
1
+ enum JobType {
2
+ Full_time
3
+ Part_time
4
+ Contract
5
+ Internship
6
+ Temporary
7
+ }
8
+
9
+ enum JDCreationType {
10
+ Pick_from_Library
11
+ Upload_JD
12
+ Create_New
13
+ Create_From_Profile
14
+ }
15
+
16
+ model Budget {
17
+ id String @id @default(uuid())
18
+ job_type JobType
19
+ location String
20
+ shift String
21
+ openings Int
22
+ budget_per_job String
23
+ level String
24
+ start_date DateTime
25
+ closing_date DateTime
26
+ business_unit String
27
+ purpose String
28
+ role String
29
+ domain String
30
+ jd_creation_type JDCreationType
31
+ job_description_id String @unique
32
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
33
+ created_at DateTime @default(now())
34
+ updated_at DateTime @updatedAt
35
+ created_by String
36
+ updated_by String
37
+ is_active Boolean @default(true)
38
+ }
@@ -0,0 +1,18 @@
1
+ model Calendly {
2
+ id String @id @default(uuid())
3
+ user_id String @unique
4
+
5
+ access_token String
6
+ refresh_token String
7
+ expires_at DateTime
8
+ calendly_user_uri String
9
+ scope String?
10
+
11
+ user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
12
+
13
+ created_at DateTime @default(now())
14
+ updated_at DateTime @updatedAt
15
+ created_by String
16
+ updated_by String
17
+ is_active Boolean @default(true)
18
+ }
@@ -0,0 +1,26 @@
1
+ model CandidateProfile {
2
+ id String @id @default(uuid())
3
+ created_at DateTime @default(now())
4
+ updated_at DateTime @updatedAt
5
+ name String
6
+ phone String
7
+ location String
8
+ salary String?
9
+ description String?
10
+ resume_id String? @unique
11
+ date_of_birth DateTime?
12
+
13
+ user User? @relation(fields: [user_id], references: [id])
14
+ user_id String? @unique
15
+
16
+ resume Resume? @relation(fields: [resume_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
17
+
18
+ work_experience Json?
19
+ education Json?
20
+ notice_period String?
21
+ gender String?
22
+ ethnicity String?
23
+ veteran_status String?
24
+ disability_status String?
25
+ is_active Boolean @default(true)
26
+ }
@@ -0,0 +1,12 @@
1
+ model ContactUs {
2
+ id String @id @default(uuid())
3
+ name String
4
+ email String
5
+ organisation_name String
6
+ organisation_website String
7
+ subject String
8
+ message String
9
+ createdAt DateTime @default(now())
10
+ updatedAt DateTime @updatedAt
11
+ is_active Boolean @default(true)
12
+ }
@@ -0,0 +1,91 @@
1
+ enum RoundType {
2
+ ASSESSMENT
3
+ INTERVIEW
4
+ ASSIGNMENT
5
+ SCREENING
6
+ }
7
+
8
+ // Old
9
+ enum WeightageLevel {
10
+ LOW
11
+ MEDIUM
12
+ HIGH
13
+ }
14
+
15
+ enum EvaluationRoundFormat {
16
+ // ────────────────
17
+ // Screening formats
18
+ // ────────────────
19
+ PHONE_CALL
20
+ VIDEO_CALL_AI_ASSISTED
21
+ VIDEO_CALL_UNASSISTED
22
+
23
+ // ────────────────
24
+ // Assessment formats
25
+ // ────────────────
26
+ AI_GENERATED_TEST
27
+ UPLOADED_TEST
28
+ EXTERNAL_PLATFORM
29
+
30
+ // ────────────────
31
+ // Assignment formats
32
+ // ────────────────
33
+ AI_GENERATED_ASSIGNMENT
34
+ UPLOADED_ASSIGNMENT
35
+
36
+ // ────────────────
37
+ // Interview formats
38
+ // ────────────────
39
+ TREADSPACE_AI_ASSISTED
40
+ EXTERNAL_VIDEO_AI_ASSISTED
41
+ EXTERNAL_VIDEO_UNASSISTED
42
+ }
43
+
44
+ enum EvaluationType {
45
+ // Old
46
+ HUMAN_AI // Combination of human and AI evaluation
47
+ AI // Fully automated AI evaluation
48
+ HUMAN // Fully human-driven evaluation
49
+ // New (In active use now)
50
+ TREADSPACE_AI_ASSISTED
51
+ EXTERNAL_AI_ASSISTED
52
+ NON_AI_ASSISTED
53
+ }
54
+
55
+ model EvaluationPlan {
56
+ id String @id @default(uuid())
57
+ job_description_id String
58
+ assessment_id String?
59
+ assignment_library_id String?
60
+ title String
61
+ description String?
62
+ format EvaluationRoundFormat?
63
+ weightage WeightageLevel?
64
+ topics String[]
65
+ assignee String?
66
+ elimination_round Boolean @default(false)
67
+ evaluation_type EvaluationType
68
+ type_of_round RoundType
69
+ timeline Int
70
+ order_no Int
71
+ details Json?
72
+ lock_weight Boolean?
73
+ created_by String
74
+ updated_by String
75
+ created_at DateTime @default(now())
76
+ updated_at DateTime @updatedAt
77
+ is_active Boolean @default(true)
78
+ // Relations
79
+ jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade)
80
+ questions Question[] // One evaluation plan → many questions
81
+ panelists Panelist[]
82
+ interviews Interview[]
83
+ applications Application[]
84
+ // 👇 New optional one-to-one relation with AssessmentLibrary
85
+ assessment AssessmentLibrary? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
86
+ assignment_library AssignmentLibrary? @relation(fields: [assignment_library_id], references: [id], onDelete: SetNull)
87
+ ongoing_evaluations OngoingEvaluation[]
88
+
89
+ @@unique([job_description_id, order_no])
90
+ @@index([job_description_id])
91
+ }
@@ -0,0 +1,18 @@
1
+ model Feedback {
2
+ id String @id @default(uuid())
3
+ interview_id String
4
+ order_no Int
5
+
6
+ ai_feedback Json?
7
+ human_feedback Json?
8
+
9
+ created_at DateTime @default(now())
10
+ updated_at DateTime @updatedAt
11
+ created_by String
12
+ updated_by String
13
+ is_active Boolean @default(true)
14
+ interview Interview @relation(fields: [interview_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
15
+
16
+ @@unique([interview_id, order_no])
17
+ @@index([interview_id])
18
+ }
@@ -0,0 +1,54 @@
1
+ enum FitCheckStatus {
2
+ RECOMMENDED
3
+ TO_REVIEW
4
+ NOT_RECOMMENDED
5
+ }
6
+
7
+ model FitCheck {
8
+ /// Primary key (UUID)
9
+ id String @id @default(uuid())
10
+ /// FK to organisations table
11
+ organisation_id String?
12
+ resume_id String
13
+ job_description_id String
14
+
15
+ /// Old Fields will be deprecated soon
16
+ skills_match String[]
17
+ skills_score Float?
18
+ responsibilities_match String[]
19
+ responsibilities_score Float?
20
+ experience_match String[]
21
+ experience_score Float?
22
+ organisation_value_score Float?
23
+ organisation_value_match String[]
24
+ qualifications_match String[]
25
+ qualifications_score Float?
26
+ overall_analysis String[]
27
+ fit Json[]
28
+ fit_check_status FitCheckStatus?
29
+ // Fields to be used now
30
+
31
+ overall_score Float
32
+ short_match_analysis Json[]
33
+ candidate_analysis Json[]
34
+ technical_analysis Json[]
35
+ competency_analysis Json[]
36
+ recommendation Json?
37
+
38
+ /// Audit fields
39
+ created_by String
40
+ updated_by String
41
+ is_active Boolean @default(true)
42
+ /// Timestamps
43
+ created_at DateTime @default(now())
44
+ updated_at DateTime @updatedAt
45
+ /// Relations
46
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
47
+ resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
48
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
49
+ application Application?
50
+
51
+ /// Ensure one FitCheck per (resume_id, job_description_id) pair
52
+ @@unique([resume_id, job_description_id])
53
+ @@index([resume_id])
54
+ }
@@ -0,0 +1,16 @@
1
+ model Google {
2
+ id String @id @default(uuid())
3
+ user_id String @unique
4
+
5
+ google_email String
6
+ refresh_token String
7
+ scope String?
8
+
9
+ user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
10
+
11
+ created_at DateTime @default(now())
12
+ updated_at DateTime @updatedAt
13
+ created_by String
14
+ updated_by String
15
+ is_active Boolean @default(true)
16
+ }
@@ -0,0 +1,18 @@
1
+ model IntermediateFeedback {
2
+ id String @id @default(uuid())
3
+ interview_id String
4
+ overall_feedback_id String?
5
+ intermediate_feedback Json
6
+ order_no Int @default(autoincrement())
7
+ created_at DateTime @default(now())
8
+ updated_at DateTime @updatedAt
9
+ created_by String
10
+ updated_by String
11
+ is_active Boolean @default(true)
12
+ // Relations
13
+ interview Interview @relation(fields: [interview_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
14
+ OverallFeedback OverallFeedback? @relation(fields: [overall_feedback_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
15
+ transcripts Transcript[]
16
+
17
+ @@index([interview_id])
18
+ }
@@ -0,0 +1,65 @@
1
+ enum InterviewStatus {
2
+ INTERVIEW_REQUESTED
3
+ SCHEDULED
4
+ IN_PROGRESS
5
+ CANCELLED
6
+ NO_SHOW // Candidate or interviewer failed to appear
7
+ EVALUATION_PENDING // Waiting for feedback or evaluation
8
+ EVALUATED // Feedback completed and locked
9
+ }
10
+
11
+ enum InterviewFeedback {
12
+ STRONG_HIRE
13
+ HIRE
14
+ NO_HIRE
15
+ STRONG_NO_HIRE
16
+ }
17
+
18
+ model Interview {
19
+ id String @id @default(uuid())
20
+ candidate_id String
21
+ interviewer_id String?
22
+ evaluation_plan_id String
23
+ application_id String?
24
+ resume_id String
25
+ job_description_id String
26
+ organisation_id String
27
+ room_name String?
28
+ interview_summary String[]
29
+ ai_interview_feedback InterviewFeedback?
30
+ interview_feedback InterviewFeedback?
31
+ interview_rating Float? // Overall rating out of 100 based on evaluation
32
+ scheduled_start_time DateTime?
33
+ scheduled_end_time DateTime?
34
+ actual_start_time DateTime?
35
+ actual_end_time DateTime?
36
+ recording_url String?
37
+ interview_status InterviewStatus @default(SCHEDULED)
38
+ google_event_id String?
39
+ created_at DateTime @default(now())
40
+ updated_at DateTime @updatedAt
41
+ created_by String
42
+ updated_by String
43
+ is_active Boolean @default(true)
44
+ // Relations
45
+ candidate User? @relation("CandidateInterviews", fields: [candidate_id], references: [id], onDelete: SetNull)
46
+ interviewer User? @relation("InterviewerInterviews", fields: [interviewer_id], references: [id], onDelete: SetNull)
47
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
48
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
49
+ resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
50
+ evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
51
+ application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
52
+ ongoing_evaluation OngoingEvaluation?
53
+ intermediateFeedbacks IntermediateFeedback[]
54
+ transcripts Transcript[]
55
+ suggestions Suggestion[]
56
+ overallFeedback OverallFeedback[]
57
+ feedback Feedback[]
58
+ interviewNotes InterviewNotes[]
59
+
60
+ @@unique([interviewer_id, candidate_id, evaluation_plan_id])
61
+ @@index([application_id])
62
+ @@index([candidate_id])
63
+ @@index([interviewer_id])
64
+ @@index([job_description_id])
65
+ }