@adaptware/eagles-db 0.6.8 → 0.6.10

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "prisma-client-e9417467f9e93e98cb327c7936ad0b7cf1a8f9394978c3b6bcf6b05f22c14ecc",
2
+ "name": "prisma-client-82ceb8f6b5d6a7eb0b834f41702127fde31517c088c1353e8a1eb2b952f1ff3a",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "default.js",
@@ -1259,9 +1259,9 @@ enum ConsentType {
1259
1259
  @@schema("public")
1260
1260
  }
1261
1261
 
1262
- enum ConsentReferenceType {
1263
- INTERVIEW
1264
- ASSESSMENT
1262
+ enum ConsentGrantStatus {
1263
+ GRANTED
1264
+ DECLINED
1265
1265
 
1266
1266
  @@schema("public")
1267
1267
  }
@@ -1273,6 +1273,13 @@ enum ConsentOutcome {
1273
1273
  @@schema("public")
1274
1274
  }
1275
1275
 
1276
+ enum ConsentReferenceType {
1277
+ INTERVIEW
1278
+ ASSESSMENT
1279
+
1280
+ @@schema("public")
1281
+ }
1282
+
1276
1283
  enum ConsentCatalogVersionStatus {
1277
1284
  DRAFT
1278
1285
  PUBLISHED
@@ -1326,22 +1333,32 @@ model ConsentDocument {
1326
1333
 
1327
1334
  /// One immutable markdown object per version; S3 location and hash live on the linked Document.
1328
1335
  model ConsentDocumentVersion {
1329
- id String @id @default(uuid())
1336
+ id String @id @default(uuid())
1330
1337
  consent_document_id String
1331
- consent_document ConsentDocument @relation(fields: [consent_document_id], references: [id], onDelete: Cascade)
1338
+ consent_document ConsentDocument @relation(fields: [consent_document_id], references: [id], onDelete: Cascade)
1332
1339
  version_number Int
1333
- document_id String?
1334
- document Document? @relation(fields: [document_id], references: [id], onDelete: Restrict)
1335
- status ConsentCatalogVersionStatus @default(DRAFT)
1336
- published_at DateTime?
1337
- created_at DateTime @default(now())
1338
- updated_at DateTime @updatedAt
1339
- checkboxes ConsentCheckboxDefinition[]
1340
- consent_records ConsentRecord[]
1340
+
1341
+ // Dual document linkage for Platform Terms & Privacy Policy
1342
+ document_id String?
1343
+ document Document? @relation("TermsDocument", fields: [document_id], references: [id], onDelete: Restrict)
1344
+ privacy_policy_id String?
1345
+ privacy_policy Document? @relation("PrivacyPolicyDocument", fields: [privacy_policy_id], references: [id], onDelete: Restrict)
1346
+
1347
+ status ConsentCatalogVersionStatus @default(DRAFT)
1348
+ published_at DateTime?
1349
+ created_at DateTime @default(now())
1350
+ updated_at DateTime @updatedAt
1351
+
1352
+ // Embedded checkboxes JSON array (ConsentCheckboxDefinition preserved in schema to prevent drop)
1353
+ checkboxes Json? @default("[]")
1354
+ checkbox_definitions ConsentCheckboxDefinition[]
1355
+
1356
+ consent_records ConsentRecord[]
1341
1357
 
1342
1358
  @@unique([consent_document_id, version_number])
1343
1359
  @@index([consent_document_id, status, version_number(sort: Desc)])
1344
1360
  @@index([document_id])
1361
+ @@index([privacy_policy_id])
1345
1362
  @@schema("public")
1346
1363
  }
1347
1364
 
@@ -1361,22 +1378,31 @@ model ConsentCheckboxDefinition {
1361
1378
 
1362
1379
  /// Consent type is resolved via consent_document_version -> consent_document.consent_type.
1363
1380
  model ConsentRecord {
1364
- id String @id @default(uuid())
1365
- user_id String
1366
- user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
1367
- outcome ConsentOutcome
1381
+ id String @id @default(uuid())
1382
+ user_id String
1383
+ user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
1384
+
1385
+ // Dual-existence for non-breaking migration
1386
+ outcome ConsentOutcome?
1387
+ grant_status ConsentGrantStatus?
1388
+
1368
1389
  consent_document_version_id String
1369
1390
  consent_document_version ConsentDocumentVersion @relation(fields: [consent_document_version_id], references: [id], onDelete: Restrict)
1370
1391
  selections Json @default("{}")
1371
- reference_type ConsentReferenceType?
1372
- reference_id String?
1373
- ip_address String?
1374
- user_agent String?
1375
- decline_reason String?
1376
- created_at DateTime @default(now())
1392
+
1393
+ // Dual-existence for non-breaking migration
1394
+ reference_type ConsentReferenceType?
1395
+ reference_id String?
1396
+ evaluation_id String?
1397
+
1398
+ ip_address String?
1399
+ user_agent String?
1400
+ decline_reason String?
1401
+ created_at DateTime @default(now())
1377
1402
 
1378
1403
  @@index([user_id, created_at(sort: Desc)])
1379
1404
  @@index([reference_type, reference_id, created_at(sort: Desc)])
1405
+ @@index([evaluation_id, created_at(sort: Desc)])
1380
1406
  @@index([consent_document_version_id])
1381
1407
  @@schema("public")
1382
1408
  }
@@ -1563,7 +1589,8 @@ model Document {
1563
1589
  offer_letter_template_snapshots OfferLetter[] @relation("OfferLetterTemplateSnapshot")
1564
1590
  offer_draft_edited_html Offer[] @relation("OfferDraftEditedHtml")
1565
1591
  application_fit_check_report Application? @relation("ApplicationFitCheckReportDocument")
1566
- consent_document_versions ConsentDocumentVersion[]
1592
+ terms_consent_versions ConsentDocumentVersion[] @relation("TermsDocument")
1593
+ privacy_policy_consent_versions ConsentDocumentVersion[] @relation("PrivacyPolicyDocument")
1567
1594
 
1568
1595
  // Indexes
1569
1596
  @@index([candidate_id])