@adaptware/eagles-db 0.6.9 → 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.
- package/client/edge.js +35 -20
- package/client/index-browser.js +25 -11
- package/client/index.d.ts +2479 -633
- package/client/index.js +35 -20
- package/client/package.json +1 -1
- package/client/schema.prisma +94 -47
- package/client/wasm.js +35 -20
- package/package.json +1 -1
- package/prisma/.DS_Store +0 -0
- package/prisma/schema/.DS_Store +0 -0
- package/prisma/schema/consent.prisma +42 -16
- package/prisma/schema/document.prisma +2 -1
- package/prisma/schema/migrations/.DS_Store +0 -0
- package/prisma/schema/migrations/20260826160000_add_application_fit_check_report_document/.DS_Store +0 -0
package/client/package.json
CHANGED
package/client/schema.prisma
CHANGED
|
@@ -1253,13 +1253,15 @@ model CompetencyDictionary {
|
|
|
1253
1253
|
enum ConsentType {
|
|
1254
1254
|
PLATFORM_TERMS
|
|
1255
1255
|
INTERVIEW_SESSION
|
|
1256
|
+
/// Read-only catalog document; no ConsentRecord submit flow
|
|
1257
|
+
PRIVACY_POLICY
|
|
1256
1258
|
|
|
1257
1259
|
@@schema("public")
|
|
1258
1260
|
}
|
|
1259
1261
|
|
|
1260
|
-
enum
|
|
1261
|
-
|
|
1262
|
-
|
|
1262
|
+
enum ConsentGrantStatus {
|
|
1263
|
+
GRANTED
|
|
1264
|
+
DECLINED
|
|
1263
1265
|
|
|
1264
1266
|
@@schema("public")
|
|
1265
1267
|
}
|
|
@@ -1271,6 +1273,21 @@ enum ConsentOutcome {
|
|
|
1271
1273
|
@@schema("public")
|
|
1272
1274
|
}
|
|
1273
1275
|
|
|
1276
|
+
enum ConsentReferenceType {
|
|
1277
|
+
INTERVIEW
|
|
1278
|
+
ASSESSMENT
|
|
1279
|
+
|
|
1280
|
+
@@schema("public")
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
enum ConsentCatalogVersionStatus {
|
|
1284
|
+
DRAFT
|
|
1285
|
+
PUBLISHED
|
|
1286
|
+
ARCHIVED
|
|
1287
|
+
|
|
1288
|
+
@@schema("public")
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1274
1291
|
enum DataErasureTrigger {
|
|
1275
1292
|
ADMIN
|
|
1276
1293
|
USER_REQUEST
|
|
@@ -1297,69 +1314,96 @@ enum DataErasureRequestStatus {
|
|
|
1297
1314
|
@@schema("public")
|
|
1298
1315
|
}
|
|
1299
1316
|
|
|
1317
|
+
/// Catalog identity is (organisation_id, consent_type). Null organisation_id = platform default.
|
|
1318
|
+
/// Platform rows also need a partial unique index on consent_type WHERE organisation_id IS NULL
|
|
1319
|
+
/// (PostgreSQL treats NULLs as distinct in the composite unique below).
|
|
1300
1320
|
model ConsentDocument {
|
|
1301
|
-
id
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
versions ConsentDocumentVersion[]
|
|
1321
|
+
id String @id @default(uuid())
|
|
1322
|
+
consent_type ConsentType
|
|
1323
|
+
organisation_id String?
|
|
1324
|
+
organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
|
|
1325
|
+
created_at DateTime @default(now())
|
|
1326
|
+
updated_at DateTime @updatedAt
|
|
1327
|
+
versions ConsentDocumentVersion[]
|
|
1309
1328
|
|
|
1329
|
+
@@unique([organisation_id, consent_type])
|
|
1330
|
+
@@index([consent_type, organisation_id])
|
|
1310
1331
|
@@schema("public")
|
|
1311
1332
|
}
|
|
1312
1333
|
|
|
1334
|
+
/// One immutable markdown object per version; S3 location and hash live on the linked Document.
|
|
1313
1335
|
model ConsentDocumentVersion {
|
|
1314
|
-
id
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
version_number
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1336
|
+
id String @id @default(uuid())
|
|
1337
|
+
consent_document_id String
|
|
1338
|
+
consent_document ConsentDocument @relation(fields: [consent_document_id], references: [id], onDelete: Cascade)
|
|
1339
|
+
version_number Int
|
|
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
|
+
|
|
1324
1356
|
consent_records ConsentRecord[]
|
|
1325
1357
|
|
|
1326
|
-
@@unique([
|
|
1327
|
-
@@index([
|
|
1358
|
+
@@unique([consent_document_id, version_number])
|
|
1359
|
+
@@index([consent_document_id, status, version_number(sort: Desc)])
|
|
1360
|
+
@@index([document_id])
|
|
1361
|
+
@@index([privacy_policy_id])
|
|
1328
1362
|
@@schema("public")
|
|
1329
1363
|
}
|
|
1330
1364
|
|
|
1331
1365
|
model ConsentCheckboxDefinition {
|
|
1332
|
-
id
|
|
1333
|
-
|
|
1334
|
-
|
|
1366
|
+
id String @id @default(uuid())
|
|
1367
|
+
consent_document_version_id String
|
|
1368
|
+
consent_document_version ConsentDocumentVersion @relation(fields: [consent_document_version_id], references: [id], onDelete: Cascade)
|
|
1335
1369
|
/// Stable machine key in ConsentRecord.selections JSON
|
|
1336
|
-
checkbox_key
|
|
1337
|
-
label
|
|
1338
|
-
sort_order
|
|
1339
|
-
default_required_hint
|
|
1370
|
+
checkbox_key String
|
|
1371
|
+
label String
|
|
1372
|
+
sort_order Int @default(0)
|
|
1373
|
+
default_required_hint Boolean @default(true)
|
|
1340
1374
|
|
|
1341
|
-
@@unique([
|
|
1375
|
+
@@unique([consent_document_version_id, checkbox_key])
|
|
1342
1376
|
@@schema("public")
|
|
1343
1377
|
}
|
|
1344
1378
|
|
|
1379
|
+
/// Consent type is resolved via consent_document_version -> consent_document.consent_type.
|
|
1345
1380
|
model ConsentRecord {
|
|
1346
|
-
id
|
|
1347
|
-
user_id
|
|
1348
|
-
user
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
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
|
+
|
|
1389
|
+
consent_document_version_id String
|
|
1390
|
+
consent_document_version ConsentDocumentVersion @relation(fields: [consent_document_version_id], references: [id], onDelete: Restrict)
|
|
1391
|
+
selections Json @default("{}")
|
|
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())
|
|
1360
1402
|
|
|
1361
|
-
@@index([user_id,
|
|
1362
|
-
@@index([reference_type, reference_id,
|
|
1403
|
+
@@index([user_id, created_at(sort: Desc)])
|
|
1404
|
+
@@index([reference_type, reference_id, created_at(sort: Desc)])
|
|
1405
|
+
@@index([evaluation_id, created_at(sort: Desc)])
|
|
1406
|
+
@@index([consent_document_version_id])
|
|
1363
1407
|
@@schema("public")
|
|
1364
1408
|
}
|
|
1365
1409
|
|
|
@@ -1545,6 +1589,8 @@ model Document {
|
|
|
1545
1589
|
offer_letter_template_snapshots OfferLetter[] @relation("OfferLetterTemplateSnapshot")
|
|
1546
1590
|
offer_draft_edited_html Offer[] @relation("OfferDraftEditedHtml")
|
|
1547
1591
|
application_fit_check_report Application? @relation("ApplicationFitCheckReportDocument")
|
|
1592
|
+
terms_consent_versions ConsentDocumentVersion[] @relation("TermsDocument")
|
|
1593
|
+
privacy_policy_consent_versions ConsentDocumentVersion[] @relation("PrivacyPolicyDocument")
|
|
1548
1594
|
|
|
1549
1595
|
// Indexes
|
|
1550
1596
|
@@index([candidate_id])
|
|
@@ -3752,6 +3798,7 @@ model Organisation {
|
|
|
3752
3798
|
licensing_ledger_entries LicensingLedgerEntry[]
|
|
3753
3799
|
license_package_organisations LicensePackageOrganisation[]
|
|
3754
3800
|
ai_cost_ledger_entries AiCostLedgerEntry[]
|
|
3801
|
+
consent_documents ConsentDocument[]
|
|
3755
3802
|
|
|
3756
3803
|
@@index([name])
|
|
3757
3804
|
@@schema("public")
|