@adaptware/eagles-db 0.4.22 → 0.4.23

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 (94) hide show
  1. package/README.md +15 -15
  2. package/bin/db-cli.js +91 -91
  3. package/client/edge.js +16 -8
  4. package/client/index-browser.js +8 -0
  5. package/client/index.d.ts +232 -7
  6. package/client/index.js +22 -14
  7. package/client/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
  8. package/client/package.json +1 -1
  9. package/client/{libquery_engine-darwin-arm64.dylib.node → query_engine-windows.dll.node} +0 -0
  10. package/client/schema.prisma +20 -10
  11. package/client/wasm.js +16 -8
  12. package/package.json +58 -58
  13. package/prisma/schema/CandidateQuestionResponse.prisma +24 -24
  14. package/prisma/schema/UserRole.prisma +20 -20
  15. package/prisma/schema/action.prisma +35 -35
  16. package/prisma/schema/activityLog.prisma +22 -22
  17. package/prisma/schema/applications.prisma +57 -56
  18. package/prisma/schema/approval.prisma +14 -14
  19. package/prisma/schema/assessment.prisma +39 -39
  20. package/prisma/schema/assessmentLibrary.prisma +21 -21
  21. package/prisma/schema/assessmentQuestion.prisma +17 -17
  22. package/prisma/schema/assignment.prisma +48 -48
  23. package/prisma/schema/assignmentLibrary.prisma +20 -20
  24. package/prisma/schema/authModule.prisma +36 -36
  25. package/prisma/schema/budget.prisma +38 -38
  26. package/prisma/schema/calendly.prisma +18 -18
  27. package/prisma/schema/candidateProfile.prisma +26 -26
  28. package/prisma/schema/communication.prisma +156 -156
  29. package/prisma/schema/contactUs.prisma +12 -12
  30. package/prisma/schema/document.prisma +37 -37
  31. package/prisma/schema/evaluationPlan.prisma +83 -74
  32. package/prisma/schema/feedback.prisma +18 -18
  33. package/prisma/schema/fitCheck.prisma +58 -58
  34. package/prisma/schema/google.prisma +16 -16
  35. package/prisma/schema/integration.prisma +98 -98
  36. package/prisma/schema/interview.prisma +112 -112
  37. package/prisma/schema/interviewNotes.prisma +17 -17
  38. package/prisma/schema/jobApplicationFields.prisma +37 -37
  39. package/prisma/schema/jobApplicationResponse.prisma +33 -33
  40. package/prisma/schema/jobApplicationTemplate.prisma +30 -30
  41. package/prisma/schema/jobDescription.prisma +57 -57
  42. package/prisma/schema/jobDescriptionData.prisma +15 -15
  43. package/prisma/schema/jobProfile.prisma +56 -56
  44. package/prisma/schema/liveAnalysis.prisma +17 -17
  45. package/prisma/schema/message.prisma +15 -15
  46. package/prisma/schema/migrations/20260415120000_remove_job_profile_current_phase/migration.sql +2 -2
  47. package/prisma/schema/migrations/20260422120000_add_integration_provider_zoom/migration.sql +2 -2
  48. package/prisma/schema/migrations/20260422140000_add_zoom_meeting_tables/migration.sql +57 -57
  49. package/prisma/schema/migrations/20260422180000_add_zoom_webhook_event/migration.sql +18 -18
  50. package/prisma/schema/migrations/20260423140000_add_interview_platform/migration.sql +6 -6
  51. package/prisma/schema/migrations/20260423150000_remove_interview_zoom_topic/migration.sql +2 -2
  52. package/prisma/schema/migrations/20260423160000_zoom_meeting_uuid/migration.sql +4 -4
  53. package/prisma/schema/migrations/20260423170000_zoom_meeting_uuid_prisma_sync/migration.sql +2 -2
  54. package/prisma/schema/migrations/20260424120000_auth_module_user_provider_unique/migration.sql +5 -5
  55. package/prisma/schema/migrations/20260424130000_zoom_meeting_zoom_host_user_id/migration.sql +6 -6
  56. package/prisma/schema/migrations/20260425100000_zoom_participant_user_enum/migration.sql +22 -22
  57. package/prisma/schema/migrations/20260425110000_zoom_participant_zoom_id_required/migration.sql +13 -13
  58. package/prisma/schema/migrations/20260425120000_zoom_participant_id_nullable/migration.sql +4 -4
  59. package/prisma/schema/migrations/20260429140000_drop_evaluation_plan_job_order_unique/migration.sql +5 -5
  60. package/prisma/schema/migrations/20260429180000_eval_plan_timeline_optional_ongoing_duration/migration.sql +15 -15
  61. package/prisma/schema/migrations/20260430120000_drop_assessment_library_metadata_fields/migration.sql +8 -8
  62. package/prisma/schema/migrations/20260430140000_drop_question_question_type/migration.sql +5 -5
  63. package/prisma/schema/migrations/20260513120000_add_organisation_config/migration.sql +56 -56
  64. package/prisma/schema/migrations/20260514120000_dedupe_organisation_config/migration.sql +20 -20
  65. package/prisma/schema/migrations/20260515120000_add_interview_ai_assistance_mode/migration.sql +5 -5
  66. package/prisma/schema/migrations/20260626120000_add_evaluation_plan_share_scope/migration.sql +14 -0
  67. package/prisma/schema/migrations/20260626140000_add_evaluation_comment/migration.sql +2 -0
  68. package/prisma/schema/migrations/migration_lock.toml +3 -3
  69. package/prisma/schema/notes.prisma +19 -19
  70. package/prisma/schema/ongoingEvaluation.prisma +72 -72
  71. package/prisma/schema/organisation.prisma +57 -57
  72. package/prisma/schema/organisationConfig.prisma +12 -12
  73. package/prisma/schema/permission.prisma +13 -13
  74. package/prisma/schema/promise.prisma +39 -39
  75. package/prisma/schema/questions.prisma +28 -28
  76. package/prisma/schema/refreshToken.prisma +10 -10
  77. package/prisma/schema/resume.prisma +34 -34
  78. package/prisma/schema/resumeData.prisma +15 -15
  79. package/prisma/schema/schema.prisma +16 -16
  80. package/prisma/schema/suggestion.prisma +20 -20
  81. package/prisma/schema/transcript.prisma +25 -25
  82. package/prisma/schema/user.prisma +93 -93
  83. package/prisma/schema/userProfile.prisma +15 -15
  84. package/prisma/schema/zoomMeeting.prisma +79 -79
  85. package/prisma/.DS_Store +0 -0
  86. package/prisma/schema/migrations/20260519120000_interview_deadline/migration.sql +0 -2
  87. package/prisma/schema/migrations/20260520120000_interview_duration_drop_deadline/migration.sql +0 -30
  88. package/prisma/schema/migrations/20260602120000_resume_file_hash_drop_unique/migration.sql +0 -2
  89. package/prisma/schema/migrations/20260603120000_job_application_field_is_mandatory/migration.sql +0 -2
  90. package/prisma/schema/migrations/20260604120000_job_application_response_updated_by_organisation/migration.sql +0 -2
  91. package/prisma/schema/migrations/20260605120000_drop_document_application_id/migration.sql +0 -3
  92. package/prisma/schema/migrations/20260610120000_jaf_template_model/migration.sql +0 -70
  93. package/prisma/schema/migrations/20260610130000_assignment_document_fks/migration.sql +0 -15
  94. package/prisma/schema/migrations/20260610140000_jaf_draft_activation/migration.sql +0 -12
