@trycompai/db 1.3.16 → 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 +760 -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
|
|
@@ -178,114 +182,115 @@ enum Role {
|
|
|
178
182
|
admin
|
|
179
183
|
auditor
|
|
180
184
|
employee
|
|
185
|
+
contractor
|
|
181
186
|
}
|
|
182
187
|
|
|
183
188
|
enum PolicyStatus {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
189
|
+
draft
|
|
190
|
+
published
|
|
191
|
+
needs_review
|
|
187
192
|
}
|
|
188
193
|
|
|
189
194
|
|
|
190
195
|
// ===== automation-run.prisma =====
|
|
191
196
|
model EvidenceAutomationRun {
|
|
192
|
-
|
|
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
|
-
|
|
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])
|
|
226
231
|
}
|
|
227
232
|
|
|
228
233
|
enum EvidenceAutomationRunStatus {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
+
pending
|
|
235
|
+
running
|
|
236
|
+
completed
|
|
237
|
+
failed
|
|
238
|
+
cancelled
|
|
234
239
|
}
|
|
235
240
|
|
|
236
241
|
enum EvidenceAutomationTrigger {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
242
|
+
manual
|
|
243
|
+
scheduled
|
|
244
|
+
api
|
|
240
245
|
}
|
|
241
246
|
|
|
242
247
|
enum EvidenceAutomationEvaluationStatus {
|
|
243
|
-
|
|
244
|
-
|
|
248
|
+
pass
|
|
249
|
+
fail
|
|
245
250
|
}
|
|
246
251
|
|
|
247
252
|
|
|
248
253
|
// ===== automation-version.prisma =====
|
|
249
254
|
model EvidenceAutomationVersion {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
255
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('eav'::text)"))
|
|
256
|
+
createdAt DateTime @default(now())
|
|
257
|
+
updatedAt DateTime @updatedAt
|
|
253
258
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
// Relations
|
|
260
|
+
evidenceAutomationId String
|
|
261
|
+
evidenceAutomation EvidenceAutomation @relation(fields: [evidenceAutomationId], references: [id], onDelete: Cascade)
|
|
257
262
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
|
263
268
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
269
|
+
@@unique([evidenceAutomationId, version])
|
|
270
|
+
@@index([evidenceAutomationId])
|
|
271
|
+
@@index([createdAt])
|
|
267
272
|
}
|
|
268
273
|
|
|
269
274
|
|
|
270
275
|
// ===== automation.prisma =====
|
|
271
276
|
model EvidenceAutomation {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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)
|
|
277
282
|
|
|
278
|
-
|
|
279
|
-
|
|
283
|
+
chatHistory String?
|
|
284
|
+
evaluationCriteria String?
|
|
280
285
|
|
|
281
|
-
|
|
282
|
-
|
|
286
|
+
taskId String
|
|
287
|
+
task Task @relation(fields: [taskId], references: [id], onDelete: Cascade)
|
|
283
288
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
289
|
+
// Relations
|
|
290
|
+
runs EvidenceAutomationRun[]
|
|
291
|
+
versions EvidenceAutomationVersion[]
|
|
287
292
|
|
|
288
|
-
|
|
293
|
+
@@index([taskId])
|
|
289
294
|
}
|
|
290
295
|
|
|
291
296
|
|
|
@@ -321,22 +326,22 @@ enum CommentEntityType {
|
|
|
321
326
|
|
|
322
327
|
// ===== context.prisma =====
|
|
323
328
|
model Context {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
329
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('ctx'::text)"))
|
|
330
|
+
organizationId String
|
|
331
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
327
332
|
|
|
328
|
-
|
|
329
|
-
|
|
333
|
+
question String
|
|
334
|
+
answer String
|
|
330
335
|
|
|
331
|
-
|
|
336
|
+
tags String[]
|
|
332
337
|
|
|
333
|
-
|
|
334
|
-
|
|
338
|
+
createdAt DateTime @default(now())
|
|
339
|
+
updatedAt DateTime @updatedAt
|
|
335
340
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
341
|
+
@@index([organizationId])
|
|
342
|
+
@@index([question])
|
|
343
|
+
@@index([answer])
|
|
344
|
+
@@index([tags])
|
|
340
345
|
}
|
|
341
346
|
|
|
342
347
|
|
|
@@ -367,99 +372,99 @@ model Control {
|
|
|
367
372
|
// ===== framework-editor.prisma =====
|
|
368
373
|
// --- Data for Framework Editor ---
|
|
369
374
|
model FrameworkEditorVideo {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_vi'::text)"))
|
|
376
|
+
title String
|
|
377
|
+
description String
|
|
378
|
+
youtubeId String
|
|
379
|
+
url String
|
|
375
380
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
381
|
+
// Dates
|
|
382
|
+
createdAt DateTime @default(now())
|
|
383
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
379
384
|
}
|
|
380
385
|
|
|
381
386
|
model FrameworkEditorFramework {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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)
|
|
387
392
|
|
|
388
|
-
|
|
389
|
-
|
|
393
|
+
requirements FrameworkEditorRequirement[]
|
|
394
|
+
frameworkInstances FrameworkInstance[]
|
|
390
395
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
396
|
+
// Dates
|
|
397
|
+
createdAt DateTime @default(now())
|
|
398
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
394
399
|
}
|
|
395
400
|
|
|
396
401
|
model FrameworkEditorRequirement {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
402
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_rq'::text)"))
|
|
403
|
+
frameworkId String
|
|
404
|
+
framework FrameworkEditorFramework @relation(fields: [frameworkId], references: [id])
|
|
400
405
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
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
|
|
404
409
|
|
|
405
|
-
|
|
406
|
-
|
|
410
|
+
controlTemplates FrameworkEditorControlTemplate[]
|
|
411
|
+
requirementMaps RequirementMap[]
|
|
407
412
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
413
|
+
// Dates
|
|
414
|
+
createdAt DateTime @default(now())
|
|
415
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
411
416
|
}
|
|
412
417
|
|
|
413
418
|
model FrameworkEditorPolicyTemplate {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
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
|
|
420
425
|
|
|
421
|
-
|
|
426
|
+
controlTemplates FrameworkEditorControlTemplate[]
|
|
422
427
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
428
|
+
// Dates
|
|
429
|
+
createdAt DateTime @default(now())
|
|
430
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
426
431
|
|
|
427
|
-
|
|
428
|
-
|
|
432
|
+
// Instances
|
|
433
|
+
policies Policy[]
|
|
429
434
|
}
|
|
430
435
|
|
|
431
436
|
model FrameworkEditorTaskTemplate {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
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
|
|
437
442
|
|
|
438
|
-
|
|
443
|
+
controlTemplates FrameworkEditorControlTemplate[]
|
|
439
444
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
445
|
+
// Dates
|
|
446
|
+
createdAt DateTime @default(now())
|
|
447
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
443
448
|
|
|
444
|
-
|
|
445
|
-
|
|
449
|
+
// Instances
|
|
450
|
+
tasks Task[]
|
|
446
451
|
}
|
|
447
452
|
|
|
448
453
|
model FrameworkEditorControlTemplate {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
454
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_ct'::text)"))
|
|
455
|
+
name String
|
|
456
|
+
description String
|
|
452
457
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
458
|
+
policyTemplates FrameworkEditorPolicyTemplate[]
|
|
459
|
+
requirements FrameworkEditorRequirement[]
|
|
460
|
+
taskTemplates FrameworkEditorTaskTemplate[]
|
|
456
461
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
462
|
+
// Dates
|
|
463
|
+
createdAt DateTime @default(now())
|
|
464
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
460
465
|
|
|
461
|
-
|
|
462
|
-
|
|
466
|
+
// Instances
|
|
467
|
+
controls Control[]
|
|
463
468
|
}
|
|
464
469
|
|
|
465
470
|
|
|
@@ -515,24 +520,59 @@ model IntegrationResult {
|
|
|
515
520
|
}
|
|
516
521
|
|
|
517
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
|
+
|
|
518
558
|
// ===== onboarding.prisma =====
|
|
519
559
|
model Onboarding {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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)
|
|
534
574
|
|
|
535
|
-
|
|
575
|
+
@@index([organizationId])
|
|
536
576
|
}
|
|
537
577
|
|
|
538
578
|
|
|
@@ -554,22 +594,28 @@ model Organization {
|
|
|
554
594
|
fleetDmLabelId Int?
|
|
555
595
|
isFleetSetupCompleted Boolean @default(false)
|
|
556
596
|
|
|
557
|
-
apiKeys
|
|
558
|
-
auditLog
|
|
559
|
-
controls
|
|
560
|
-
frameworkInstances
|
|
561
|
-
integrations
|
|
562
|
-
invitations
|
|
563
|
-
members
|
|
564
|
-
policy
|
|
565
|
-
risk
|
|
566
|
-
vendors
|
|
567
|
-
tasks
|
|
568
|
-
comments
|
|
569
|
-
attachments
|
|
570
|
-
trust
|
|
571
|
-
context
|
|
572
|
-
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[]
|
|
573
619
|
|
|
574
620
|
@@index([slug])
|
|
575
621
|
}
|
|
@@ -617,21 +663,85 @@ model Policy {
|
|
|
617
663
|
}
|
|
618
664
|
|
|
619
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
|
+
|
|
620
730
|
// ===== requirement.prisma =====
|
|
621
731
|
model RequirementMap {
|
|
622
|
-
|
|
732
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('req'::text)"))
|
|
623
733
|
|
|
624
|
-
|
|
625
|
-
|
|
734
|
+
requirementId String
|
|
735
|
+
requirement FrameworkEditorRequirement @relation(fields: [requirementId], references: [id], onDelete: Cascade)
|
|
626
736
|
|
|
627
|
-
|
|
628
|
-
|
|
737
|
+
controlId String
|
|
738
|
+
control Control @relation(fields: [controlId], references: [id], onDelete: Cascade)
|
|
629
739
|
|
|
630
|
-
|
|
631
|
-
|
|
740
|
+
frameworkInstanceId String
|
|
741
|
+
frameworkInstance FrameworkInstance @relation(fields: [frameworkInstanceId], references: [id], onDelete: Cascade)
|
|
632
742
|
|
|
633
|
-
|
|
634
|
-
|
|
743
|
+
@@unique([controlId, frameworkInstanceId, requirementId])
|
|
744
|
+
@@index([requirementId, frameworkInstanceId])
|
|
635
745
|
}
|
|
636
746
|
|
|
637
747
|
|
|
@@ -698,228 +808,406 @@ enum RiskStatus {
|
|
|
698
808
|
|
|
699
809
|
// ===== secret.prisma =====
|
|
700
810
|
model Secret {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
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
|
+
}
|
|
710
826
|
|
|
711
|
-
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
712
827
|
|
|
713
|
-
|
|
714
|
-
|
|
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
|
|
715
856
|
}
|
|
716
857
|
|
|
717
858
|
|
|
859
|
+
|
|
718
860
|
// ===== shared.prisma =====
|
|
719
861
|
model ApiKey {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
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)
|
|
728
870
|
|
|
729
|
-
|
|
730
|
-
|
|
871
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
872
|
+
organizationId String
|
|
731
873
|
|
|
732
|
-
|
|
733
|
-
|
|
874
|
+
@@index([organizationId])
|
|
875
|
+
@@index([key])
|
|
734
876
|
}
|
|
735
877
|
|
|
736
878
|
model AuditLog {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
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])
|
|
755
897
|
}
|
|
756
898
|
|
|
757
899
|
enum AuditLogEntityType {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
900
|
+
organization
|
|
901
|
+
framework
|
|
902
|
+
requirement
|
|
903
|
+
control
|
|
904
|
+
policy
|
|
905
|
+
task
|
|
906
|
+
people
|
|
907
|
+
risk
|
|
908
|
+
vendor
|
|
909
|
+
tests
|
|
910
|
+
integration
|
|
911
|
+
trust
|
|
769
912
|
}
|
|
770
913
|
|
|
771
914
|
model GlobalVendors {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
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])
|
|
790
933
|
}
|
|
791
934
|
|
|
792
935
|
enum Departments {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
936
|
+
none
|
|
937
|
+
admin
|
|
938
|
+
gov
|
|
939
|
+
hr
|
|
940
|
+
it
|
|
941
|
+
itsm
|
|
942
|
+
qms
|
|
800
943
|
}
|
|
801
944
|
|
|
802
945
|
enum Frequency {
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
946
|
+
monthly
|
|
947
|
+
quarterly
|
|
948
|
+
yearly
|
|
806
949
|
}
|
|
807
950
|
|
|
808
951
|
enum Likelihood {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
952
|
+
very_unlikely
|
|
953
|
+
unlikely
|
|
954
|
+
possible
|
|
955
|
+
likely
|
|
956
|
+
very_likely
|
|
814
957
|
}
|
|
815
958
|
|
|
816
959
|
enum Impact {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
960
|
+
insignificant
|
|
961
|
+
minor
|
|
962
|
+
moderate
|
|
963
|
+
major
|
|
964
|
+
severe
|
|
822
965
|
}
|
|
823
966
|
|
|
824
967
|
|
|
825
968
|
// ===== task.prisma =====
|
|
826
969
|
model Task {
|
|
827
|
-
|
|
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
|
-
|
|
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[]
|
|
855
998
|
}
|
|
856
999
|
|
|
857
1000
|
enum TaskStatus {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
1001
|
+
todo
|
|
1002
|
+
in_progress
|
|
1003
|
+
done
|
|
1004
|
+
not_relevant
|
|
1005
|
+
failed
|
|
863
1006
|
}
|
|
864
1007
|
|
|
865
1008
|
enum TaskFrequency {
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
1009
|
+
daily
|
|
1010
|
+
weekly
|
|
1011
|
+
monthly
|
|
1012
|
+
quarterly
|
|
1013
|
+
yearly
|
|
871
1014
|
}
|
|
872
1015
|
|
|
873
1016
|
|
|
874
1017
|
// ===== trust.prisma =====
|
|
875
1018
|
model Trust {
|
|
876
|
-
|
|
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
|
-
|
|
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])
|
|
912
1057
|
}
|
|
913
1058
|
|
|
914
1059
|
enum TrustStatus {
|
|
915
|
-
|
|
916
|
-
|
|
1060
|
+
draft
|
|
1061
|
+
published
|
|
917
1062
|
}
|
|
918
1063
|
|
|
919
1064
|
enum FrameworkStatus {
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
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])
|
|
923
1211
|
}
|
|
924
1212
|
|
|
925
1213
|
|