@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.
- package/README.md +15 -15
- package/bin/db-cli.js +91 -91
- package/client/edge.js +16 -8
- package/client/index-browser.js +8 -0
- package/client/index.d.ts +232 -7
- package/client/index.js +22 -14
- package/client/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
- package/client/package.json +1 -1
- package/client/{libquery_engine-darwin-arm64.dylib.node → query_engine-windows.dll.node} +0 -0
- package/client/schema.prisma +20 -10
- package/client/wasm.js +16 -8
- package/package.json +58 -58
- package/prisma/schema/CandidateQuestionResponse.prisma +24 -24
- package/prisma/schema/UserRole.prisma +20 -20
- package/prisma/schema/action.prisma +35 -35
- package/prisma/schema/activityLog.prisma +22 -22
- package/prisma/schema/applications.prisma +57 -56
- package/prisma/schema/approval.prisma +14 -14
- package/prisma/schema/assessment.prisma +39 -39
- package/prisma/schema/assessmentLibrary.prisma +21 -21
- package/prisma/schema/assessmentQuestion.prisma +17 -17
- package/prisma/schema/assignment.prisma +48 -48
- package/prisma/schema/assignmentLibrary.prisma +20 -20
- package/prisma/schema/authModule.prisma +36 -36
- package/prisma/schema/budget.prisma +38 -38
- package/prisma/schema/calendly.prisma +18 -18
- package/prisma/schema/candidateProfile.prisma +26 -26
- package/prisma/schema/communication.prisma +156 -156
- package/prisma/schema/contactUs.prisma +12 -12
- package/prisma/schema/document.prisma +37 -37
- package/prisma/schema/evaluationPlan.prisma +83 -74
- package/prisma/schema/feedback.prisma +18 -18
- package/prisma/schema/fitCheck.prisma +58 -58
- package/prisma/schema/google.prisma +16 -16
- package/prisma/schema/integration.prisma +98 -98
- package/prisma/schema/interview.prisma +112 -112
- package/prisma/schema/interviewNotes.prisma +17 -17
- package/prisma/schema/jobApplicationFields.prisma +37 -37
- package/prisma/schema/jobApplicationResponse.prisma +33 -33
- package/prisma/schema/jobApplicationTemplate.prisma +30 -30
- package/prisma/schema/jobDescription.prisma +57 -57
- package/prisma/schema/jobDescriptionData.prisma +15 -15
- package/prisma/schema/jobProfile.prisma +56 -56
- package/prisma/schema/liveAnalysis.prisma +17 -17
- package/prisma/schema/message.prisma +15 -15
- package/prisma/schema/migrations/20260415120000_remove_job_profile_current_phase/migration.sql +2 -2
- package/prisma/schema/migrations/20260422120000_add_integration_provider_zoom/migration.sql +2 -2
- package/prisma/schema/migrations/20260422140000_add_zoom_meeting_tables/migration.sql +57 -57
- package/prisma/schema/migrations/20260422180000_add_zoom_webhook_event/migration.sql +18 -18
- package/prisma/schema/migrations/20260423140000_add_interview_platform/migration.sql +6 -6
- package/prisma/schema/migrations/20260423150000_remove_interview_zoom_topic/migration.sql +2 -2
- package/prisma/schema/migrations/20260423160000_zoom_meeting_uuid/migration.sql +4 -4
- package/prisma/schema/migrations/20260423170000_zoom_meeting_uuid_prisma_sync/migration.sql +2 -2
- package/prisma/schema/migrations/20260424120000_auth_module_user_provider_unique/migration.sql +5 -5
- package/prisma/schema/migrations/20260424130000_zoom_meeting_zoom_host_user_id/migration.sql +6 -6
- package/prisma/schema/migrations/20260425100000_zoom_participant_user_enum/migration.sql +22 -22
- package/prisma/schema/migrations/20260425110000_zoom_participant_zoom_id_required/migration.sql +13 -13
- package/prisma/schema/migrations/20260425120000_zoom_participant_id_nullable/migration.sql +4 -4
- package/prisma/schema/migrations/20260429140000_drop_evaluation_plan_job_order_unique/migration.sql +5 -5
- package/prisma/schema/migrations/20260429180000_eval_plan_timeline_optional_ongoing_duration/migration.sql +15 -15
- package/prisma/schema/migrations/20260430120000_drop_assessment_library_metadata_fields/migration.sql +8 -8
- package/prisma/schema/migrations/20260430140000_drop_question_question_type/migration.sql +5 -5
- package/prisma/schema/migrations/20260513120000_add_organisation_config/migration.sql +56 -56
- package/prisma/schema/migrations/20260514120000_dedupe_organisation_config/migration.sql +20 -20
- package/prisma/schema/migrations/20260515120000_add_interview_ai_assistance_mode/migration.sql +5 -5
- package/prisma/schema/migrations/20260626120000_add_evaluation_plan_share_scope/migration.sql +14 -0
- package/prisma/schema/migrations/20260626140000_add_evaluation_comment/migration.sql +2 -0
- package/prisma/schema/migrations/migration_lock.toml +3 -3
- package/prisma/schema/notes.prisma +19 -19
- package/prisma/schema/ongoingEvaluation.prisma +72 -72
- package/prisma/schema/organisation.prisma +57 -57
- package/prisma/schema/organisationConfig.prisma +12 -12
- package/prisma/schema/permission.prisma +13 -13
- package/prisma/schema/promise.prisma +39 -39
- package/prisma/schema/questions.prisma +28 -28
- package/prisma/schema/refreshToken.prisma +10 -10
- package/prisma/schema/resume.prisma +34 -34
- package/prisma/schema/resumeData.prisma +15 -15
- package/prisma/schema/schema.prisma +16 -16
- package/prisma/schema/suggestion.prisma +20 -20
- package/prisma/schema/transcript.prisma +25 -25
- package/prisma/schema/user.prisma +93 -93
- package/prisma/schema/userProfile.prisma +15 -15
- package/prisma/schema/zoomMeeting.prisma +79 -79
- package/prisma/.DS_Store +0 -0
- package/prisma/schema/migrations/20260519120000_interview_deadline/migration.sql +0 -2
- package/prisma/schema/migrations/20260520120000_interview_duration_drop_deadline/migration.sql +0 -30
- package/prisma/schema/migrations/20260602120000_resume_file_hash_drop_unique/migration.sql +0 -2
- package/prisma/schema/migrations/20260603120000_job_application_field_is_mandatory/migration.sql +0 -2
- package/prisma/schema/migrations/20260604120000_job_application_response_updated_by_organisation/migration.sql +0 -2
- package/prisma/schema/migrations/20260605120000_drop_document_application_id/migration.sql +0 -3
- package/prisma/schema/migrations/20260610120000_jaf_template_model/migration.sql +0 -70
- package/prisma/schema/migrations/20260610130000_assignment_document_fks/migration.sql +0 -15
- package/prisma/schema/migrations/20260610140000_jaf_draft_activation/migration.sql +0 -12
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
model Transcript {
|
|
2
|
-
id String @id @default(uuid())
|
|
3
|
-
interview_id String?
|
|
4
|
-
suggestion_id String?
|
|
5
|
-
intermediate_feedback_id String?
|
|
6
|
-
job_description_id String?
|
|
7
|
-
interviewer_timestamp DateTime?
|
|
8
|
-
candidate_timestamp DateTime?
|
|
9
|
-
interviewer String
|
|
10
|
-
candidate String
|
|
11
|
-
order_no Int @default(autoincrement())
|
|
12
|
-
created_at DateTime @default(now())
|
|
13
|
-
updated_at DateTime @updatedAt
|
|
14
|
-
created_by String
|
|
15
|
-
updated_by String
|
|
16
|
-
is_active Boolean @default(true)
|
|
17
|
-
// Relations
|
|
18
|
-
interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: SetNull)
|
|
19
|
-
suggestion Suggestion? @relation(fields: [suggestion_id], references: [id], onDelete: SetNull)
|
|
20
|
-
job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
21
|
-
|
|
22
|
-
@@unique([interview_id, order_no])
|
|
23
|
-
@@index([interview_id])
|
|
24
|
-
@@index([job_description_id])
|
|
25
|
-
}
|
|
1
|
+
model Transcript {
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
interview_id String?
|
|
4
|
+
suggestion_id String?
|
|
5
|
+
intermediate_feedback_id String?
|
|
6
|
+
job_description_id String?
|
|
7
|
+
interviewer_timestamp DateTime?
|
|
8
|
+
candidate_timestamp DateTime?
|
|
9
|
+
interviewer String
|
|
10
|
+
candidate String
|
|
11
|
+
order_no Int @default(autoincrement())
|
|
12
|
+
created_at DateTime @default(now())
|
|
13
|
+
updated_at DateTime @updatedAt
|
|
14
|
+
created_by String
|
|
15
|
+
updated_by String
|
|
16
|
+
is_active Boolean @default(true)
|
|
17
|
+
// Relations
|
|
18
|
+
interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: SetNull)
|
|
19
|
+
suggestion Suggestion? @relation(fields: [suggestion_id], references: [id], onDelete: SetNull)
|
|
20
|
+
job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
21
|
+
|
|
22
|
+
@@unique([interview_id, order_no])
|
|
23
|
+
@@index([interview_id])
|
|
24
|
+
@@index([job_description_id])
|
|
25
|
+
}
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
enum FirstLoginStatus {
|
|
2
|
-
PENDING
|
|
3
|
-
COMPLETED
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
enum UserInvitationStatus {
|
|
7
|
-
INVITED
|
|
8
|
-
ACCEPTED
|
|
9
|
-
EXPIRED
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
model User {
|
|
13
|
-
id String @id @default(uuid())
|
|
14
|
-
email String @unique
|
|
15
|
-
password String
|
|
16
|
-
role_id String
|
|
17
|
-
role UserRole @relation(fields: [role_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
|
|
18
|
-
organisation_id String?
|
|
19
|
-
// Back-relations are defined from Resume side via user_id
|
|
20
|
-
google_id String? @unique
|
|
21
|
-
refresh_token String?
|
|
22
|
-
created_at DateTime @default(now())
|
|
23
|
-
updated_at DateTime @updatedAt
|
|
24
|
-
created_by String
|
|
25
|
-
updated_by String
|
|
26
|
-
is_active Boolean @default(true)
|
|
27
|
-
is_self_registered Boolean @default(true)
|
|
28
|
-
permission_id String? @unique
|
|
29
|
-
preferences Json? @default("{}")
|
|
30
|
-
invitation_status UserInvitationStatus @default(INVITED)
|
|
31
|
-
invited_at DateTime? @default(now())
|
|
32
|
-
invitation_expires_at DateTime?
|
|
33
|
-
invitation_accepted_at DateTime?
|
|
34
|
-
permission Permission? @relation(fields: [permission_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
35
|
-
organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
36
|
-
applications Application[]
|
|
37
|
-
resume Resume[]
|
|
38
|
-
candidate_profile CandidateProfile?
|
|
39
|
-
user_profile UserProfile?
|
|
40
|
-
job_description JobDescription[]
|
|
41
|
-
hiring_manager_job_descriptions JobDescription[] @relation("HiringManager")
|
|
42
|
-
hiring_manager_job_profiles JobProfile[] @relation("JobProfileHiringManager")
|
|
43
|
-
approvals Approval[]
|
|
44
|
-
sent_messages Message[] @relation("Sent Messages")
|
|
45
|
-
received_messages Message[] @relation("Received Messages")
|
|
46
|
-
profile_created Boolean
|
|
47
|
-
first_login_status FirstLoginStatus @default(PENDING)
|
|
48
|
-
// Back-relations for interviews (optional but recommended for clarity)
|
|
49
|
-
candidate_interviews Interview[] @relation("CandidateInterviews")
|
|
50
|
-
interviewer_interviews Interview[] @relation("InterviewerInterviews")
|
|
51
|
-
assessment_results Assessment[]
|
|
52
|
-
candidate_assessments Assessment[] @relation("CandidateAssessments")
|
|
53
|
-
reviewer_assessments Assessment[] @relation("ReviewerAssessments")
|
|
54
|
-
candidate_assignments Assignment[] @relation("CandidateAssignments")
|
|
55
|
-
reviewer_assignments Assignment[] @relation("AssignmentReviewer")
|
|
56
|
-
candidateResponses CandidateQuestionResponse[]
|
|
57
|
-
questions Question[]
|
|
58
|
-
ongoing_evaluations OngoingEvaluation[] // optional one-to-many
|
|
59
|
-
actor_activity_logs ActivityLog[] @relation("ActorActivityLogs")
|
|
60
|
-
actions Action[]
|
|
61
|
-
calendly Calendly?
|
|
62
|
-
google Google?
|
|
63
|
-
fitChecks FitCheck[]
|
|
64
|
-
created_job_profiles JobProfile[] @relation("ProfileCreator")
|
|
65
|
-
assigned_job_profiles JobProfile[] @relation("ProfileAssignee")
|
|
66
|
-
user_auth_modules AuthModule[] @relation("UserAuthModule")
|
|
67
|
-
refresh_token_auth RefreshToken[] @relation("TokenRefresh")
|
|
68
|
-
zoom_meeting_participants ZoomMeetingParticipant[]
|
|
69
|
-
notes Notes[]
|
|
70
|
-
|
|
71
|
-
name String?
|
|
72
|
-
phone String?
|
|
73
|
-
description String?
|
|
74
|
-
date_of_birth DateTime?
|
|
75
|
-
designation String?
|
|
76
|
-
location String?
|
|
77
|
-
salary String?
|
|
78
|
-
work_experience Json?
|
|
79
|
-
education Json?
|
|
80
|
-
skills Json?
|
|
81
|
-
notice_period String?
|
|
82
|
-
preferred_work_mode String?
|
|
83
|
-
gender String?
|
|
84
|
-
ethnicity String?
|
|
85
|
-
veteran_status String?
|
|
86
|
-
disability_status String?
|
|
87
|
-
professional_expertise String?
|
|
88
|
-
documents Document[]
|
|
89
|
-
|
|
90
|
-
@@index([role_id])
|
|
91
|
-
@@index([permission_id])
|
|
92
|
-
@@index([organisation_id])
|
|
93
|
-
}
|
|
1
|
+
enum FirstLoginStatus {
|
|
2
|
+
PENDING
|
|
3
|
+
COMPLETED
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
enum UserInvitationStatus {
|
|
7
|
+
INVITED
|
|
8
|
+
ACCEPTED
|
|
9
|
+
EXPIRED
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
model User {
|
|
13
|
+
id String @id @default(uuid())
|
|
14
|
+
email String @unique
|
|
15
|
+
password String
|
|
16
|
+
role_id String
|
|
17
|
+
role UserRole @relation(fields: [role_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
|
|
18
|
+
organisation_id String?
|
|
19
|
+
// Back-relations are defined from Resume side via user_id
|
|
20
|
+
google_id String? @unique
|
|
21
|
+
refresh_token String?
|
|
22
|
+
created_at DateTime @default(now())
|
|
23
|
+
updated_at DateTime @updatedAt
|
|
24
|
+
created_by String
|
|
25
|
+
updated_by String
|
|
26
|
+
is_active Boolean @default(true)
|
|
27
|
+
is_self_registered Boolean @default(true)
|
|
28
|
+
permission_id String? @unique
|
|
29
|
+
preferences Json? @default("{}")
|
|
30
|
+
invitation_status UserInvitationStatus @default(INVITED)
|
|
31
|
+
invited_at DateTime? @default(now())
|
|
32
|
+
invitation_expires_at DateTime?
|
|
33
|
+
invitation_accepted_at DateTime?
|
|
34
|
+
permission Permission? @relation(fields: [permission_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
35
|
+
organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
36
|
+
applications Application[]
|
|
37
|
+
resume Resume[]
|
|
38
|
+
candidate_profile CandidateProfile?
|
|
39
|
+
user_profile UserProfile?
|
|
40
|
+
job_description JobDescription[]
|
|
41
|
+
hiring_manager_job_descriptions JobDescription[] @relation("HiringManager")
|
|
42
|
+
hiring_manager_job_profiles JobProfile[] @relation("JobProfileHiringManager")
|
|
43
|
+
approvals Approval[]
|
|
44
|
+
sent_messages Message[] @relation("Sent Messages")
|
|
45
|
+
received_messages Message[] @relation("Received Messages")
|
|
46
|
+
profile_created Boolean
|
|
47
|
+
first_login_status FirstLoginStatus @default(PENDING)
|
|
48
|
+
// Back-relations for interviews (optional but recommended for clarity)
|
|
49
|
+
candidate_interviews Interview[] @relation("CandidateInterviews")
|
|
50
|
+
interviewer_interviews Interview[] @relation("InterviewerInterviews")
|
|
51
|
+
assessment_results Assessment[]
|
|
52
|
+
candidate_assessments Assessment[] @relation("CandidateAssessments")
|
|
53
|
+
reviewer_assessments Assessment[] @relation("ReviewerAssessments")
|
|
54
|
+
candidate_assignments Assignment[] @relation("CandidateAssignments")
|
|
55
|
+
reviewer_assignments Assignment[] @relation("AssignmentReviewer")
|
|
56
|
+
candidateResponses CandidateQuestionResponse[]
|
|
57
|
+
questions Question[]
|
|
58
|
+
ongoing_evaluations OngoingEvaluation[] // optional one-to-many
|
|
59
|
+
actor_activity_logs ActivityLog[] @relation("ActorActivityLogs")
|
|
60
|
+
actions Action[]
|
|
61
|
+
calendly Calendly?
|
|
62
|
+
google Google?
|
|
63
|
+
fitChecks FitCheck[]
|
|
64
|
+
created_job_profiles JobProfile[] @relation("ProfileCreator")
|
|
65
|
+
assigned_job_profiles JobProfile[] @relation("ProfileAssignee")
|
|
66
|
+
user_auth_modules AuthModule[] @relation("UserAuthModule")
|
|
67
|
+
refresh_token_auth RefreshToken[] @relation("TokenRefresh")
|
|
68
|
+
zoom_meeting_participants ZoomMeetingParticipant[]
|
|
69
|
+
notes Notes[]
|
|
70
|
+
|
|
71
|
+
name String?
|
|
72
|
+
phone String?
|
|
73
|
+
description String?
|
|
74
|
+
date_of_birth DateTime?
|
|
75
|
+
designation String?
|
|
76
|
+
location String?
|
|
77
|
+
salary String?
|
|
78
|
+
work_experience Json?
|
|
79
|
+
education Json?
|
|
80
|
+
skills Json?
|
|
81
|
+
notice_period String?
|
|
82
|
+
preferred_work_mode String?
|
|
83
|
+
gender String?
|
|
84
|
+
ethnicity String?
|
|
85
|
+
veteran_status String?
|
|
86
|
+
disability_status String?
|
|
87
|
+
professional_expertise String?
|
|
88
|
+
documents Document[]
|
|
89
|
+
|
|
90
|
+
@@index([role_id])
|
|
91
|
+
@@index([permission_id])
|
|
92
|
+
@@index([organisation_id])
|
|
93
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
model UserProfile {
|
|
2
|
-
id String @id @default(uuid())
|
|
3
|
-
created_at DateTime @default(now())
|
|
4
|
-
updated_at DateTime @updatedAt
|
|
5
|
-
name String
|
|
6
|
-
phone String
|
|
7
|
-
description String
|
|
8
|
-
date_of_birth String
|
|
9
|
-
designation String
|
|
10
|
-
is_active Boolean @default(true)
|
|
11
|
-
user User? @relation(fields: [user_id], references: [id])
|
|
12
|
-
user_id String? @unique
|
|
13
|
-
|
|
14
|
-
work_experience Json?
|
|
15
|
-
}
|
|
1
|
+
model UserProfile {
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
created_at DateTime @default(now())
|
|
4
|
+
updated_at DateTime @updatedAt
|
|
5
|
+
name String
|
|
6
|
+
phone String
|
|
7
|
+
description String
|
|
8
|
+
date_of_birth String
|
|
9
|
+
designation String
|
|
10
|
+
is_active Boolean @default(true)
|
|
11
|
+
user User? @relation(fields: [user_id], references: [id])
|
|
12
|
+
user_id String? @unique
|
|
13
|
+
|
|
14
|
+
work_experience Json?
|
|
15
|
+
}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
/// Expected attendee slot when persisting interview-linked Zoom participants (`CANDIDATE` | `INTERVIEWER`).
|
|
2
|
-
enum ZoomMeetingParticipantRole {
|
|
3
|
-
CANDIDATE
|
|
4
|
-
INTERVIEWER
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/// Zoom meeting linked 1:1 to an interview; Zoom REST host is `zoom_host_user_id`.
|
|
8
|
-
model ZoomMeeting {
|
|
9
|
-
id String @id @default(uuid())
|
|
10
|
-
/// One Zoom row per interview.
|
|
11
|
-
interview_id String @unique
|
|
12
|
-
interview Interview @relation(fields: [interview_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
13
|
-
|
|
14
|
-
/// Treadspace user id whose Zoom User-OAuth token created this meeting; required for PATCH/DELETE on Zoom REST.
|
|
15
|
-
/// Set from the Zoom host `userId` in `ZoomMeetingDAO.upsertZoomParticipants` (same user as `POST /users/me/meetings`).
|
|
16
|
-
zoom_host_user_id String
|
|
17
|
-
|
|
18
|
-
/// Zoom REST/API meeting id (same value used as Meeting SDK `meetingNumber` / JWT `mn`).
|
|
19
|
-
zoom_meeting_id String
|
|
20
|
-
/// Zoom meeting **instance** UUID from REST create (`uuid`) and RTMS/webhooks (`meeting_uuid`).
|
|
21
|
-
zoom_meeting_uuid String?
|
|
22
|
-
join_url String
|
|
23
|
-
start_url String?
|
|
24
|
-
password String?
|
|
25
|
-
topic String?
|
|
26
|
-
|
|
27
|
-
scheduled_start_time DateTime?
|
|
28
|
-
scheduled_end_time DateTime?
|
|
29
|
-
|
|
30
|
-
is_active Boolean @default(true)
|
|
31
|
-
|
|
32
|
-
created_at DateTime @default(now())
|
|
33
|
-
updated_at DateTime @updatedAt
|
|
34
|
-
/// Audit; kept aligned with `zoom_host_user_id` when the meeting is recreated under a new host.
|
|
35
|
-
created_by String
|
|
36
|
-
updated_by String
|
|
37
|
-
|
|
38
|
-
participants ZoomMeetingParticipant[]
|
|
39
|
-
|
|
40
|
-
@@index([interview_id])
|
|
41
|
-
@@index([zoom_meeting_id])
|
|
42
|
-
@@index([zoom_meeting_uuid])
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/// Expected participants for a `ZoomMeeting`: links to `User` (candidate / interviewer). Replaced on each meeting upsert.
|
|
46
|
-
model ZoomMeetingParticipant {
|
|
47
|
-
id String @id @default(uuid())
|
|
48
|
-
zoom_meeting_row_id String
|
|
49
|
-
zoom_meeting ZoomMeeting @relation(fields: [zoom_meeting_row_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
50
|
-
user_id String
|
|
51
|
-
user User @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
52
|
-
/// Zoom account id (`AuthModule.provider_account_id`) when this `user_id` has linked Zoom; usually set for interviewer, often null for candidate.
|
|
53
|
-
zoom_participant_id String?
|
|
54
|
-
role ZoomMeetingParticipantRole
|
|
55
|
-
|
|
56
|
-
is_active Boolean @default(true)
|
|
57
|
-
|
|
58
|
-
created_at DateTime @default(now())
|
|
59
|
-
updated_at DateTime @updatedAt
|
|
60
|
-
created_by String
|
|
61
|
-
updated_by String
|
|
62
|
-
|
|
63
|
-
@@index([zoom_meeting_row_id])
|
|
64
|
-
@@index([user_id])
|
|
65
|
-
@@index([zoom_participant_id])
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/// Ledger of processed Zoom webhook deliveries: one row per `dedupe_key` (request id or body hash).
|
|
69
|
-
/// Stops double-handling when Zoom retries the same notification (e.g. RTMS, `meeting.started`).
|
|
70
|
-
model ZoomWebhookEvent {
|
|
71
|
-
id String @id @default(uuid())
|
|
72
|
-
/// Stable key: SHA-256 of raw request body, or `x-zm-trackingid` when present.
|
|
73
|
-
dedupe_key String @unique
|
|
74
|
-
event String
|
|
75
|
-
created_at DateTime @default(now())
|
|
76
|
-
|
|
77
|
-
@@index([event])
|
|
78
|
-
@@index([created_at])
|
|
79
|
-
}
|
|
1
|
+
/// Expected attendee slot when persisting interview-linked Zoom participants (`CANDIDATE` | `INTERVIEWER`).
|
|
2
|
+
enum ZoomMeetingParticipantRole {
|
|
3
|
+
CANDIDATE
|
|
4
|
+
INTERVIEWER
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/// Zoom meeting linked 1:1 to an interview; Zoom REST host is `zoom_host_user_id`.
|
|
8
|
+
model ZoomMeeting {
|
|
9
|
+
id String @id @default(uuid())
|
|
10
|
+
/// One Zoom row per interview.
|
|
11
|
+
interview_id String @unique
|
|
12
|
+
interview Interview @relation(fields: [interview_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
13
|
+
|
|
14
|
+
/// Treadspace user id whose Zoom User-OAuth token created this meeting; required for PATCH/DELETE on Zoom REST.
|
|
15
|
+
/// Set from the Zoom host `userId` in `ZoomMeetingDAO.upsertZoomParticipants` (same user as `POST /users/me/meetings`).
|
|
16
|
+
zoom_host_user_id String
|
|
17
|
+
|
|
18
|
+
/// Zoom REST/API meeting id (same value used as Meeting SDK `meetingNumber` / JWT `mn`).
|
|
19
|
+
zoom_meeting_id String
|
|
20
|
+
/// Zoom meeting **instance** UUID from REST create (`uuid`) and RTMS/webhooks (`meeting_uuid`).
|
|
21
|
+
zoom_meeting_uuid String?
|
|
22
|
+
join_url String
|
|
23
|
+
start_url String?
|
|
24
|
+
password String?
|
|
25
|
+
topic String?
|
|
26
|
+
|
|
27
|
+
scheduled_start_time DateTime?
|
|
28
|
+
scheduled_end_time DateTime?
|
|
29
|
+
|
|
30
|
+
is_active Boolean @default(true)
|
|
31
|
+
|
|
32
|
+
created_at DateTime @default(now())
|
|
33
|
+
updated_at DateTime @updatedAt
|
|
34
|
+
/// Audit; kept aligned with `zoom_host_user_id` when the meeting is recreated under a new host.
|
|
35
|
+
created_by String
|
|
36
|
+
updated_by String
|
|
37
|
+
|
|
38
|
+
participants ZoomMeetingParticipant[]
|
|
39
|
+
|
|
40
|
+
@@index([interview_id])
|
|
41
|
+
@@index([zoom_meeting_id])
|
|
42
|
+
@@index([zoom_meeting_uuid])
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// Expected participants for a `ZoomMeeting`: links to `User` (candidate / interviewer). Replaced on each meeting upsert.
|
|
46
|
+
model ZoomMeetingParticipant {
|
|
47
|
+
id String @id @default(uuid())
|
|
48
|
+
zoom_meeting_row_id String
|
|
49
|
+
zoom_meeting ZoomMeeting @relation(fields: [zoom_meeting_row_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
50
|
+
user_id String
|
|
51
|
+
user User @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
52
|
+
/// Zoom account id (`AuthModule.provider_account_id`) when this `user_id` has linked Zoom; usually set for interviewer, often null for candidate.
|
|
53
|
+
zoom_participant_id String?
|
|
54
|
+
role ZoomMeetingParticipantRole
|
|
55
|
+
|
|
56
|
+
is_active Boolean @default(true)
|
|
57
|
+
|
|
58
|
+
created_at DateTime @default(now())
|
|
59
|
+
updated_at DateTime @updatedAt
|
|
60
|
+
created_by String
|
|
61
|
+
updated_by String
|
|
62
|
+
|
|
63
|
+
@@index([zoom_meeting_row_id])
|
|
64
|
+
@@index([user_id])
|
|
65
|
+
@@index([zoom_participant_id])
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// Ledger of processed Zoom webhook deliveries: one row per `dedupe_key` (request id or body hash).
|
|
69
|
+
/// Stops double-handling when Zoom retries the same notification (e.g. RTMS, `meeting.started`).
|
|
70
|
+
model ZoomWebhookEvent {
|
|
71
|
+
id String @id @default(uuid())
|
|
72
|
+
/// Stable key: SHA-256 of raw request body, or `x-zm-trackingid` when present.
|
|
73
|
+
dedupe_key String @unique
|
|
74
|
+
event String
|
|
75
|
+
created_at DateTime @default(now())
|
|
76
|
+
|
|
77
|
+
@@index([event])
|
|
78
|
+
@@index([created_at])
|
|
79
|
+
}
|
package/prisma/.DS_Store
DELETED
|
Binary file
|
package/prisma/schema/migrations/20260520120000_interview_duration_drop_deadline/migration.sql
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
-- Interview.duration (minutes) replaces timestamp-derived length; Interview.deadline removed (window = scheduled_end_time).
|
|
2
|
-
ALTER TABLE "Interview" ADD COLUMN IF NOT EXISTS "duration" INTEGER;
|
|
3
|
-
|
|
4
|
-
ALTER TABLE "Interview" DROP COLUMN IF EXISTS "deadline";
|
|
5
|
-
|
|
6
|
-
-- Best-effort inline backfill (Full AI rows may be wrong until backfill-interview-duration.ts runs).
|
|
7
|
-
UPDATE "Interview" i
|
|
8
|
-
SET "duration" = GREATEST(
|
|
9
|
-
1,
|
|
10
|
-
ROUND(
|
|
11
|
-
EXTRACT(EPOCH FROM (i."scheduled_end_time" - i."scheduled_start_time")) / 60
|
|
12
|
-
)::integer
|
|
13
|
-
)
|
|
14
|
-
WHERE i."duration" IS NULL
|
|
15
|
-
AND i."scheduled_start_time" IS NOT NULL
|
|
16
|
-
AND i."scheduled_end_time" IS NOT NULL
|
|
17
|
-
AND i."scheduled_end_time" > i."scheduled_start_time"
|
|
18
|
-
AND (i."evaluation_type" IS NULL OR i."evaluation_type"::text <> 'TREADSPACE_FULL_AI');
|
|
19
|
-
|
|
20
|
-
UPDATE "Interview" i
|
|
21
|
-
SET "duration" = oe."duration"
|
|
22
|
-
FROM "OngoingEvaluation" oe
|
|
23
|
-
WHERE oe."interview_id" = i."id"
|
|
24
|
-
AND i."duration" IS NULL
|
|
25
|
-
AND oe."duration" IS NOT NULL
|
|
26
|
-
AND oe."duration_unit" = 'MINUTES';
|
|
27
|
-
|
|
28
|
-
UPDATE "Interview"
|
|
29
|
-
SET "duration" = 45
|
|
30
|
-
WHERE "duration" IS NULL;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
-- CreateEnum
|
|
2
|
-
CREATE TYPE "JobApplicationTemplateScope" AS ENUM ('ORGANIZATION', 'JOB');
|
|
3
|
-
|
|
4
|
-
-- CreateTable
|
|
5
|
-
CREATE TABLE "JobApplicationTemplate" (
|
|
6
|
-
"id" TEXT NOT NULL,
|
|
7
|
-
"organisation_id" TEXT NOT NULL,
|
|
8
|
-
"job_description_id" TEXT,
|
|
9
|
-
"name" TEXT NOT NULL,
|
|
10
|
-
"description" TEXT,
|
|
11
|
-
"scope" "JobApplicationTemplateScope" NOT NULL DEFAULT 'ORGANIZATION',
|
|
12
|
-
"is_active" BOOLEAN NOT NULL DEFAULT true,
|
|
13
|
-
"created_by" TEXT NOT NULL,
|
|
14
|
-
"updated_by" TEXT NOT NULL,
|
|
15
|
-
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
16
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
17
|
-
|
|
18
|
-
CONSTRAINT "JobApplicationTemplate_pkey" PRIMARY KEY ("id")
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
-- Drop legacy scope model on JobApplicationField (greenfield — no data backfill)
|
|
22
|
-
ALTER TABLE "JobApplicationField" DROP CONSTRAINT IF EXISTS "JobApplicationField_job_description_id_fkey";
|
|
23
|
-
ALTER TABLE "JobApplicationField" DROP CONSTRAINT IF EXISTS "JobApplicationField_application_id_fkey";
|
|
24
|
-
DROP INDEX IF EXISTS "JobApplicationField_organisation_id_scope_idx";
|
|
25
|
-
DROP INDEX IF EXISTS "JobApplicationField_job_description_id_idx";
|
|
26
|
-
DROP INDEX IF EXISTS "JobApplicationField_application_id_idx";
|
|
27
|
-
|
|
28
|
-
ALTER TABLE "JobApplicationField" DROP COLUMN IF EXISTS "scope";
|
|
29
|
-
ALTER TABLE "JobApplicationField" DROP COLUMN IF EXISTS "job_description_id";
|
|
30
|
-
ALTER TABLE "JobApplicationField" DROP COLUMN IF EXISTS "application_id";
|
|
31
|
-
|
|
32
|
-
DROP TYPE IF EXISTS "JobApplicationFieldScope";
|
|
33
|
-
|
|
34
|
-
ALTER TABLE "JobApplicationField" ADD COLUMN IF NOT EXISTS "template_id" TEXT;
|
|
35
|
-
|
|
36
|
-
-- JobApplicationResponse snapshot columns
|
|
37
|
-
ALTER TABLE "JobApplicationResponse" DROP CONSTRAINT IF EXISTS "JobApplicationResponse_job_application_field_id_fkey";
|
|
38
|
-
DROP INDEX IF EXISTS "JobApplicationResponse_application_id_job_application_field_id_key";
|
|
39
|
-
|
|
40
|
-
ALTER TABLE "JobApplicationResponse" ALTER COLUMN "job_application_field_id" DROP NOT NULL;
|
|
41
|
-
|
|
42
|
-
ALTER TABLE "JobApplicationResponse" ADD COLUMN IF NOT EXISTS "field_type" "JobApplicationFieldType";
|
|
43
|
-
ALTER TABLE "JobApplicationResponse" ADD COLUMN IF NOT EXISTS "label" TEXT;
|
|
44
|
-
ALTER TABLE "JobApplicationResponse" ADD COLUMN IF NOT EXISTS "description" TEXT;
|
|
45
|
-
ALTER TABLE "JobApplicationResponse" ADD COLUMN IF NOT EXISTS "is_mandatory" BOOLEAN;
|
|
46
|
-
ALTER TABLE "JobApplicationResponse" ADD COLUMN IF NOT EXISTS "options" TEXT[] DEFAULT ARRAY[]::TEXT[];
|
|
47
|
-
|
|
48
|
-
-- Document: remove application link
|
|
49
|
-
ALTER TABLE "Document" DROP CONSTRAINT IF EXISTS "Document_application_id_fkey";
|
|
50
|
-
DROP INDEX IF EXISTS "Document_application_id_idx";
|
|
51
|
-
ALTER TABLE "Document" DROP COLUMN IF EXISTS "application_id";
|
|
52
|
-
|
|
53
|
-
-- Greenfield: no legacy JAF rows — clear any orphan fields before NOT NULL
|
|
54
|
-
DELETE FROM "JobApplicationField";
|
|
55
|
-
ALTER TABLE "JobApplicationField" ALTER COLUMN "template_id" SET NOT NULL;
|
|
56
|
-
|
|
57
|
-
-- Indexes and foreign keys
|
|
58
|
-
CREATE UNIQUE INDEX IF NOT EXISTS "JobApplicationTemplate_job_description_id_key" ON "JobApplicationTemplate"("job_description_id");
|
|
59
|
-
CREATE INDEX IF NOT EXISTS "JobApplicationTemplate_organisation_id_scope_idx" ON "JobApplicationTemplate"("organisation_id", "scope");
|
|
60
|
-
CREATE INDEX IF NOT EXISTS "JobApplicationTemplate_job_description_id_idx" ON "JobApplicationTemplate"("job_description_id");
|
|
61
|
-
|
|
62
|
-
ALTER TABLE "JobApplicationTemplate" ADD CONSTRAINT "JobApplicationTemplate_organisation_id_fkey" FOREIGN KEY ("organisation_id") REFERENCES "Organisation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
63
|
-
ALTER TABLE "JobApplicationTemplate" ADD CONSTRAINT "JobApplicationTemplate_job_description_id_fkey" FOREIGN KEY ("job_description_id") REFERENCES "JobDescription"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
64
|
-
|
|
65
|
-
ALTER TABLE "JobApplicationField" ADD CONSTRAINT "JobApplicationField_template_id_fkey" FOREIGN KEY ("template_id") REFERENCES "JobApplicationTemplate"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
66
|
-
CREATE INDEX IF NOT EXISTS "JobApplicationField_organisation_id_template_id_idx" ON "JobApplicationField"("organisation_id", "template_id");
|
|
67
|
-
|
|
68
|
-
ALTER TABLE "JobApplicationResponse" ADD CONSTRAINT "JobApplicationResponse_job_application_field_id_fkey" FOREIGN KEY ("job_application_field_id") REFERENCES "JobApplicationField"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
69
|
-
|
|
70
|
-
CREATE UNIQUE INDEX "JobApplicationResponse_application_id_job_application_field_id_key" ON "JobApplicationResponse"("application_id", "job_application_field_id") WHERE "job_application_field_id" IS NOT NULL;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
-- AlterTable
|
|
2
|
-
ALTER TABLE "Assignment" ADD COLUMN "solution_document_id" TEXT,
|
|
3
|
-
ADD COLUMN "zip_document_id" TEXT;
|
|
4
|
-
|
|
5
|
-
-- CreateIndex
|
|
6
|
-
CREATE UNIQUE INDEX "Assignment_solution_document_id_key" ON "Assignment"("solution_document_id");
|
|
7
|
-
|
|
8
|
-
-- CreateIndex
|
|
9
|
-
CREATE UNIQUE INDEX "Assignment_zip_document_id_key" ON "Assignment"("zip_document_id");
|
|
10
|
-
|
|
11
|
-
-- AddForeignKey
|
|
12
|
-
ALTER TABLE "Assignment" ADD CONSTRAINT "Assignment_solution_document_id_fkey" FOREIGN KEY ("solution_document_id") REFERENCES "Document"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
13
|
-
|
|
14
|
-
-- AddForeignKey
|
|
15
|
-
ALTER TABLE "Assignment" ADD CONSTRAINT "Assignment_zip_document_id_fkey" FOREIGN KEY ("zip_document_id") REFERENCES "Document"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
-- JobApplicationField: draft gate for template/job fields
|
|
2
|
-
ALTER TABLE "JobApplicationField" ADD COLUMN IF NOT EXISTS "is_draft" BOOLEAN DEFAULT true;
|
|
3
|
-
UPDATE "JobApplicationField" SET "is_draft" = false WHERE "is_draft" IS NULL;
|
|
4
|
-
ALTER TABLE "JobApplicationField" ALTER COLUMN "is_draft" SET NOT NULL;
|
|
5
|
-
ALTER TABLE "JobApplicationField" ALTER COLUMN "is_draft" SET DEFAULT true;
|
|
6
|
-
|
|
7
|
-
-- JobApplicationResponse: per-row draft/submit state
|
|
8
|
-
ALTER TABLE "JobApplicationResponse" ADD COLUMN IF NOT EXISTS "is_draft" BOOLEAN;
|
|
9
|
-
ALTER TABLE "JobApplicationResponse" ADD COLUMN IF NOT EXISTS "is_submitted" BOOLEAN DEFAULT false;
|
|
10
|
-
UPDATE "JobApplicationResponse" SET "is_draft" = false WHERE "is_draft" IS NULL;
|
|
11
|
-
UPDATE "JobApplicationResponse" SET "is_submitted" = false WHERE "is_submitted" IS NULL;
|
|
12
|
-
ALTER TABLE "JobApplicationResponse" ALTER COLUMN "is_draft" SET DEFAULT false;
|