@hirelink/database-prisma 1.1.9 → 1.1.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hirelink/database-prisma",
3
- "version": "1.1.9",
3
+ "version": "1.1.15",
4
4
  "description": "A Prisma-based database package for Hirelink applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,54 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "PeriodUnit" AS ENUM ('DAY', 'WEEK', 'MONTH');
3
+
4
+ -- CreateEnum
5
+ CREATE TYPE "Gender" AS ENUM ('Male', 'Female', 'Other', 'PreferNotToSay');
6
+
7
+ -- AlterEnum
8
+ ALTER TYPE "HrUserStatus" ADD VALUE 'self_registered';
9
+
10
+ -- DropForeignKey
11
+ ALTER TABLE "HrUser" DROP CONSTRAINT "HrUser_org_id_fkey";
12
+
13
+ -- AlterTable
14
+ ALTER TABLE "HrUser" ALTER COLUMN "org_id" DROP NOT NULL;
15
+
16
+ -- AlterTable
17
+ ALTER TABLE "User" ADD COLUMN "dob" TIMESTAMP(3),
18
+ ADD COLUMN "gender" "Gender";
19
+
20
+ -- CreateTable
21
+ CREATE TABLE "candidateProfile" (
22
+ "id" TEXT NOT NULL,
23
+ "user_id" TEXT NOT NULL,
24
+ "department" TEXT,
25
+ "job_role" TEXT,
26
+ "location" TEXT,
27
+ "designation" TEXT,
28
+
29
+ CONSTRAINT "candidateProfile_pkey" PRIMARY KEY ("id")
30
+ );
31
+
32
+ -- CreateTable
33
+ CREATE TABLE "CandidateverificationTask" (
34
+ "id" TEXT NOT NULL,
35
+ "user_id" TEXT NOT NULL,
36
+ "document_list_name" TEXT NOT NULL,
37
+ "due_period_value" INTEGER NOT NULL,
38
+ "due_period_unit" "PeriodUnit" NOT NULL,
39
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
40
+
41
+ CONSTRAINT "CandidateverificationTask_pkey" PRIMARY KEY ("id")
42
+ );
43
+
44
+ -- CreateIndex
45
+ CREATE UNIQUE INDEX "candidateProfile_user_id_key" ON "candidateProfile"("user_id");
46
+
47
+ -- AddForeignKey
48
+ ALTER TABLE "HrUser" ADD CONSTRAINT "HrUser_org_id_fkey" FOREIGN KEY ("org_id") REFERENCES "Organization"("org_id") ON DELETE SET NULL ON UPDATE CASCADE;
49
+
50
+ -- AddForeignKey
51
+ ALTER TABLE "candidateProfile" ADD CONSTRAINT "candidateProfile_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
52
+
53
+ -- AddForeignKey
54
+ ALTER TABLE "CandidateverificationTask" ADD CONSTRAINT "CandidateverificationTask_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "User" ADD COLUMN "phone" TEXT;
@@ -8,26 +8,31 @@ datasource db {
8
8
  }
9
9
 
10
10
  model User {
11
- id String @id
12
- email String @unique
13
- first_name String?
14
- last_name String?
15
- role Role
16
- status UserStatus @default(active)
17
- created_at DateTime? @default(now())
18
- updated_at DateTime? @updatedAt
19
- work_experience Work_experience? @default(experience)
20
- candidate_documents CandidateDocument[]
21
- hirelink_ids HirelinkId[]
22
- hr_users HrUser[]
23
- logs Log[]
24
- notifications Notification[]
25
- onboarding_details OnboardingDetail[]
26
- otp_requests OtpRequest[]
27
- password_reset_requests PasswordResetRequest[]
28
- sessions Session[]
29
- verification_requests VerificationRequest[]
30
- Experience_history ExperienceHistory[]
11
+ id String @id
12
+ email String @unique
13
+ phone String?
14
+ first_name String?
15
+ last_name String?
16
+ role Role
17
+ status UserStatus @default(active)
18
+ created_at DateTime? @default(now())
19
+ updated_at DateTime? @updatedAt
20
+ work_experience Work_experience? @default(experience)
21
+ dob DateTime?
22
+ gender Gender?
23
+ candidate_documents CandidateDocument[]
24
+ verification_requests_custom CandidateverificationTask[]
25
+ Experience_history ExperienceHistory[]
26
+ hirelink_ids HirelinkId[]
27
+ hr_users HrUser[]
28
+ logs Log[]
29
+ notifications Notification[]
30
+ onboarding_details OnboardingDetail[]
31
+ otp_requests OtpRequest[]
32
+ password_reset_requests PasswordResetRequest[]
33
+ sessions Session[]
34
+ verification_requests VerificationRequest[]
35
+ candidate_profile candidateProfile?
31
36
  }
