@trycompai/db 1.3.17 → 1.3.18
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/dist/postinstall.d.ts +11 -0
- package/dist/postinstall.d.ts.map +1 -0
- package/dist/postinstall.js +138 -0
- package/dist/schema.prisma +759 -472
- package/package.json +8 -3
package/dist/schema.prisma
CHANGED
|
@@ -14,161 +14,165 @@ datasource db {
|
|
|
14
14
|
|
|
15
15
|
// ===== attachments.prisma =====
|
|
16
16
|
model Attachment {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('att'::text)"))
|
|
18
|
+
name String
|
|
19
|
+
url String
|
|
20
|
+
type AttachmentType
|
|
21
|
+
entityId String
|
|
22
|
+
entityType AttachmentEntityType
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
// Dates
|
|
25
|
+
createdAt DateTime @default(now())
|
|
26
|
+
updatedAt DateTime @updatedAt
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
// Relationships
|
|
29
|
+
organizationId String
|
|
30
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
31
|
+
comment Comment? @relation(fields: [commentId], references: [id])
|
|
32
|
+
commentId String?
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
@@index([entityId, entityType])
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
enum AttachmentEntityType {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
task
|
|
39
|
+
vendor
|
|
40
|
+
risk
|
|
41
|
+
comment
|
|
42
|
+
trust_nda
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
enum AttachmentType {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
image
|
|
47
|
+
video
|
|
48
|
+
audio
|
|
49
|
+
document
|
|
50
|
+
other
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
|
|
53
54
|
// ===== auth.prisma =====
|
|
54
55
|
model User {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
56
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('usr'::text)"))
|
|
57
|
+
name String
|
|
58
|
+
email String
|
|
59
|
+
emailVerified Boolean
|
|
60
|
+
image String?
|
|
61
|
+
createdAt DateTime @default(now())
|
|
62
|
+
updatedAt DateTime @updatedAt
|
|
63
|
+
lastLogin DateTime?
|
|
64
|
+
|
|
65
|
+
accounts Account[]
|
|
66
|
+
auditLog AuditLog[]
|
|
67
|
+
integrationResults IntegrationResult[]
|
|
68
|
+
invitations Invitation[]
|
|
69
|
+
members Member[]
|
|
70
|
+
sessions Session[]
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
@@unique([email])
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
model EmployeeTrainingVideoCompletion {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('evc'::text)"))
|
|
77
|
+
completedAt DateTime?
|
|
78
|
+
videoId String
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
memberId String
|
|
81
|
+
member Member @relation(fields: [memberId], references: [id], onDelete: Cascade)
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
@@unique([memberId, videoId])
|
|
84
|
+
@@index([memberId])
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
model Session {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('ses'::text)"))
|
|
89
|
+
expiresAt DateTime
|
|
90
|
+
token String
|
|
91
|
+
createdAt DateTime @default(now())
|
|
92
|
+
updatedAt DateTime @updatedAt
|
|
93
|
+
ipAddress String?
|
|
94
|
+
userAgent String?
|
|
95
|
+
userId String
|
|
96
|
+
activeOrganizationId String?
|
|
97
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
98
|
+
|
|
99
|
+
@@unique([token])
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
model Account {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
103
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('acc'::text)"))
|
|
104
|
+
accountId String
|
|
105
|
+
providerId String
|
|
106
|
+
userId String
|
|
107
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
108
|
+
accessToken String?
|
|
109
|
+
refreshToken String?
|
|
110
|
+
idToken String?
|
|
111
|
+
accessTokenExpiresAt DateTime?
|
|
112
|
+
refreshTokenExpiresAt DateTime?
|
|
113
|
+
scope String?
|
|
114
|
+
password String?
|
|
115
|
+
createdAt DateTime
|
|
116
|
+
updatedAt DateTime
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
model Verification {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('ver'::text)"))
|
|
121
|
+
identifier String
|
|
122
|
+
value String
|
|
123
|
+
expiresAt DateTime
|
|
124
|
+
createdAt DateTime @default(now())
|
|
125
|
+
updatedAt DateTime @updatedAt
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
// JWT Plugin - Required by Better Auth JWT plugin
|
|
128
129
|
// https://www.better-auth.com/docs/plugins/jwt
|
|
129
130
|
model Jwks {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('jwk'::text)"))
|
|
132
|
+
publicKey String
|
|
133
|
+
privateKey String
|
|
134
|
+
createdAt DateTime @default(now())
|
|
134
135
|
|
|
135
|
-
|
|
136
|
+
@@map("jwks")
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
model Member {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
department Departments @default(none)
|
|
148
|
-
isActive Boolean @default(true)
|
|
149
|
-
deactivated Boolean @default(false)
|
|
150
|
-
employeeTrainingVideoCompletion EmployeeTrainingVideoCompletion[]
|
|
151
|
-
fleetDmLabelId Int?
|
|
140
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('mem'::text)"))
|
|
141
|
+
organizationId String
|
|
142
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
143
|
+
userId String
|
|
144
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
145
|
+
role String // Purposefully a string, since BetterAuth doesn't support enums this way
|
|
146
|
+
createdAt DateTime @default(now())
|
|
152
147
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
148
|
+
department Departments @default(none)
|
|
149
|
+
isActive Boolean @default(true)
|
|
150
|
+
deactivated Boolean @default(false)
|
|
151
|
+
employeeTrainingVideoCompletion EmployeeTrainingVideoCompletion[]
|
|
152
|
+
fleetDmLabelId Int?
|
|
153
|
+
|
|
154
|
+
assignedPolicies Policy[] @relation("PolicyAssignee") // Policies where this member is an assignee
|
|
155
|
+
approvedPolicies Policy[] @relation("PolicyApprover") // Policies where this member is an approver
|
|
156
|
+
risks Risk[]
|
|
157
|
+
tasks Task[]
|
|
158
|
+
vendors Vendor[]
|
|
159
|
+
comments Comment[]
|
|
160
|
+
auditLogs AuditLog[]
|
|
161
|
+
reviewedAccessRequests TrustAccessRequest[] @relation("TrustAccessRequestReviewer")
|
|
162
|
+
issuedGrants TrustAccessGrant[] @relation("IssuedGrants")
|
|
163
|
+
revokedGrants TrustAccessGrant[] @relation("RevokedGrants")
|
|
160
164
|
}
|
|
161
165
|
|
|
162
166
|
model Invitation {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('inv'::text)"))
|
|
168
|
+
organizationId String
|
|
169
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
170
|
+
email String
|
|
171
|
+
role String // Purposefully a string, since BetterAuth doesn't support enums this way
|
|
172
|
+
status String
|
|
173
|
+
expiresAt DateTime
|
|
174
|
+
inviterId String
|
|
175
|
+
user User @relation(fields: [inviterId], references: [id], onDelete: Cascade)
|
|
172
176
|
}
|
|
173
177
|
|
|
174
178
|
// This is only for the app to consume, shouldn't be enforced by DB
|
|
@@ -182,111 +186,111 @@ enum Role {
|
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
enum PolicyStatus {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
189
|
+
draft
|
|
190
|
+
published
|
|
191
|
+
needs_review
|
|
188
192
|
}
|
|
189
193
|
|
|
190
194
|
|
|
191
195
|
// ===== automation-run.prisma =====
|
|
192
196
|
model EvidenceAutomationRun {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
197
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('ear'::text)"))
|
|
198
|
+
createdAt DateTime @default(now())
|
|
199
|
+
updatedAt DateTime @updatedAt
|
|
200
|
+
|
|
201
|
+
// Relations
|
|
202
|
+
evidenceAutomationId String
|
|
203
|
+
evidenceAutomation EvidenceAutomation @relation(fields: [evidenceAutomationId], references: [id], onDelete: Cascade)
|
|
204
|
+
|
|
205
|
+
// Run details
|
|
206
|
+
status EvidenceAutomationRunStatus @default(pending)
|
|
207
|
+
startedAt DateTime?
|
|
208
|
+
completedAt DateTime?
|
|
209
|
+
|
|
210
|
+
// Results
|
|
211
|
+
success Boolean?
|
|
212
|
+
error String?
|
|
213
|
+
logs Json?
|
|
214
|
+
output Json?
|
|
215
|
+
|
|
216
|
+
// Evaluation
|
|
217
|
+
evaluationStatus EvidenceAutomationEvaluationStatus?
|
|
218
|
+
evaluationReason String?
|
|
219
|
+
|
|
220
|
+
// Metadata
|
|
221
|
+
triggeredBy EvidenceAutomationTrigger @default(scheduled)
|
|
222
|
+
runDuration Int? // in milliseconds
|
|
223
|
+
version Int? // Version number that was executed (null = draft)
|
|
224
|
+
Task Task? @relation(fields: [taskId], references: [id])
|
|
225
|
+
taskId String?
|
|
226
|
+
|
|
227
|
+
@@index([evidenceAutomationId])
|
|
228
|
+
@@index([status])
|
|
229
|
+
@@index([createdAt])
|
|
230
|
+
@@index([version])
|
|
227
231
|
}
|
|
228
232
|
|
|
229
233
|
enum EvidenceAutomationRunStatus {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
pending
|
|
235
|
+
running
|
|
236
|
+
completed
|
|
237
|
+
failed
|
|
238
|
+
cancelled
|
|
235
239
|
}
|
|
236
240
|
|
|
237
241
|
enum EvidenceAutomationTrigger {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
242
|
+
manual
|
|
243
|
+
scheduled
|
|
244
|
+
api
|
|
241
245
|
}
|
|
242
246
|
|
|
243
247
|
enum EvidenceAutomationEvaluationStatus {
|
|
244
|
-
|
|
245
|
-
|
|
248
|
+
pass
|
|
249
|
+
fail
|
|
246
250
|
}
|
|
247
251
|
|
|
248
252
|
|
|
249
253
|
// ===== automation-version.prisma =====
|
|
250
254
|
model EvidenceAutomationVersion {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('eav'::text)"))
|
|
256
|
+
createdAt DateTime @default(now())
|
|
257
|
+
updatedAt DateTime @updatedAt
|
|
254
258
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
259
|
+
// Relations
|
|
260
|
+
evidenceAutomationId String
|
|
261
|
+
evidenceAutomation EvidenceAutomation @relation(fields: [evidenceAutomationId], references: [id], onDelete: Cascade)
|
|
258
262
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
// Version details
|
|
264
|
+
version Int // Sequential version number (1, 2, 3...)
|
|
265
|
+
scriptKey String // S3 key for this version's script
|
|
266
|
+
publishedBy String? // User ID who published
|
|
267
|
+
changelog String? // Optional description of changes
|
|
264
268
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
269
|
+
@@unique([evidenceAutomationId, version])
|
|
270
|
+
@@index([evidenceAutomationId])
|
|
271
|
+
@@index([createdAt])
|
|
268
272
|
}
|
|
269
273
|
|
|
270
274
|
|
|
271
275
|
// ===== automation.prisma =====
|
|
272
276
|
model EvidenceAutomation {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
277
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('aut'::text)"))
|
|
278
|
+
name String
|
|
279
|
+
description String?
|
|
280
|
+
createdAt DateTime @default(now())
|
|
281
|
+
isEnabled Boolean @default(false)
|
|
278
282
|
|
|
279
|
-
|
|
280
|
-
|
|
283
|
+
chatHistory String?
|
|
284
|
+
evaluationCriteria String?
|
|
281
285
|
|
|
282
|
-
|
|
283
|
-
|
|
286
|
+
taskId String
|
|
287
|
+
task Task @relation(fields: [taskId], references: [id], onDelete: Cascade)
|
|
284
288
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
289
|
+
// Relations
|
|
290
|
+
runs EvidenceAutomationRun[]
|
|
291
|
+
versions EvidenceAutomationVersion[]
|
|
288
292
|
|
|
289
|
-
|
|
293
|
+
@@index([taskId])
|
|
290
294
|
}
|
|
291
295
|
|
|
292
296
|
|
|
@@ -322,22 +326,22 @@ enum CommentEntityType {
|
|
|
322
326
|
|
|
323
327
|
// ===== context.prisma =====
|
|
324
328
|
model Context {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
329
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('ctx'::text)"))
|
|
330
|
+
organizationId String
|
|
331
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
328
332
|
|
|
329
|
-
|
|
330
|
-
|
|
333
|
+
question String
|
|
334
|
+
answer String
|
|
331
335
|
|
|
332
|
-
|
|
336
|
+
tags String[]
|
|
333
337
|
|
|
334
|
-
|
|
335
|
-
|
|
338
|
+
createdAt DateTime @default(now())
|
|
339
|
+
updatedAt DateTime @updatedAt
|
|
336
340
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
+
@@index([organizationId])
|
|
342
|
+
@@index([question])
|
|
343
|
+
@@index([answer])
|
|
344
|
+
@@index([tags])
|
|
341
345
|
}
|
|
342
346
|
|
|
343
347
|
|
|
@@ -368,99 +372,99 @@ model Control {
|
|
|
368
372
|
// ===== framework-editor.prisma =====
|
|
369
373
|
// --- Data for Framework Editor ---
|
|
370
374
|
model FrameworkEditorVideo {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
375
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_vi'::text)"))
|
|
376
|
+
title String
|
|
377
|
+
description String
|
|
378
|
+
youtubeId String
|
|
379
|
+
url String
|
|
376
380
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
381
|
+
// Dates
|
|
382
|
+
createdAt DateTime @default(now())
|
|
383
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
380
384
|
}
|
|
381
385
|
|
|
382
386
|
model FrameworkEditorFramework {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
387
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk'::text)"))
|
|
388
|
+
name String // e.g., "soc2", "iso27001"
|
|
389
|
+
version String
|
|
390
|
+
description String
|
|
391
|
+
visible Boolean @default(false)
|
|
388
392
|
|
|
389
|
-
|
|
390
|
-
|
|
393
|
+
requirements FrameworkEditorRequirement[]
|
|
394
|
+
frameworkInstances FrameworkInstance[]
|
|
391
395
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
396
|
+
// Dates
|
|
397
|
+
createdAt DateTime @default(now())
|
|
398
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
395
399
|
}
|
|
396
400
|
|
|
397
401
|
model FrameworkEditorRequirement {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
402
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_rq'::text)"))
|
|
403
|
+
frameworkId String
|
|
404
|
+
framework FrameworkEditorFramework @relation(fields: [frameworkId], references: [id])
|
|
401
405
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
406
|
+
name String // Original requirement ID within that framework, e.g., "Privacy"
|
|
407
|
+
identifier String @default("") // Unique identifier for the requirement, e.g., "cc1-1"
|
|
408
|
+
description String
|
|
405
409
|
|
|
406
|
-
|
|
407
|
-
|
|
410
|
+
controlTemplates FrameworkEditorControlTemplate[]
|
|
411
|
+
requirementMaps RequirementMap[]
|
|
408
412
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
413
|
+
// Dates
|
|
414
|
+
createdAt DateTime @default(now())
|
|
415
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
412
416
|
}
|
|
413
417
|
|
|
414
418
|
model FrameworkEditorPolicyTemplate {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_pt'::text)"))
|
|
420
|
+
name String
|
|
421
|
+
description String
|
|
422
|
+
frequency Frequency // Using the enum from shared.prisma
|
|
423
|
+
department Departments // Using the enum from shared.prisma
|
|
424
|
+
content Json
|
|
421
425
|
|
|
422
|
-
|
|
426
|
+
controlTemplates FrameworkEditorControlTemplate[]
|
|
423
427
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
428
|
+
// Dates
|
|
429
|
+
createdAt DateTime @default(now())
|
|
430
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
427
431
|
|
|
428
|
-
|
|
429
|
-
|
|
432
|
+
// Instances
|
|
433
|
+
policies Policy[]
|
|
430
434
|
}
|
|
431
435
|
|
|
432
436
|
model FrameworkEditorTaskTemplate {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
437
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_tt'::text)"))
|
|
438
|
+
name String
|
|
439
|
+
description String
|
|
440
|
+
frequency Frequency // Using the enum from shared.prisma
|
|
441
|
+
department Departments // Using the enum from shared.prisma
|
|
438
442
|
|
|
439
|
-
|
|
443
|
+
controlTemplates FrameworkEditorControlTemplate[]
|
|
440
444
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
445
|
+
// Dates
|
|
446
|
+
createdAt DateTime @default(now())
|
|
447
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
444
448
|
|
|
445
|
-
|
|
446
|
-
|
|
449
|
+
// Instances
|
|
450
|
+
tasks Task[]
|
|
447
451
|
}
|
|
448
452
|
|
|
449
453
|
model FrameworkEditorControlTemplate {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
454
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_ct'::text)"))
|
|
455
|
+
name String
|
|
456
|
+
description String
|
|
453
457
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
458
|
+
policyTemplates FrameworkEditorPolicyTemplate[]
|
|
459
|
+
requirements FrameworkEditorRequirement[]
|
|
460
|
+
taskTemplates FrameworkEditorTaskTemplate[]
|
|
457
461
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
462
|
+
// Dates
|
|
463
|
+
createdAt DateTime @default(now())
|
|
464
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
461
465
|
|
|
462
|
-
|
|
463
|
-
|
|
466
|
+
// Instances
|
|
467
|
+
controls Control[]
|
|
464
468
|
}
|
|
465
469
|
|
|
466
470
|
|
|
@@ -516,24 +520,59 @@ model IntegrationResult {
|
|
|
516
520
|
}
|
|
517
521
|
|
|
518
522
|
|
|
523
|
+
// ===== knowledge-base-document.prisma =====
|
|
524
|
+
model KnowledgeBaseDocument {
|
|
525
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('kbd'::text)"))
|
|
526
|
+
name String // Original filename
|
|
527
|
+
description String? // Optional user description/notes
|
|
528
|
+
s3Key String // S3 storage key (e.g., "org123/knowledge-base-documents/timestamp-file.pdf")
|
|
529
|
+
fileType String // MIME type (e.g., "application/pdf")
|
|
530
|
+
fileSize Int // File size in bytes
|
|
531
|
+
processingStatus KnowledgeBaseDocumentProcessingStatus @default(pending) // Track indexing status
|
|
532
|
+
processedAt DateTime? // When indexing completed
|
|
533
|
+
triggerRunId String? // Trigger.dev run ID for tracking processing progress
|
|
534
|
+
|
|
535
|
+
// Dates
|
|
536
|
+
createdAt DateTime @default(now())
|
|
537
|
+
updatedAt DateTime @updatedAt
|
|
538
|
+
|
|
539
|
+
// Relationships
|
|
540
|
+
organizationId String
|
|
541
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
542
|
+
|
|
543
|
+
@@index([organizationId])
|
|
544
|
+
@@index([organizationId, processingStatus])
|
|
545
|
+
@@index([s3Key])
|
|
546
|
+
@@index([triggerRunId])
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
enum KnowledgeBaseDocumentProcessingStatus {
|
|
550
|
+
pending // Uploaded but not yet processed/indexed
|
|
551
|
+
processing // Currently being processed/indexed
|
|
552
|
+
completed // Successfully indexed in vector database
|
|
553
|
+
failed // Processing failed
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
519
558
|
// ===== onboarding.prisma =====
|
|
520
559
|
model Onboarding {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
560
|
+
organizationId String @id
|
|
561
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
562
|
+
policies Boolean @default(false)
|
|
563
|
+
employees Boolean @default(false)
|
|
564
|
+
vendors Boolean @default(false)
|
|
565
|
+
integrations Boolean @default(false)
|
|
566
|
+
risk Boolean @default(false)
|
|
567
|
+
team Boolean @default(false)
|
|
568
|
+
tasks Boolean @default(false)
|
|
569
|
+
callBooked Boolean @default(false)
|
|
570
|
+
companyBookingDetails Json?
|
|
571
|
+
companyDetails Json?
|
|
572
|
+
triggerJobId String?
|
|
573
|
+
triggerJobCompleted Boolean @default(false)
|
|
535
574
|
|
|
536
|
-
|
|
575
|
+
@@index([organizationId])
|
|
537
576
|
}
|
|
538
577
|
|
|
539
578
|
|
|
@@ -555,22 +594,28 @@ model Organization {
|
|
|
555
594
|
fleetDmLabelId Int?
|
|
556
595
|
isFleetSetupCompleted Boolean @default(false)
|
|
557
596
|
|
|
558
|
-
apiKeys
|
|
559
|
-
auditLog
|
|
560
|
-
controls
|
|
561
|
-
frameworkInstances
|
|
562
|
-
integrations
|
|
563
|
-
invitations
|
|
564
|
-
members
|
|
565
|
-
policy
|
|
566
|
-
risk
|
|
567
|
-
vendors
|
|
568
|
-
tasks
|
|
569
|
-
comments
|
|
570
|
-
attachments
|
|
571
|
-
trust
|
|
572
|
-
context
|
|
573
|
-
secrets
|
|
597
|
+
apiKeys ApiKey[]
|
|
598
|
+
auditLog AuditLog[]
|
|
599
|
+
controls Control[]
|
|
600
|
+
frameworkInstances FrameworkInstance[]
|
|
601
|
+
integrations Integration[]
|
|
602
|
+
invitations Invitation[]
|
|
603
|
+
members Member[]
|
|
604
|
+
policy Policy[]
|
|
605
|
+
risk Risk[]
|
|
606
|
+
vendors Vendor[]
|
|
607
|
+
tasks Task[]
|
|
608
|
+
comments Comment[]
|
|
609
|
+
attachments Attachment[]
|
|
610
|
+
trust Trust[]
|
|
611
|
+
context Context[]
|
|
612
|
+
secrets Secret[]
|
|
613
|
+
trustAccessRequests TrustAccessRequest[]
|
|
614
|
+
trustNdaAgreements TrustNDAAgreement[]
|
|
615
|
+
trustDocuments TrustDocument[]
|
|
616
|
+
knowledgeBaseDocuments KnowledgeBaseDocument[]
|
|
617
|
+
questionnaires Questionnaire[]
|
|
618
|
+
securityQuestionnaireManualAnswers SecurityQuestionnaireManualAnswer[]
|
|
574
619
|
|
|
575
620
|
@@index([slug])
|
|
576
621
|
}
|
|
@@ -618,21 +663,85 @@ model Policy {
|
|
|
618
663
|
}
|
|
619
664
|
|
|
620
665
|
|
|
666
|
+
// ===== questionnaire.prisma =====
|
|
667
|
+
model Questionnaire {
|
|
668
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('qst'::text)"))
|
|
669
|
+
filename String // Original filename
|
|
670
|
+
s3Key String // S3 storage key for the uploaded file
|
|
671
|
+
fileType String // MIME type (e.g., "application/pdf")
|
|
672
|
+
fileSize Int // File size in bytes
|
|
673
|
+
status QuestionnaireStatus @default(parsing) // Parsing status
|
|
674
|
+
parsedAt DateTime? // When parsing completed
|
|
675
|
+
totalQuestions Int @default(0) // Total number of questions parsed
|
|
676
|
+
answeredQuestions Int @default(0) // Number of questions with answers
|
|
677
|
+
|
|
678
|
+
// Dates
|
|
679
|
+
createdAt DateTime @default(now())
|
|
680
|
+
updatedAt DateTime @updatedAt
|
|
681
|
+
|
|
682
|
+
// Relationships
|
|
683
|
+
organizationId String
|
|
684
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
685
|
+
questions QuestionnaireQuestionAnswer[]
|
|
686
|
+
manualAnswers SecurityQuestionnaireManualAnswer[] // Manual answers saved from this questionnaire
|
|
687
|
+
|
|
688
|
+
@@index([organizationId])
|
|
689
|
+
@@index([organizationId, createdAt])
|
|
690
|
+
@@index([status])
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
model QuestionnaireQuestionAnswer {
|
|
694
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('qqa'::text)"))
|
|
695
|
+
question String // The question text
|
|
696
|
+
answer String? // The answer (nullable if not provided in file or not generated yet)
|
|
697
|
+
status QuestionnaireAnswerStatus @default(untouched) // Answer status
|
|
698
|
+
questionIndex Int // Order/index of the question in the questionnaire
|
|
699
|
+
sources Json? // Sources used for generated answers (array of source objects)
|
|
700
|
+
generatedAt DateTime? // When answer was generated (if status is generated)
|
|
701
|
+
updatedBy String? // User ID who last updated the answer (if manual)
|
|
702
|
+
|
|
703
|
+
// Dates
|
|
704
|
+
createdAt DateTime @default(now())
|
|
705
|
+
updatedAt DateTime @updatedAt
|
|
706
|
+
|
|
707
|
+
// Relationships
|
|
708
|
+
questionnaireId String
|
|
709
|
+
questionnaire Questionnaire @relation(fields: [questionnaireId], references: [id], onDelete: Cascade)
|
|
710
|
+
|
|
711
|
+
@@index([questionnaireId])
|
|
712
|
+
@@index([questionnaireId, questionIndex])
|
|
713
|
+
@@index([status])
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
enum QuestionnaireStatus {
|
|
717
|
+
parsing // Currently being parsed
|
|
718
|
+
completed // Successfully parsed
|
|
719
|
+
failed // Parsing failed
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
enum QuestionnaireAnswerStatus {
|
|
723
|
+
untouched // No answer yet (empty or not generated)
|
|
724
|
+
generated // AI generated answer
|
|
725
|
+
manual // Manually written/edited by user
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
|
|
621
730
|
// ===== requirement.prisma =====
|
|
622
731
|
model RequirementMap {
|
|
623
|
-
|
|
732
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('req'::text)"))
|
|
624
733
|
|
|
625
|
-
|
|
626
|
-
|
|
734
|
+
requirementId String
|
|
735
|
+
requirement FrameworkEditorRequirement @relation(fields: [requirementId], references: [id], onDelete: Cascade)
|
|
627
736
|
|
|
628
|
-
|
|
629
|
-
|
|
737
|
+
controlId String
|
|
738
|
+
control Control @relation(fields: [controlId], references: [id], onDelete: Cascade)
|
|
630
739
|
|
|
631
|
-
|
|
632
|
-
|
|
740
|
+
frameworkInstanceId String
|
|
741
|
+
frameworkInstance FrameworkInstance @relation(fields: [frameworkInstanceId], references: [id], onDelete: Cascade)
|
|
633
742
|
|
|
634
|
-
|
|
635
|
-
|
|
743
|
+
@@unique([controlId, frameworkInstanceId, requirementId])
|
|
744
|
+
@@index([requirementId, frameworkInstanceId])
|
|
636
745
|
}
|
|
637
746
|
|
|
638
747
|
|
|
@@ -699,228 +808,406 @@ enum RiskStatus {
|
|
|
699
808
|
|
|
700
809
|
// ===== secret.prisma =====
|
|
701
810
|
model Secret {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
811
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('sec'::text)"))
|
|
812
|
+
organizationId String @map("organization_id")
|
|
813
|
+
name String
|
|
814
|
+
value String @db.Text // Encrypted value
|
|
815
|
+
description String? @db.Text
|
|
816
|
+
category String? // e.g., "api", "webhook", "database", etc.
|
|
817
|
+
lastUsedAt DateTime? @map("last_used_at")
|
|
818
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
819
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
820
|
+
|
|
821
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
822
|
+
|
|
823
|
+
@@unique([organizationId, name])
|
|
824
|
+
@@map("secrets")
|
|
825
|
+
}
|
|
711
826
|
|
|
712
|
-
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
713
827
|
|
|
714
|
-
|
|
715
|
-
|
|
828
|
+
// ===== security-questionnaire-manual-answer.prisma =====
|
|
829
|
+
model SecurityQuestionnaireManualAnswer {
|
|
830
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('sqma'::text)"))
|
|
831
|
+
question String // The question text
|
|
832
|
+
answer String // The answer text (required for saved answers)
|
|
833
|
+
tags String[] @default([]) // Optional tags for categorization
|
|
834
|
+
|
|
835
|
+
// Optional reference to original questionnaire (for tracking)
|
|
836
|
+
sourceQuestionnaireId String?
|
|
837
|
+
sourceQuestionnaire Questionnaire? @relation(fields: [sourceQuestionnaireId], references: [id], onDelete: SetNull)
|
|
838
|
+
|
|
839
|
+
// User who created/updated this answer
|
|
840
|
+
createdBy String? // User ID
|
|
841
|
+
updatedBy String? // User ID
|
|
842
|
+
|
|
843
|
+
// Dates
|
|
844
|
+
createdAt DateTime @default(now())
|
|
845
|
+
updatedAt DateTime @updatedAt
|
|
846
|
+
|
|
847
|
+
// Relationships
|
|
848
|
+
organizationId String
|
|
849
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
850
|
+
|
|
851
|
+
@@index([organizationId])
|
|
852
|
+
@@index([organizationId, question])
|
|
853
|
+
@@index([tags])
|
|
854
|
+
@@index([createdAt])
|
|
855
|
+
@@unique([organizationId, question]) // Prevent duplicate questions per organization
|
|
716
856
|
}
|
|
717
857
|
|
|
718
858
|
|
|
859
|
+
|
|
719
860
|
// ===== shared.prisma =====
|
|
720
861
|
model ApiKey {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
862
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('apk'::text)"))
|
|
863
|
+
name String
|
|
864
|
+
key String @unique
|
|
865
|
+
salt String?
|
|
866
|
+
createdAt DateTime @default(now())
|
|
867
|
+
expiresAt DateTime?
|
|
868
|
+
lastUsedAt DateTime?
|
|
869
|
+
isActive Boolean @default(true)
|
|
729
870
|
|
|
730
|
-
|
|
731
|
-
|
|
871
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
872
|
+
organizationId String
|
|
732
873
|
|
|
733
|
-
|
|
734
|
-
|
|
874
|
+
@@index([organizationId])
|
|
875
|
+
@@index([key])
|
|
735
876
|
}
|
|
736
877
|
|
|
737
878
|
model AuditLog {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
879
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('aud'::text)"))
|
|
880
|
+
timestamp DateTime @default(now())
|
|
881
|
+
organizationId String
|
|
882
|
+
userId String
|
|
883
|
+
memberId String?
|
|
884
|
+
data Json
|
|
885
|
+
description String?
|
|
886
|
+
entityId String?
|
|
887
|
+
entityType AuditLogEntityType?
|
|
888
|
+
|
|
889
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
890
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
891
|
+
member Member? @relation(fields: [memberId], references: [id], onDelete: Cascade)
|
|
892
|
+
|
|
893
|
+
@@index([userId])
|
|
894
|
+
@@index([organizationId])
|
|
895
|
+
@@index([memberId])
|
|
896
|
+
@@index([entityType])
|
|
756
897
|
}
|
|
757
898
|
|
|
758
899
|
enum AuditLogEntityType {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
900
|
+
organization
|
|
901
|
+
framework
|
|
902
|
+
requirement
|
|
903
|
+
control
|
|
904
|
+
policy
|
|
905
|
+
task
|
|
906
|
+
people
|
|
907
|
+
risk
|
|
908
|
+
vendor
|
|
909
|
+
tests
|
|
910
|
+
integration
|
|
911
|
+
trust
|
|
770
912
|
}
|
|
771
913
|
|
|
772
914
|
model GlobalVendors {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
915
|
+
website String @id @unique
|
|
916
|
+
company_name String?
|
|
917
|
+
legal_name String?
|
|
918
|
+
company_description String?
|
|
919
|
+
company_hq_address String?
|
|
920
|
+
privacy_policy_url String?
|
|
921
|
+
terms_of_service_url String?
|
|
922
|
+
service_level_agreement_url String?
|
|
923
|
+
security_page_url String?
|
|
924
|
+
trust_page_url String?
|
|
925
|
+
security_certifications String[]
|
|
926
|
+
subprocessors String[]
|
|
927
|
+
type_of_company String?
|
|
928
|
+
|
|
929
|
+
approved Boolean @default(false)
|
|
930
|
+
createdAt DateTime @default(now())
|
|
931
|
+
|
|
932
|
+
@@index([website])
|
|
791
933
|
}
|
|
792
934
|
|
|
793
935
|
enum Departments {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
936
|
+
none
|
|
937
|
+
admin
|
|
938
|
+
gov
|
|
939
|
+
hr
|
|
940
|
+
it
|
|
941
|
+
itsm
|
|
942
|
+
qms
|
|
801
943
|
}
|
|
802
944
|
|
|
803
945
|
enum Frequency {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
946
|
+
monthly
|
|
947
|
+
quarterly
|
|
948
|
+
yearly
|
|
807
949
|
}
|
|
808
950
|
|
|
809
951
|
enum Likelihood {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
952
|
+
very_unlikely
|
|
953
|
+
unlikely
|
|
954
|
+
possible
|
|
955
|
+
likely
|
|
956
|
+
very_likely
|
|
815
957
|
}
|
|
816
958
|
|
|
817
959
|
enum Impact {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
960
|
+
insignificant
|
|
961
|
+
minor
|
|
962
|
+
moderate
|
|
963
|
+
major
|
|
964
|
+
severe
|
|
823
965
|
}
|
|
824
966
|
|
|
825
967
|
|
|
826
968
|
// ===== task.prisma =====
|
|
827
969
|
model Task {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
970
|
+
// Metadata
|
|
971
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('tsk'::text)"))
|
|
972
|
+
title String
|
|
973
|
+
description String
|
|
974
|
+
status TaskStatus @default(todo)
|
|
975
|
+
frequency TaskFrequency?
|
|
976
|
+
department Departments? @default(none)
|
|
977
|
+
order Int @default(0)
|
|
978
|
+
|
|
979
|
+
// Dates
|
|
980
|
+
createdAt DateTime @default(now())
|
|
981
|
+
updatedAt DateTime @updatedAt
|
|
982
|
+
lastCompletedAt DateTime?
|
|
983
|
+
reviewDate DateTime?
|
|
984
|
+
|
|
985
|
+
// Relationships
|
|
986
|
+
assigneeId String?
|
|
987
|
+
assignee Member? @relation(fields: [assigneeId], references: [id])
|
|
988
|
+
organizationId String
|
|
989
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
990
|
+
taskTemplateId String?
|
|
991
|
+
taskTemplate FrameworkEditorTaskTemplate? @relation(fields: [taskTemplateId], references: [id])
|
|
992
|
+
controls Control[]
|
|
993
|
+
vendors Vendor[]
|
|
994
|
+
risks Risk[]
|
|
995
|
+
evidenceAutomations EvidenceAutomation[]
|
|
996
|
+
|
|
997
|
+
EvidenceAutomationRun EvidenceAutomationRun[]
|
|
856
998
|
}
|
|
857
999
|
|
|
858
1000
|
enum TaskStatus {
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
1001
|
+
todo
|
|
1002
|
+
in_progress
|
|
1003
|
+
done
|
|
1004
|
+
not_relevant
|
|
1005
|
+
failed
|
|
864
1006
|
}
|
|
865
1007
|
|
|
866
1008
|
enum TaskFrequency {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
1009
|
+
daily
|
|
1010
|
+
weekly
|
|
1011
|
+
monthly
|
|
1012
|
+
quarterly
|
|
1013
|
+
yearly
|
|
872
1014
|
}
|
|
873
1015
|
|
|
874
1016
|
|
|
875
1017
|
// ===== trust.prisma =====
|
|
876
1018
|
model Trust {
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1019
|
+
organizationId String
|
|
1020
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
1021
|
+
friendlyUrl String? @unique
|
|
1022
|
+
domain String?
|
|
1023
|
+
domainVerified Boolean @default(false)
|
|
1024
|
+
isVercelDomain Boolean @default(false)
|
|
1025
|
+
vercelVerification String?
|
|
1026
|
+
status TrustStatus @default(draft)
|
|
1027
|
+
contactEmail String?
|
|
1028
|
+
|
|
1029
|
+
email String?
|
|
1030
|
+
privacyPolicy String?
|
|
1031
|
+
soc2 Boolean @default(false)
|
|
1032
|
+
soc2type1 Boolean @default(false)
|
|
1033
|
+
soc2type2 Boolean @default(false)
|
|
1034
|
+
iso27001 Boolean @default(false)
|
|
1035
|
+
iso42001 Boolean @default(false)
|
|
1036
|
+
nen7510 Boolean @default(false)
|
|
1037
|
+
gdpr Boolean @default(false)
|
|
1038
|
+
hipaa Boolean @default(false)
|
|
1039
|
+
pci_dss Boolean @default(false)
|
|
1040
|
+
iso9001 Boolean @default(false)
|
|
1041
|
+
|
|
1042
|
+
soc2_status FrameworkStatus @default(started)
|
|
1043
|
+
soc2type1_status FrameworkStatus @default(started)
|
|
1044
|
+
soc2type2_status FrameworkStatus @default(started)
|
|
1045
|
+
iso27001_status FrameworkStatus @default(started)
|
|
1046
|
+
iso42001_status FrameworkStatus @default(started)
|
|
1047
|
+
nen7510_status FrameworkStatus @default(started)
|
|
1048
|
+
gdpr_status FrameworkStatus @default(started)
|
|
1049
|
+
hipaa_status FrameworkStatus @default(started)
|
|
1050
|
+
pci_dss_status FrameworkStatus @default(started)
|
|
1051
|
+
iso9001_status FrameworkStatus @default(started)
|
|
1052
|
+
|
|
1053
|
+
@@id([status, organizationId])
|
|
1054
|
+
@@unique([organizationId])
|
|
1055
|
+
@@index([organizationId])
|
|
1056
|
+
@@index([friendlyUrl])
|
|
913
1057
|
}
|
|
914
1058
|
|
|
915
1059
|
enum TrustStatus {
|
|
916
|
-
|
|
917
|
-
|
|
1060
|
+
draft
|
|
1061
|
+
published
|
|
918
1062
|
}
|
|
919
1063
|
|
|
920
1064
|
enum FrameworkStatus {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1065
|
+
started
|
|
1066
|
+
in_progress
|
|
1067
|
+
compliant
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
model TrustAccessRequest {
|
|
1071
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('tar'::text)"))
|
|
1072
|
+
organizationId String
|
|
1073
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
1074
|
+
|
|
1075
|
+
name String
|
|
1076
|
+
email String
|
|
1077
|
+
company String?
|
|
1078
|
+
jobTitle String?
|
|
1079
|
+
purpose String?
|
|
1080
|
+
requestedDurationDays Int?
|
|
1081
|
+
|
|
1082
|
+
status TrustAccessRequestStatus @default(under_review)
|
|
1083
|
+
reviewerMemberId String?
|
|
1084
|
+
reviewer Member? @relation("TrustAccessRequestReviewer", fields: [reviewerMemberId], references: [id], onDelete: SetNull)
|
|
1085
|
+
reviewedAt DateTime?
|
|
1086
|
+
decisionReason String?
|
|
1087
|
+
|
|
1088
|
+
ipAddress String?
|
|
1089
|
+
userAgent String?
|
|
1090
|
+
|
|
1091
|
+
createdAt DateTime @default(now())
|
|
1092
|
+
updatedAt DateTime @updatedAt
|
|
1093
|
+
|
|
1094
|
+
grant TrustAccessGrant? @relation("RequestGrant")
|
|
1095
|
+
ndaAgreements TrustNDAAgreement[] @relation("RequestNDA")
|
|
1096
|
+
|
|
1097
|
+
@@index([organizationId])
|
|
1098
|
+
@@index([email])
|
|
1099
|
+
@@index([status])
|
|
1100
|
+
@@index([organizationId, status])
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
model TrustAccessGrant {
|
|
1104
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('tag'::text)"))
|
|
1105
|
+
|
|
1106
|
+
accessRequestId String @unique
|
|
1107
|
+
accessRequest TrustAccessRequest @relation("RequestGrant", fields: [accessRequestId], references: [id], onDelete: Cascade)
|
|
1108
|
+
|
|
1109
|
+
subjectEmail String
|
|
1110
|
+
|
|
1111
|
+
status TrustAccessGrantStatus @default(active)
|
|
1112
|
+
expiresAt DateTime
|
|
1113
|
+
|
|
1114
|
+
accessToken String? @unique
|
|
1115
|
+
accessTokenExpiresAt DateTime?
|
|
1116
|
+
|
|
1117
|
+
issuedByMemberId String?
|
|
1118
|
+
issuedBy Member? @relation("IssuedGrants", fields: [issuedByMemberId], references: [id], onDelete: SetNull)
|
|
1119
|
+
|
|
1120
|
+
revokedAt DateTime?
|
|
1121
|
+
revokedByMemberId String?
|
|
1122
|
+
revokedBy Member? @relation("RevokedGrants", fields: [revokedByMemberId], references: [id], onDelete: SetNull)
|
|
1123
|
+
revokeReason String?
|
|
1124
|
+
|
|
1125
|
+
createdAt DateTime @default(now())
|
|
1126
|
+
updatedAt DateTime @updatedAt
|
|
1127
|
+
|
|
1128
|
+
ndaAgreement TrustNDAAgreement? @relation("GrantNDA")
|
|
1129
|
+
|
|
1130
|
+
@@index([accessRequestId])
|
|
1131
|
+
@@index([subjectEmail])
|
|
1132
|
+
@@index([status])
|
|
1133
|
+
@@index([expiresAt])
|
|
1134
|
+
@@index([status, expiresAt])
|
|
1135
|
+
@@index([accessToken])
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
enum TrustAccessRequestStatus {
|
|
1139
|
+
under_review
|
|
1140
|
+
approved
|
|
1141
|
+
denied
|
|
1142
|
+
canceled
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
enum TrustAccessGrantStatus {
|
|
1146
|
+
active
|
|
1147
|
+
expired
|
|
1148
|
+
revoked
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
model TrustNDAAgreement {
|
|
1152
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('tna'::text)"))
|
|
1153
|
+
|
|
1154
|
+
organizationId String
|
|
1155
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
1156
|
+
|
|
1157
|
+
accessRequestId String
|
|
1158
|
+
accessRequest TrustAccessRequest @relation("RequestNDA", fields: [accessRequestId], references: [id], onDelete: Cascade)
|
|
1159
|
+
|
|
1160
|
+
grantId String? @unique
|
|
1161
|
+
grant TrustAccessGrant? @relation("GrantNDA", fields: [grantId], references: [id], onDelete: SetNull)
|
|
1162
|
+
|
|
1163
|
+
signerName String?
|
|
1164
|
+
signerEmail String?
|
|
1165
|
+
|
|
1166
|
+
status TrustNDAStatus @default(pending)
|
|
1167
|
+
|
|
1168
|
+
signToken String @unique
|
|
1169
|
+
signTokenExpiresAt DateTime
|
|
1170
|
+
|
|
1171
|
+
pdfTemplateKey String?
|
|
1172
|
+
pdfSignedKey String?
|
|
1173
|
+
|
|
1174
|
+
signedAt DateTime?
|
|
1175
|
+
|
|
1176
|
+
ipAddress String?
|
|
1177
|
+
userAgent String?
|
|
1178
|
+
|
|
1179
|
+
createdAt DateTime @default(now())
|
|
1180
|
+
updatedAt DateTime @updatedAt
|
|
1181
|
+
|
|
1182
|
+
@@index([organizationId])
|
|
1183
|
+
@@index([accessRequestId])
|
|
1184
|
+
@@index([signToken])
|
|
1185
|
+
@@index([status])
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
enum TrustNDAStatus {
|
|
1189
|
+
pending
|
|
1190
|
+
signed
|
|
1191
|
+
void
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
model TrustDocument {
|
|
1195
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('tdoc'::text)"))
|
|
1196
|
+
|
|
1197
|
+
organizationId String
|
|
1198
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
1199
|
+
|
|
1200
|
+
name String
|
|
1201
|
+
description String?
|
|
1202
|
+
s3Key String
|
|
1203
|
+
|
|
1204
|
+
isActive Boolean @default(true)
|
|
1205
|
+
|
|
1206
|
+
createdAt DateTime @default(now())
|
|
1207
|
+
updatedAt DateTime @updatedAt
|
|
1208
|
+
|
|
1209
|
+
@@index([organizationId])
|
|
1210
|
+
@@index([organizationId, isActive])
|
|
924
1211
|
}
|
|
925
1212
|
|
|
926
1213
|
|