@adaptware/eagles-db 0.6.7 → 0.6.8
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 +23 -17
- package/client/index-browser.js +16 -11
- package/client/index.d.ts +1694 -559
- package/client/index.js +23 -17
- package/client/package.json +1 -1
- package/client/schema.prisma +67 -47
- package/client/wasm.js +23 -17
- package/package.json +1 -1
- package/prisma/.DS_Store +0 -0
- package/prisma/schema/.DS_Store +0 -0
- package/prisma/schema/consent.prisma +66 -48
- package/prisma/schema/document.prisma +1 -0
- package/prisma/schema/migrations/.DS_Store +0 -0
- package/prisma/schema/migrations/20260826160000_add_application_fit_check_report_document/.DS_Store +0 -0
- package/prisma/schema/organisation.prisma +1 -0
package/client/package.json
CHANGED
package/client/schema.prisma
CHANGED
|
@@ -1253,6 +1253,8 @@ 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
|
}
|
|
@@ -1271,6 +1273,14 @@ enum ConsentOutcome {
|
|
|
1271
1273
|
@@schema("public")
|
|
1272
1274
|
}
|
|
1273
1275
|
|
|
1276
|
+
enum ConsentCatalogVersionStatus {
|
|
1277
|
+
DRAFT
|
|
1278
|
+
PUBLISHED
|
|
1279
|
+
ARCHIVED
|
|
1280
|
+
|
|
1281
|
+
@@schema("public")
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1274
1284
|
enum DataErasureTrigger {
|
|
1275
1285
|
ADMIN
|
|
1276
1286
|
USER_REQUEST
|
|
@@ -1297,69 +1307,77 @@ enum DataErasureRequestStatus {
|
|
|
1297
1307
|
@@schema("public")
|
|
1298
1308
|
}
|
|
1299
1309
|
|
|
1310
|
+
/// Catalog identity is (organisation_id, consent_type). Null organisation_id = platform default.
|
|
1311
|
+
/// Platform rows also need a partial unique index on consent_type WHERE organisation_id IS NULL
|
|
1312
|
+
/// (PostgreSQL treats NULLs as distinct in the composite unique below).
|
|
1300
1313
|
model ConsentDocument {
|
|
1301
|
-
id
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
versions ConsentDocumentVersion[]
|
|
1314
|
+
id String @id @default(uuid())
|
|
1315
|
+
consent_type ConsentType
|
|
1316
|
+
organisation_id String?
|
|
1317
|
+
organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
|
|
1318
|
+
created_at DateTime @default(now())
|
|
1319
|
+
updated_at DateTime @updatedAt
|
|
1320
|
+
versions ConsentDocumentVersion[]
|
|
1309
1321
|
|
|
1322
|
+
@@unique([organisation_id, consent_type])
|
|
1323
|
+
@@index([consent_type, organisation_id])
|
|
1310
1324
|
@@schema("public")
|
|
1311
1325
|
}
|
|
1312
1326
|
|
|
1327
|
+
/// One immutable markdown object per version; S3 location and hash live on the linked Document.
|
|
1313
1328
|
model ConsentDocumentVersion {
|
|
1314
|
-
id
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
version_number
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
published_at
|
|
1322
|
-
created_at
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
@@
|
|
1329
|
+
id String @id @default(uuid())
|
|
1330
|
+
consent_document_id String
|
|
1331
|
+
consent_document ConsentDocument @relation(fields: [consent_document_id], references: [id], onDelete: Cascade)
|
|
1332
|
+
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[]
|
|
1341
|
+
|
|
1342
|
+
@@unique([consent_document_id, version_number])
|
|
1343
|
+
@@index([consent_document_id, status, version_number(sort: Desc)])
|
|
1344
|
+
@@index([document_id])
|
|
1328
1345
|
@@schema("public")
|
|
1329
1346
|
}
|
|
1330
1347
|
|
|
1331
1348
|
model ConsentCheckboxDefinition {
|
|
1332
|
-
id
|
|
1333
|
-
|
|
1334
|
-
|
|
1349
|
+
id String @id @default(uuid())
|
|
1350
|
+
consent_document_version_id String
|
|
1351
|
+
consent_document_version ConsentDocumentVersion @relation(fields: [consent_document_version_id], references: [id], onDelete: Cascade)
|
|
1335
1352
|
/// Stable machine key in ConsentRecord.selections JSON
|
|
1336
|
-
checkbox_key
|
|
1337
|
-
label
|
|
1338
|
-
sort_order
|
|
1339
|
-
default_required_hint
|
|
1353
|
+
checkbox_key String
|
|
1354
|
+
label String
|
|
1355
|
+
sort_order Int @default(0)
|
|
1356
|
+
default_required_hint Boolean @default(true)
|
|
1340
1357
|
|
|
1341
|
-
@@unique([
|
|
1358
|
+
@@unique([consent_document_version_id, checkbox_key])
|
|
1342
1359
|
@@schema("public")
|
|
1343
1360
|
}
|
|
1344
1361
|
|
|
1362
|
+
/// Consent type is resolved via consent_document_version -> consent_document.consent_type.
|
|
1345
1363
|
model ConsentRecord {
|
|
1346
|
-
id
|
|
1347
|
-
user_id
|
|
1348
|
-
user
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
@@index([
|
|
1362
|
-
@@index([
|
|
1364
|
+
id String @id @default(uuid())
|
|
1365
|
+
user_id String
|
|
1366
|
+
user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
|
1367
|
+
outcome ConsentOutcome
|
|
1368
|
+
consent_document_version_id String
|
|
1369
|
+
consent_document_version ConsentDocumentVersion @relation(fields: [consent_document_version_id], references: [id], onDelete: Restrict)
|
|
1370
|
+
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())
|
|
1377
|
+
|
|
1378
|
+
@@index([user_id, created_at(sort: Desc)])
|
|
1379
|
+
@@index([reference_type, reference_id, created_at(sort: Desc)])
|
|
1380
|
+
@@index([consent_document_version_id])
|
|
1363
1381
|
@@schema("public")
|
|
1364
1382
|
}
|
|
1365
1383
|
|
|
@@ -1545,6 +1563,7 @@ model Document {
|
|
|
1545
1563
|
offer_letter_template_snapshots OfferLetter[] @relation("OfferLetterTemplateSnapshot")
|
|
1546
1564
|
offer_draft_edited_html Offer[] @relation("OfferDraftEditedHtml")
|
|
1547
1565
|
application_fit_check_report Application? @relation("ApplicationFitCheckReportDocument")
|
|
1566
|
+
consent_document_versions ConsentDocumentVersion[]
|
|
1548
1567
|
|
|
1549
1568
|
// Indexes
|
|
1550
1569
|
@@index([candidate_id])
|
|
@@ -3752,6 +3771,7 @@ model Organisation {
|
|
|
3752
3771
|
licensing_ledger_entries LicensingLedgerEntry[]
|
|
3753
3772
|
license_package_organisations LicensePackageOrganisation[]
|
|
3754
3773
|
ai_cost_ledger_entries AiCostLedgerEntry[]
|
|
3774
|
+
consent_documents ConsentDocument[]
|
|
3755
3775
|
|
|
3756
3776
|
@@index([name])
|
|
3757
3777
|
@@schema("public")
|