@@ -1,156 +1,156 @@
1
- // Multi-channel communication (WhatsApp, Email, SMS, Call) with provider abstraction.
2
- // Strategy: typed columns for everything stable; JSON only for genuinely variable data.
3
-
4
- enum CommChannel {
5
- WHATSAPP
6
- EMAIL
7
- SMS
8
- CALL
9
- }
10
-
11
- enum CommProvider {
12
- META_WHATSAPP
13
- TWILIO
14
- GUPSHUP
15
- MTALKZ
16
- THREE_SIXTY_DIALOG
17
- GMAIL
18
- OUTLOOK
19
- GENERIC_SMTP
20
- GENERIC
21
- }
22
-
23
- enum CommDirection {
24
- INBOUND
25
- OUTBOUND
26
- }
27
-
28
- enum CommMessageStatus {
29
- QUEUED
30
- SENT
31
- DELIVERED
32
- READ
33
- FAILED
34
- RECEIVED
35
- }
36
-
37
- /// Per-organisation provider selection + (encrypted) credentials for one channel.
38
- /// `metadata` stores non-secret provider settings (e.g. phone_number_id, waba_id, webhook_verify_token).
39
- model ChannelProviderConfig {
40
- id String @id @default(uuid())
41
- organisation_id String
42
- channel CommChannel
43
- provider CommProvider
44
- /// Encrypted JSON blob of secrets (token, app_secret, …) using integrationTokenCrypto.
45
- credentials String?
46
- metadata Json @default("{}")
47
- is_active Boolean @default(true)
48
- is_default Boolean @default(true)
49
-
50
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
51
-
52
- conversations Conversation[]
53
- messages CommunicationMessage[]
54
-
55
- created_at DateTime @default(now())
56
- updated_at DateTime @updatedAt
57
- created_by String
58
- updated_by String
59
-
60
- @@unique([organisation_id, channel, provider])
61
- @@index([organisation_id, channel])
62
- @@index([organisation_id, channel, is_active])
63
- }
64
-
65
- /// A logical conversation thread with one external party on one channel.
66
- /// `external_id` is the channel-native identifier (E.164 phone for WhatsApp/SMS, email address for email).
67
- ///
68
- /// `application_id` / `job_description_id` are the *current* recruiting scope
69
- /// the thread is bound to (the recruiter can switch context, but individual
70
- /// `CommunicationMessage` rows record the scope they were sent under so the
71
- /// audit trail is preserved). Both nullable so pre-application sourcing
72
- /// (no application yet, just a JD) still works.
73
- model Conversation {
74
- id String @id @default(uuid())
75
- organisation_id String
76
- channel CommChannel
77
- provider CommProvider
78
- channel_provider_id String?
79
- external_id String
80
- contact_user_id String?
81
- application_id String?
82
- job_description_id String?
83
- provider_thread_id String?
84
- subject String?
85
- status String @default("open")
86
- unread_count Int @default(0)
87
- last_message_at DateTime?
88
- metadata Json @default("{}")
89
-
90
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
91
- channel_provider ChannelProviderConfig? @relation(fields: [channel_provider_id], references: [id], onDelete: SetNull)
92
- application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull)
93
- job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
94
- messages CommunicationMessage[]
95
-
96
- created_at DateTime @default(now())
97
- updated_at DateTime @updatedAt
98
- created_by String
99
- updated_by String
100
-
101
- @@unique([organisation_id, channel, provider, external_id])
102
- @@index([organisation_id, channel])
103
- @@index([organisation_id, last_message_at])
104
- @@index([external_id])
105
- @@index([organisation_id, application_id])
106
- @@index([organisation_id, job_description_id])
107
- }
108
-
109
- /// Individual message in a conversation. Inbound + outbound share the same model.
110
- /// `body` is plain text. `attachments` is a JSON array of media descriptors (no binaries persisted).
111
- /// `metadata` stores raw provider payloads + interactive payloads for audit/debug.
112
- ///
113
- /// `application_id` / `job_description_id` are the recruiting scope this
114
- /// specific message was sent/received under, captured at the time of the
115
- /// event (not derived from the parent conversation, since a recruiter may
116
- /// reuse a thread across multiple applications). Both nullable.
117
- model CommunicationMessage {
118
- id String @id @default(uuid())
119
- conversation_id String
120
- organisation_id String
121
- channel CommChannel
122
- provider CommProvider
123
- channel_provider_id String?
124
- direction CommDirection
125
- status CommMessageStatus
126
- body String?
127
- from_identifier String
128
- to_identifier String
129
- sender_user_id String?
130
- application_id String?
131
- job_description_id String?
132
- provider_message_id String?
133
- template_name String?
134
- attachments Json @default("[]")
135
- metadata Json @default("{}")
136
- error String?
137
- sent_at DateTime?
138
- delivered_at DateTime?
139
- read_at DateTime?
140
-
141
- conversation Conversation @relation(fields: [conversation_id], references: [id], onDelete: Cascade)
142
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
143
- channel_provider ChannelProviderConfig? @relation(fields: [channel_provider_id], references: [id], onDelete: SetNull)
144
- application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull)
145
- job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
146
-
147
- created_at DateTime @default(now())
148
- updated_at DateTime @updatedAt
149
-
150
- @@unique([provider, provider_message_id])
151
- @@index([conversation_id, created_at])
152
- @@index([organisation_id, channel, created_at])
153
- @@index([organisation_id, status])
154
- @@index([organisation_id, application_id])
155
- @@index([organisation_id, job_description_id])
156
- }
1
+ // Multi-channel communication (WhatsApp, Email, SMS, Call) with provider abstraction.
2
+ // Strategy: typed columns for everything stable; JSON only for genuinely variable data.
3
+
4
+ enum CommChannel {
5
+ WHATSAPP
6
+ EMAIL
7
+ SMS
8
+ CALL
9
+ }
10
+
11
+ enum CommProvider {
12
+ META_WHATSAPP
13
+ TWILIO
14
+ GUPSHUP
15
+ MTALKZ
16
+ THREE_SIXTY_DIALOG
17
+ GMAIL
18
+ OUTLOOK
19
+ GENERIC_SMTP
20
+ GENERIC
21
+ }
22
+
23
+ enum CommDirection {
24
+ INBOUND
25
+ OUTBOUND
26
+ }
27
+
28
+ enum CommMessageStatus {
29
+ QUEUED
30
+ SENT
31
+ DELIVERED
32
+ READ
33
+ FAILED
34
+ RECEIVED
35
+ }
36
+
37
+ /// Per-organisation provider selection + (encrypted) credentials for one channel.
38
+ /// `metadata` stores non-secret provider settings (e.g. phone_number_id, waba_id, webhook_verify_token).
39
+ model ChannelProviderConfig {
40
+ id String @id @default(uuid())
41
+ organisation_id String
42
+ channel CommChannel
43
+ provider CommProvider
44
+ /// Encrypted JSON blob of secrets (token, app_secret, …) using integrationTokenCrypto.
45
+ credentials String?
46
+ metadata Json @default("{}")
47
+ is_active Boolean @default(true)
48
+ is_default Boolean @default(true)
49
+
50
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
51
+
52
+ conversations Conversation[]
53
+ messages CommunicationMessage[]
54
+
55
+ created_at DateTime @default(now())
56
+ updated_at DateTime @updatedAt
57
+ created_by String
58
+ updated_by String
59
+
60
+ @@unique([organisation_id, channel, provider])
61
+ @@index([organisation_id, channel])
62
+ @@index([organisation_id, channel, is_active])
63
+ }
64
+
65
+ /// A logical conversation thread with one external party on one channel.
66
+ /// `external_id` is the channel-native identifier (E.164 phone for WhatsApp/SMS, email address for email).
67
+ ///
68
+ /// `application_id` / `job_description_id` are the *current* recruiting scope
69
+ /// the thread is bound to (the recruiter can switch context, but individual
70
+ /// `CommunicationMessage` rows record the scope they were sent under so the
71
+ /// audit trail is preserved). Both nullable so pre-application sourcing
72
+ /// (no application yet, just a JD) still works.
73
+ model Conversation {
74
+ id String @id @default(uuid())
75
+ organisation_id String
76
+ channel CommChannel
77
+ provider CommProvider
78
+ channel_provider_id String?
79
+ external_id String
80
+ contact_user_id String?
81
+ application_id String?
82
+ job_description_id String?
83
+ provider_thread_id String?
84
+ subject String?
85
+ status String @default("open")
86
+ unread_count Int @default(0)
87
+ last_message_at DateTime?
88
+ metadata Json @default("{}")
89
+
90
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
91
+ channel_provider ChannelProviderConfig? @relation(fields: [channel_provider_id], references: [id], onDelete: SetNull)
92
+ application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull)
93
+ job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
94
+ messages CommunicationMessage[]
95
+
96
+ created_at DateTime @default(now())
97
+ updated_at DateTime @updatedAt
98
+ created_by String
99
+ updated_by String
100
+
101
+ @@unique([organisation_id, channel, provider, external_id])
102
+ @@index([organisation_id, channel])
103
+ @@index([organisation_id, last_message_at])
104
+ @@index([external_id])
105
+ @@index([organisation_id, application_id])
106
+ @@index([organisation_id, job_description_id])
107
+ }
108
+
109
+ /// Individual message in a conversation. Inbound + outbound share the same model.
110
+ /// `body` is plain text. `attachments` is a JSON array of media descriptors (no binaries persisted).
111
+ /// `metadata` stores raw provider payloads + interactive payloads for audit/debug.
112
+ ///
113
+ /// `application_id` / `job_description_id` are the recruiting scope this
114
+ /// specific message was sent/received under, captured at the time of the
115
+ /// event (not derived from the parent conversation, since a recruiter may
116
+ /// reuse a thread across multiple applications). Both nullable.
117
+ model CommunicationMessage {
118
+ id String @id @default(uuid())
119
+ conversation_id String
120
+ organisation_id String
121
+ channel CommChannel
122
+ provider CommProvider
123
+ channel_provider_id String?
124
+ direction CommDirection
125
+ status CommMessageStatus
126
+ body String?
127
+ from_identifier String
128
+ to_identifier String
129
+ sender_user_id String?
130
+ application_id String?
131
+ job_description_id String?
132
+ provider_message_id String?
133
+ template_name String?
134
+ attachments Json @default("[]")
135
+ metadata Json @default("{}")
136
+ error String?
137
+ sent_at DateTime?
138
+ delivered_at DateTime?
139
+ read_at DateTime?
140
+
141
+ conversation Conversation @relation(fields: [conversation_id], references: [id], onDelete: Cascade)
142
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
143
+ channel_provider ChannelProviderConfig? @relation(fields: [channel_provider_id], references: [id], onDelete: SetNull)
144
+ application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull)
145
+ job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
146
+
147
+ created_at DateTime @default(now())
148
+ updated_at DateTime @updatedAt
149
+
150
+ @@unique([provider, provider_message_id])
151
+ @@index([conversation_id, created_at])
152
+ @@index([organisation_id, channel, created_at])
153
+ @@index([organisation_id, status])
154
+ @@index([organisation_id, application_id])
155
+ @@index([organisation_id, job_description_id])
156
+ }
@@ -1,12 +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
- }
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
+ }
@@ -1,37 +1,37 @@
1
- model Document {
2
- // Primary key
3
- id String @id @default(uuid())
4
- // Foreign keys
5
- organisation_id String?
6
- candidate_id String?
7
- // Data fields
8
- original_file_name String
9
- stored_file_name String
10
- file_extension String?
11
- s3_bucket String?
12
- s3_key String?
13
- mime_type String?
14
- file_size BigInt?
15
- file_hash String?
16
- metadata Json?
17
- // Audit fields
18
- created_at DateTime @default(now())
19
- updated_at DateTime @updatedAt
20
- created_by String
21
- updated_by String
22
- is_active Boolean @default(true)
23
- // Relations
24
- organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
25
- candidate User? @relation(fields: [candidate_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
26
- resume Resume?
27
- job_description_source JobDescription?
28
- interview_recording Interview?
29
- job_application_responses JobApplicationResponse[]
30
- assignment_solution Assignment? @relation("AssignmentSolutionDocument")
31
- assignment_zip Assignment? @relation("AssignmentZipDocument")
32
-
33
- // Indexes
34
- @@index([candidate_id])
35
- @@index([organisation_id, candidate_id])
36
- @@index([file_hash])
37
- }
1
+ model Document {
2
+ // Primary key
3
+ id String @id @default(uuid())
4
+ // Foreign keys
5
+ organisation_id String?
6
+ candidate_id String?
7
+ // Data fields
8
+ original_file_name String
9
+ stored_file_name String
10
+ file_extension String?
11
+ s3_bucket String?
12
+ s3_key String?
13
+ mime_type String?
14
+ file_size BigInt?
15
+ file_hash String?
16
+ metadata Json?
17
+ // Audit fields
18
+ created_at DateTime @default(now())
19
+ updated_at DateTime @updatedAt
20
+ created_by String
21
+ updated_by String
22
+ is_active Boolean @default(true)
23
+ // Relations
24
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
25
+ candidate User? @relation(fields: [candidate_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
26
+ resume Resume?
27
+ job_description_source JobDescription?
28
+ interview_recording Interview?
29
+ job_application_responses JobApplicationResponse[]
30
+ assignment_solution Assignment? @relation("AssignmentSolutionDocument")
31
+ assignment_zip Assignment? @relation("AssignmentZipDocument")
32
+
33
+ // Indexes
34
+ @@index([candidate_id])
35
+ @@index([organisation_id, candidate_id])
36
+ @@index([file_hash])
37
+ }
@@ -1,93 +1,102 @@
1
- enum RoundType {
2
- ASSESSMENT
3
- INTERVIEW
4
- ASSIGNMENT
5
- SCREENING
6
- }
7
-
8
- enum EvaluationRoundFormat {
9
- // ────────────────
10
- // Screening formats
11
- // ────────────────
12
- PHONE_CALL
13
- VIDEO_CALL_AI_ASSISTED
14
- VIDEO_CALL_UNASSISTED
15
-
16
- // ────────────────
17
- // Assessment formats
18
- // ────────────────
19
- AI_GENERATED_TEST
20
- UPLOADED_TEST
21
- EXTERNAL_PLATFORM
22
-
23
- // ────────────────
24
- // Assignment formats
25
- // ────────────────
26
- AI_GENERATED_ASSIGNMENT
27
- UPLOADED_ASSIGNMENT
28
-
29
- // ────────────────
30
- // Interview formats
31
- // ────────────────
32
- TREADSPACE_AI_ASSISTED
33
- EXTERNAL_VIDEO_AI_ASSISTED
34
- EXTERNAL_VIDEO_UNASSISTED
35
- }
36
-
37
- enum EvaluationType {
38
- // New (In active use now)
39
- TREADSPACE_AI_ASSISTED
40
- TREADSPACE_FULL_AI
41
- EXTERNAL_AI_ASSISTED
42
- NON_AI_ASSISTED
43
- }
44
-
1
+ enum RoundType {
2
+ ASSESSMENT
3
+ INTERVIEW
4
+ ASSIGNMENT
5
+ SCREENING
6
+ }
7
+
8
+ enum EvaluationRoundFormat {
9
+ // ────────────────
10
+ // Screening formats
11
+ // ────────────────
12
+ PHONE_CALL
13
+ VIDEO_CALL_AI_ASSISTED
14
+ VIDEO_CALL_UNASSISTED
15
+
16
+ // ────────────────
17
+ // Assessment formats
18
+ // ────────────────
19
+ AI_GENERATED_TEST
20
+ UPLOADED_TEST
21
+ EXTERNAL_PLATFORM
22
+
23
+ // ────────────────
24
+ // Assignment formats
25
+ // ────────────────
26
+ AI_GENERATED_ASSIGNMENT
27
+ UPLOADED_ASSIGNMENT
28
+
29
+ // ────────────────
30
+ // Interview formats
31
+ // ────────────────
32
+ TREADSPACE_AI_ASSISTED
33
+ EXTERNAL_VIDEO_AI_ASSISTED
34
+ EXTERNAL_VIDEO_UNASSISTED
35
+ }
36
+
37
+ enum EvaluationType {
38
+ // New (In active use now)
39
+ TREADSPACE_AI_ASSISTED
40
+ TREADSPACE_FULL_AI
41
+ EXTERNAL_AI_ASSISTED
42
+ NON_AI_ASSISTED
43
+ }
44
+
45
45
  enum EvaluationPlanType {
46
46
  CUSTOM
47
47
  GENERIC
48
48
  DELETED
49
49
  }
50
50
 
51
+ enum EvaluationPlanShareScope {
52
+ PRIVATE
53
+ CREATOR
54
+ ORGANIZATION
55
+ }
56
+
51
57
  enum DurationUnit {
52
58
  MINUTES
53
59
  HOURS
54
60
  DAYS
55
61
  }
56
-
57
- model EvaluationPlan {
58
- id String @id @default(uuid())
59
- job_description_id String
60
- assessment_id String?
61
- assignment_library_id String?
62
- title String
63
- description String?
64
- format EvaluationRoundFormat?
65
- topics String[]
66
- assignee String?
67
- elimination_round Boolean @default(false)
68
- evaluation_type EvaluationType @default(TREADSPACE_AI_ASSISTED)
69
- type_of_round RoundType
70
- timeline Int?
71
- order_no Int?
62
+
63
+ model EvaluationPlan {
64
+ id String @id @default(uuid())
65
+ job_description_id String
66
+ assessment_id String?
67
+ assignment_library_id String?
68
+ title String
69
+ description String?
70
+ format EvaluationRoundFormat?
71
+ topics String[]
72
+ assignee String?
73
+ elimination_round Boolean @default(false)
74
+ evaluation_type EvaluationType @default(TREADSPACE_AI_ASSISTED)
75
+ type_of_round RoundType
76
+ timeline Int?
77
+ order_no Int?
72
78
  details Json?
73
79
  plan_type EvaluationPlanType @default(GENERIC)
80
+ share_scope EvaluationPlanShareScope @default(PRIVATE)
74
81
  duration Int?
75
82
  duration_unit DurationUnit?
76
83
  deadline Int?
77
- created_by String
78
- updated_by String
79
- created_at DateTime @default(now())
80
- updated_at DateTime @updatedAt
81
- is_active Boolean @default(true)
82
- // Relations
83
- jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade)
84
- questions Question[] // One evaluation plan → many questions
85
- interviews Interview[]
86
- applications Application[]
87
- // New optional one-to-one relation with AssessmentLibrary
88
- assessment AssessmentLibrary? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
89
- assignment_library AssignmentLibrary? @relation(fields: [assignment_library_id], references: [id], onDelete: SetNull)
90
- ongoing_evaluations OngoingEvaluation[]
84
+ created_by String
85
+ updated_by String
86
+ created_at DateTime @default(now())
87
+ updated_at DateTime @updatedAt
88
+ is_active Boolean @default(true)
89
+ // Relations
90
+ jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade)
91
+ questions Question[] // One evaluation plan → many questions
92
+ interviews Interview[]
93
+ applications Application[]
94
+ // New optional one-to-one relation with AssessmentLibrary
95
+ assessment AssessmentLibrary? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
96
+ assignment_library AssignmentLibrary? @relation(fields: [assignment_library_id], references: [id], onDelete: SetNull)
97
+ ongoing_evaluations OngoingEvaluation[]
91
98
 
92
99
  @@index([job_description_id])
100
+ @@index([job_description_id, plan_type, share_scope])
101
+ @@index([created_by, share_scope])
93
102
  }
@@ -1,18 +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
- }
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
+ }