@adaptware/eagles-db 0.4.13 → 0.4.17
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/client/edge.js +105 -88
- package/client/index-browser.js +100 -83
- package/client/index.d.ts +31764 -25474
- package/client/index.js +105 -88
- package/client/package.json +1 -1
- package/client/schema.prisma +227 -184
- package/client/wasm.js +100 -83
- package/package.json +1 -1
- package/prisma/schema/applications.prisma +2 -2
- package/prisma/schema/assessmentLibrary.prisma +14 -14
- package/prisma/schema/assignment.prisma +36 -36
- package/prisma/schema/calendly.prisma +13 -13
- package/prisma/schema/communication.prisma +156 -0
- package/prisma/schema/evaluationPlan.prisma +0 -9
- package/prisma/schema/google.prisma +11 -11
- package/prisma/schema/jobDescription.prisma +26 -29
- package/prisma/schema/migrations/20260610100000_add_communication/migration.sql +131 -0
- package/prisma/schema/migrations/20260610170000_add_communication_application_scope/migration.sql +45 -0
- package/prisma/schema/notes.prisma +15 -15
- package/prisma/schema/organisation.prisma +4 -3
- package/prisma/schema/organisationConfig.prisma +9 -9
- package/prisma/schema/refreshToken.prisma +8 -8
- package/prisma/schema/user.prisma +0 -1
- package/client/libquery_engine-darwin.dylib.node +0 -0
- package/prisma/schema/activityEvent.prisma +0 -101
|
@@ -19,36 +19,33 @@ model JobDescription {
|
|
|
19
19
|
summary Json?
|
|
20
20
|
ai_insight Json?
|
|
21
21
|
job_fit_comparison Json?
|
|
22
|
-
target_closing_date DateTime?
|
|
23
|
-
closing_date DateTime?
|
|
24
|
-
|
|
25
|
-
job_number Int?
|
|
26
|
-
job_code String? @unique
|
|
27
22
|
// Audit fields
|
|
28
|
-
created_at
|
|
29
|
-
updated_at
|
|
30
|
-
created_by
|
|
31
|
-
updated_by
|
|
32
|
-
is_active
|
|
33
|
-
openings
|
|
34
|
-
job_profile_id
|
|
35
|
-
job_profile
|
|
36
|
-
organisation
|
|
37
|
-
applications
|
|
38
|
-
interviews
|
|
39
|
-
assignments
|
|
40
|
-
fit_check
|
|
41
|
-
job_description_data
|
|
42
|
-
evaluationPlan
|
|
43
|
-
ongoing_evaluations
|
|
44
|
-
assignment_library
|
|
45
|
-
approvals
|
|
46
|
-
resumes
|
|
47
|
-
budget
|
|
48
|
-
hiring_manager
|
|
49
|
-
recruiters
|
|
50
|
-
transcripts
|
|
51
|
-
integration_job_syncs
|
|
23
|
+
created_at DateTime @default(now())
|
|
24
|
+
updated_at DateTime @updatedAt
|
|
25
|
+
created_by String
|
|
26
|
+
updated_by String
|
|
27
|
+
is_active Boolean @default(true)
|
|
28
|
+
openings Int @default(1)
|
|
29
|
+
job_profile_id String?
|
|
30
|
+
job_profile JobProfile? @relation(fields: [job_profile_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
31
|
+
organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
32
|
+
applications Application[]
|
|
33
|
+
interviews Interview[]
|
|
34
|
+
assignments Assignment[]
|
|
35
|
+
fit_check FitCheck[] // one-to-many link
|
|
36
|
+
job_description_data JobDescriptionData[] // one-to-many link
|
|
37
|
+
evaluationPlan EvaluationPlan[] // relation to evaluation methods
|
|
38
|
+
ongoing_evaluations OngoingEvaluation[] // optional one-to-many
|
|
39
|
+
assignment_library AssignmentLibrary[]
|
|
40
|
+
approvals Approval[] // one-to-many relation
|
|
41
|
+
resumes Resume[] // one-to-many link
|
|
42
|
+
budget Budget?
|
|
43
|
+
hiring_manager User? @relation("HiringManager", fields: [hiring_manager_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
44
|
+
recruiters User[]
|
|
45
|
+
transcripts Transcript[]
|
|
46
|
+
integration_job_syncs IntegrationJobSync[]
|
|
47
|
+
conversations Conversation[]
|
|
48
|
+
communication_messages CommunicationMessage[]
|
|
52
49
|
|
|
53
50
|
@@index([organisation_id])
|
|
54
51
|
@@index([hiring_manager_id])
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
-- CreateEnum
|
|
2
|
+
CREATE TYPE "CommChannel" AS ENUM ('WHATSAPP', 'EMAIL', 'SMS', 'CALL');
|
|
3
|
+
|
|
4
|
+
-- CreateEnum
|
|
5
|
+
CREATE TYPE "CommProvider" AS ENUM ('META_WHATSAPP', 'TWILIO', 'GUPSHUP', 'MTALKZ', 'THREE_SIXTY_DIALOG', 'GMAIL', 'OUTLOOK', 'GENERIC_SMTP', 'GENERIC');
|
|
6
|
+
|
|
7
|
+
-- CreateEnum
|
|
8
|
+
CREATE TYPE "CommDirection" AS ENUM ('INBOUND', 'OUTBOUND');
|
|
9
|
+
|
|
10
|
+
-- CreateEnum
|
|
11
|
+
CREATE TYPE "CommMessageStatus" AS ENUM ('QUEUED', 'SENT', 'DELIVERED', 'READ', 'FAILED', 'RECEIVED');
|
|
12
|
+
|
|
13
|
+
-- CreateTable
|
|
14
|
+
CREATE TABLE "ChannelProviderConfig" (
|
|
15
|
+
"id" TEXT NOT NULL,
|
|
16
|
+
"organisation_id" TEXT NOT NULL,
|
|
17
|
+
"channel" "CommChannel" NOT NULL,
|
|
18
|
+
"provider" "CommProvider" NOT NULL,
|
|
19
|
+
"credentials" TEXT,
|
|
20
|
+
"metadata" JSONB NOT NULL DEFAULT '{}',
|
|
21
|
+
"is_active" BOOLEAN NOT NULL DEFAULT true,
|
|
22
|
+
"is_default" BOOLEAN NOT NULL DEFAULT true,
|
|
23
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
24
|
+
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
25
|
+
"created_by" TEXT NOT NULL,
|
|
26
|
+
"updated_by" TEXT NOT NULL,
|
|
27
|
+
|
|
28
|
+
CONSTRAINT "ChannelProviderConfig_pkey" PRIMARY KEY ("id")
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
-- CreateTable
|
|
32
|
+
CREATE TABLE "Conversation" (
|
|
33
|
+
"id" TEXT NOT NULL,
|
|
34
|
+
"organisation_id" TEXT NOT NULL,
|
|
35
|
+
"channel" "CommChannel" NOT NULL,
|
|
36
|
+
"provider" "CommProvider" NOT NULL,
|
|
37
|
+
"channel_provider_id" TEXT,
|
|
38
|
+
"external_id" TEXT NOT NULL,
|
|
39
|
+
"contact_user_id" TEXT,
|
|
40
|
+
"provider_thread_id" TEXT,
|
|
41
|
+
"subject" TEXT,
|
|
42
|
+
"status" TEXT NOT NULL DEFAULT 'open',
|
|
43
|
+
"unread_count" INTEGER NOT NULL DEFAULT 0,
|
|
44
|
+
"last_message_at" TIMESTAMP(3),
|
|
45
|
+
"metadata" JSONB NOT NULL DEFAULT '{}',
|
|
46
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
47
|
+
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
48
|
+
"created_by" TEXT NOT NULL,
|
|
49
|
+
"updated_by" TEXT NOT NULL,
|
|
50
|
+
|
|
51
|
+
CONSTRAINT "Conversation_pkey" PRIMARY KEY ("id")
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
-- CreateTable
|
|
55
|
+
CREATE TABLE "CommunicationMessage" (
|
|
56
|
+
"id" TEXT NOT NULL,
|
|
57
|
+
"conversation_id" TEXT NOT NULL,
|
|
58
|
+
"organisation_id" TEXT NOT NULL,
|
|
59
|
+
"channel" "CommChannel" NOT NULL,
|
|
60
|
+
"provider" "CommProvider" NOT NULL,
|
|
61
|
+
"channel_provider_id" TEXT,
|
|
62
|
+
"direction" "CommDirection" NOT NULL,
|
|
63
|
+
"status" "CommMessageStatus" NOT NULL,
|
|
64
|
+
"body" TEXT,
|
|
65
|
+
"from_identifier" TEXT NOT NULL,
|
|
66
|
+
"to_identifier" TEXT NOT NULL,
|
|
67
|
+
"sender_user_id" TEXT,
|
|
68
|
+
"provider_message_id" TEXT,
|
|
69
|
+
"template_name" TEXT,
|
|
70
|
+
"attachments" JSONB NOT NULL DEFAULT '[]',
|
|
71
|
+
"metadata" JSONB NOT NULL DEFAULT '{}',
|
|
72
|
+
"error" TEXT,
|
|
73
|
+
"sent_at" TIMESTAMP(3),
|
|
74
|
+
"delivered_at" TIMESTAMP(3),
|
|
75
|
+
"read_at" TIMESTAMP(3),
|
|
76
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
77
|
+
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
78
|
+
|
|
79
|
+
CONSTRAINT "CommunicationMessage_pkey" PRIMARY KEY ("id")
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
-- CreateIndex
|
|
83
|
+
CREATE UNIQUE INDEX "ChannelProviderConfig_organisation_id_channel_provider_key" ON "ChannelProviderConfig"("organisation_id", "channel", "provider");
|
|
84
|
+
|
|
85
|
+
-- CreateIndex
|
|
86
|
+
CREATE INDEX "ChannelProviderConfig_organisation_id_channel_idx" ON "ChannelProviderConfig"("organisation_id", "channel");
|
|
87
|
+
|
|
88
|
+
-- CreateIndex
|
|
89
|
+
CREATE INDEX "ChannelProviderConfig_organisation_id_channel_is_active_idx" ON "ChannelProviderConfig"("organisation_id", "channel", "is_active");
|
|
90
|
+
|
|
91
|
+
-- CreateIndex
|
|
92
|
+
CREATE UNIQUE INDEX "Conversation_organisation_id_channel_provider_external_id_key" ON "Conversation"("organisation_id", "channel", "provider", "external_id");
|
|
93
|
+
|
|
94
|
+
-- CreateIndex
|
|
95
|
+
CREATE INDEX "Conversation_organisation_id_channel_idx" ON "Conversation"("organisation_id", "channel");
|
|
96
|
+
|
|
97
|
+
-- CreateIndex
|
|
98
|
+
CREATE INDEX "Conversation_organisation_id_last_message_at_idx" ON "Conversation"("organisation_id", "last_message_at");
|
|
99
|
+
|
|
100
|
+
-- CreateIndex
|
|
101
|
+
CREATE INDEX "Conversation_external_id_idx" ON "Conversation"("external_id");
|
|
102
|
+
|
|
103
|
+
-- CreateIndex
|
|
104
|
+
CREATE UNIQUE INDEX "CommunicationMessage_provider_provider_message_id_key" ON "CommunicationMessage"("provider", "provider_message_id");
|
|
105
|
+
|
|
106
|
+
-- CreateIndex
|
|
107
|
+
CREATE INDEX "CommunicationMessage_conversation_id_created_at_idx" ON "CommunicationMessage"("conversation_id", "created_at");
|
|
108
|
+
|
|
109
|
+
-- CreateIndex
|
|
110
|
+
CREATE INDEX "CommunicationMessage_organisation_id_channel_created_at_idx" ON "CommunicationMessage"("organisation_id", "channel", "created_at");
|
|
111
|
+
|
|
112
|
+
-- CreateIndex
|
|
113
|
+
CREATE INDEX "CommunicationMessage_organisation_id_status_idx" ON "CommunicationMessage"("organisation_id", "status");
|
|
114
|
+
|
|
115
|
+
-- AddForeignKey
|
|
116
|
+
ALTER TABLE "ChannelProviderConfig" ADD CONSTRAINT "ChannelProviderConfig_organisation_id_fkey" FOREIGN KEY ("organisation_id") REFERENCES "Organisation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
117
|
+
|
|
118
|
+
-- AddForeignKey
|
|
119
|
+
ALTER TABLE "Conversation" ADD CONSTRAINT "Conversation_organisation_id_fkey" FOREIGN KEY ("organisation_id") REFERENCES "Organisation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
120
|
+
|
|
121
|
+
-- AddForeignKey
|
|
122
|
+
ALTER TABLE "Conversation" ADD CONSTRAINT "Conversation_channel_provider_id_fkey" FOREIGN KEY ("channel_provider_id") REFERENCES "ChannelProviderConfig"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
123
|
+
|
|
124
|
+
-- AddForeignKey
|
|
125
|
+
ALTER TABLE "CommunicationMessage" ADD CONSTRAINT "CommunicationMessage_conversation_id_fkey" FOREIGN KEY ("conversation_id") REFERENCES "Conversation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
126
|
+
|
|
127
|
+
-- AddForeignKey
|
|
128
|
+
ALTER TABLE "CommunicationMessage" ADD CONSTRAINT "CommunicationMessage_organisation_id_fkey" FOREIGN KEY ("organisation_id") REFERENCES "Organisation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
129
|
+
|
|
130
|
+
-- AddForeignKey
|
|
131
|
+
ALTER TABLE "CommunicationMessage" ADD CONSTRAINT "CommunicationMessage_channel_provider_id_fkey" FOREIGN KEY ("channel_provider_id") REFERENCES "ChannelProviderConfig"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
package/prisma/schema/migrations/20260610170000_add_communication_application_scope/migration.sql
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
-- AlterTable: Conversation
|
|
2
|
+
ALTER TABLE "Conversation"
|
|
3
|
+
ADD COLUMN "application_id" TEXT,
|
|
4
|
+
ADD COLUMN "job_description_id" TEXT;
|
|
5
|
+
|
|
6
|
+
-- AlterTable: CommunicationMessage
|
|
7
|
+
ALTER TABLE "CommunicationMessage"
|
|
8
|
+
ADD COLUMN "application_id" TEXT,
|
|
9
|
+
ADD COLUMN "job_description_id" TEXT;
|
|
10
|
+
|
|
11
|
+
-- CreateIndex
|
|
12
|
+
CREATE INDEX "Conversation_organisation_id_application_id_idx" ON "Conversation"("organisation_id", "application_id");
|
|
13
|
+
|
|
14
|
+
-- CreateIndex
|
|
15
|
+
CREATE INDEX "Conversation_organisation_id_job_description_id_idx" ON "Conversation"("organisation_id", "job_description_id");
|
|
16
|
+
|
|
17
|
+
-- CreateIndex
|
|
18
|
+
CREATE INDEX "CommunicationMessage_organisation_id_application_id_idx" ON "CommunicationMessage"("organisation_id", "application_id");
|
|
19
|
+
|
|
20
|
+
-- CreateIndex
|
|
21
|
+
CREATE INDEX "CommunicationMessage_organisation_id_job_description_id_idx" ON "CommunicationMessage"("organisation_id", "job_description_id");
|
|
22
|
+
|
|
23
|
+
-- AddForeignKey
|
|
24
|
+
ALTER TABLE "Conversation"
|
|
25
|
+
ADD CONSTRAINT "Conversation_application_id_fkey"
|
|
26
|
+
FOREIGN KEY ("application_id") REFERENCES "Application"("id")
|
|
27
|
+
ON DELETE SET NULL ON UPDATE CASCADE;
|
|
28
|
+
|
|
29
|
+
-- AddForeignKey
|
|
30
|
+
ALTER TABLE "Conversation"
|
|
31
|
+
ADD CONSTRAINT "Conversation_job_description_id_fkey"
|
|
32
|
+
FOREIGN KEY ("job_description_id") REFERENCES "JobDescription"("id")
|
|
33
|
+
ON DELETE SET NULL ON UPDATE CASCADE;
|
|
34
|
+
|
|
35
|
+
-- AddForeignKey
|
|
36
|
+
ALTER TABLE "CommunicationMessage"
|
|
37
|
+
ADD CONSTRAINT "CommunicationMessage_application_id_fkey"
|
|
38
|
+
FOREIGN KEY ("application_id") REFERENCES "Application"("id")
|
|
39
|
+
ON DELETE SET NULL ON UPDATE CASCADE;
|
|
40
|
+
|
|
41
|
+
-- AddForeignKey
|
|
42
|
+
ALTER TABLE "CommunicationMessage"
|
|
43
|
+
ADD CONSTRAINT "CommunicationMessage_job_description_id_fkey"
|
|
44
|
+
FOREIGN KEY ("job_description_id") REFERENCES "JobDescription"("id")
|
|
45
|
+
ON DELETE SET NULL ON UPDATE CASCADE;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
model Notes {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
application_id String
|
|
4
|
+
user_id String
|
|
5
|
+
note String
|
|
6
|
+
pinned Boolean @default(false)
|
|
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
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
// Relations
|
|
14
|
+
application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
15
|
+
user User @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
@@index([application_id, created_at])
|
|
18
|
+
@@index([user_id, created_at])
|
|
19
19
|
}
|
|
@@ -26,8 +26,6 @@ model Organisation {
|
|
|
26
26
|
is_active Boolean @default(true)
|
|
27
27
|
alias String? @unique
|
|
28
28
|
logo String?
|
|
29
|
-
org_code String? @unique
|
|
30
|
-
job_sequence Int @default(1)
|
|
31
29
|
applications Application[]
|
|
32
30
|
user_roles UserRole[]
|
|
33
31
|
job_descriptions JobDescription[]
|
|
@@ -47,7 +45,10 @@ model Organisation {
|
|
|
47
45
|
assessments Assessment[]
|
|
48
46
|
timezone String @default("Asia/Kolkata")
|
|
49
47
|
organisation_configs OrganisationConfig[]
|
|
50
|
-
|
|
48
|
+
|
|
49
|
+
channel_provider_configs ChannelProviderConfig[]
|
|
50
|
+
conversations Conversation[]
|
|
51
|
+
communication_messages CommunicationMessage[]
|
|
51
52
|
|
|
52
53
|
@@index([name])
|
|
53
54
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
model OrganisationConfig {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
organisation_id String
|
|
4
|
+
config_key String
|
|
5
|
+
value Json
|
|
6
|
+
created_at DateTime @default(now())
|
|
7
|
+
updated_at DateTime @updatedAt
|
|
8
|
+
organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
@@unique([organisation_id, config_key])
|
|
11
|
+
@@map("organisationConfig")
|
|
12
12
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
model RefreshToken {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
user_id String
|
|
4
|
+
token String @unique
|
|
5
|
+
is_active Boolean @default(true)
|
|
6
|
+
expires_at DateTime
|
|
7
|
+
created_at DateTime @default(now())
|
|
8
|
+
updated_at DateTime @updatedAt
|
|
9
|
+
user User @relation("TokenRefresh", fields: [user_id], references: [id], onDelete: Cascade)
|
|
10
10
|
}
|
|
Binary file
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
enum ActivityEventType {
|
|
2
|
-
APPLICATION_CREATED
|
|
3
|
-
APPLICATION_STARTED
|
|
4
|
-
APPLICATION_REJECTED
|
|
5
|
-
APPLICATION_SHORTLISTED
|
|
6
|
-
|
|
7
|
-
ROUND_ASSIGNED
|
|
8
|
-
ROUND_COMPLETED
|
|
9
|
-
ROUND_PASSED
|
|
10
|
-
ROUND_FAILED
|
|
11
|
-
|
|
12
|
-
INTERVIEW_CREATED
|
|
13
|
-
INTERVIEW_SCHEDULED
|
|
14
|
-
INTERVIEW_RESCHEDULED
|
|
15
|
-
INTERVIEW_CANCELLED
|
|
16
|
-
INTERVIEW_STARTED
|
|
17
|
-
INTERVIEW_COMPLETED
|
|
18
|
-
INTERVIEW_NO_SHOW
|
|
19
|
-
INTERVIEW_EVALUATION_PENDING
|
|
20
|
-
INTERVIEW_EVALUATED
|
|
21
|
-
|
|
22
|
-
FEEDBACK_SUBMITTED
|
|
23
|
-
|
|
24
|
-
JOB_CREATED
|
|
25
|
-
JOB_PUBLISHED
|
|
26
|
-
JOB_CLOSED
|
|
27
|
-
JOB_DEACTIVATED
|
|
28
|
-
|
|
29
|
-
EVALUATION_PLAN_CREATED
|
|
30
|
-
EVALUATION_PLAN_PUBLISHED
|
|
31
|
-
EVALUATION_PLAN_DELETED
|
|
32
|
-
EVALUATION_PLAN_UPDATED
|
|
33
|
-
STATUS_CHANGED
|
|
34
|
-
|
|
35
|
-
CUSTOM
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
enum ActivityEntityType {
|
|
39
|
-
APPLICATION
|
|
40
|
-
|
|
41
|
-
CANDIDATE
|
|
42
|
-
|
|
43
|
-
JOB
|
|
44
|
-
|
|
45
|
-
ONGOING_EVALUATION
|
|
46
|
-
|
|
47
|
-
EVALUATION_PLAN
|
|
48
|
-
|
|
49
|
-
INTERVIEW
|
|
50
|
-
|
|
51
|
-
ASSESSMENT
|
|
52
|
-
|
|
53
|
-
ORGANISATION
|
|
54
|
-
|
|
55
|
-
USER
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
enum ActivityEntityActorType {
|
|
59
|
-
USER
|
|
60
|
-
|
|
61
|
-
SYSTEM
|
|
62
|
-
|
|
63
|
-
AI_AGENT
|
|
64
|
-
|
|
65
|
-
WEBHOOK
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
model ActivityEvent {
|
|
69
|
-
id String @id @default(uuid())
|
|
70
|
-
|
|
71
|
-
organisation_id String?
|
|
72
|
-
|
|
73
|
-
event_type ActivityEventType
|
|
74
|
-
|
|
75
|
-
entity_type ActivityEntityType
|
|
76
|
-
entity_id String
|
|
77
|
-
|
|
78
|
-
actor_id String?
|
|
79
|
-
actor_type ActivityEntityActorType
|
|
80
|
-
|
|
81
|
-
related_entities Json?
|
|
82
|
-
|
|
83
|
-
snapshot Json?
|
|
84
|
-
|
|
85
|
-
payload Json?
|
|
86
|
-
|
|
87
|
-
schema_version Int @default(1)
|
|
88
|
-
|
|
89
|
-
occurred_at DateTime
|
|
90
|
-
|
|
91
|
-
created_at DateTime @default(now())
|
|
92
|
-
|
|
93
|
-
organisation Organisation? @relation(fields: [organisation_id], references: [id])
|
|
94
|
-
|
|
95
|
-
@@index([organisation_id, occurred_at])
|
|
96
|
-
@@index([organisation_id, event_type])
|
|
97
|
-
@@index([entity_type, entity_id])
|
|
98
|
-
@@index([actor_id])
|
|
99
|
-
@@index([occurred_at])
|
|
100
|
-
@@map("activity_events")
|
|
101
|
-
}
|