32
37
 
33
38
  model ExperienceHistory {
@@ -36,10 +41,10 @@ model ExperienceHistory {
36
41
  employer String
37
42
  start_date DateTime
38
43
  end_date DateTime
39
- user User @relation(fields: [userId], references: [id])
40
44
  userId String
41
45
  created_at DateTime @default(now())
42
46
  updated_at DateTime @updatedAt
47
+ user User @relation(fields: [userId], references: [id])
43
48
  }
44
49
 
45
50
  model Organization {
@@ -63,14 +68,14 @@ model Organization {
63
68
  }
64
69
 
65
70
  model HrUser {
66
- hr_user_id String @id @default(uuid())
67
- org_id String
71
+ hr_user_id String @id @default(uuid())
72
+ org_id String?
68
73
  user_id String
69
- status HrUserStatus @default(initiated)
70
- created_at DateTime? @default(now())
71
- updated_at DateTime? @updatedAt
72
- organization Organization @relation(fields: [org_id], references: [org_id])
73
- user User @relation(fields: [user_id], references: [id])
74
+ status HrUserStatus @default(initiated)
75
+ created_at DateTime? @default(now())
76
+ updated_at DateTime? @updatedAt
77
+ organization Organization? @relation(fields: [org_id], references: [org_id])
78
+ user User @relation(fields: [user_id], references: [id])
74
79
  }
75
80
 
76
81
  model OnboardingDetail {
@@ -117,10 +122,10 @@ model CandidateDocument {
117
122
  doc_type String
118
123
  uploaded_at String
119
124
  user_id String
120
- candidate_document_type CandidateDocumentType?
121
- status CandidateDocumentStatus @default(pending)
122
125
  created_at DateTime? @default(now())
123
126
  updated_at DateTime? @updatedAt
127
+ candidate_document_type CandidateDocumentType?
128
+ status CandidateDocumentStatus @default(pending)
124
129
  user User @relation(fields: [user_id], references: [id])
125
130
  }
126
131
 
@@ -188,6 +193,32 @@ model Log {
188
193
  user User @relation(fields: [user_id], references: [id])
189
194
  }
190
195
 
196
+ model candidateProfile {
197
+ id String @id @default(uuid())
198
+ user_id String @unique
199
+ department String?
200
+ job_role String?
201
+ location String?
202
+ designation String?
203
+ user User @relation(fields: [user_id], references: [id])
204
+ }
205
+
206
+ model CandidateverificationTask {
207
+ id String @id @default(uuid())
208
+ user_id String
209
+ document_list_name String
210
+ due_period_value Int
211
+ due_period_unit PeriodUnit
212
+ created_at DateTime @default(now())
213
+ user User @relation(fields: [user_id], references: [id])
214
+ }
215
+
216
+ enum PeriodUnit {
217
+ DAY
218
+ WEEK
219
+ MONTH
220
+ }
221
+
191
222
  enum Role {
192
223
  admin
193
224
  hr
@@ -209,6 +240,7 @@ enum HrUserStatus {
209
240
  active
210
241
  initiated
211
242
  disabled
243
+ self_registered
212
244
  }
213
245
 
214
246
  enum CandidateDocumentType {
@@ -253,3 +285,10 @@ enum CandidateDocumentStatus {
253
285
  overdue
254
286
  complete
255
287
  }
288
+
289
+ enum Gender {
290
+ Male
291
+ Female
292
+ Other
293
+ PreferNotToSay
294
+ }