@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/package.json
CHANGED
package/prisma/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
enum ConsentType {
|
|
4
4
|
PLATFORM_TERMS
|
|
5
5
|
INTERVIEW_SESSION
|
|
6
|
+
/// Read-only catalog document; no ConsentRecord submit flow
|
|
7
|
+
PRIVACY_POLICY
|
|
6
8
|
|
|
7
9
|
@@schema("public")
|
|
8
10
|
}
|
|
@@ -21,6 +23,14 @@ enum ConsentOutcome {
|
|
|
21
23
|
@@schema("public")
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
enum ConsentCatalogVersionStatus {
|
|
27
|
+
DRAFT
|
|
28
|
+
PUBLISHED
|
|
29
|
+
ARCHIVED
|
|
30
|
+
|
|
31
|
+
@@schema("public")
|
|
32
|
+
}
|
|
33
|
+
|
|
24
34
|
enum DataErasureTrigger {
|
|
25
35
|
ADMIN
|
|
26
36
|
USER_REQUEST
|
|
@@ -47,69 +57,77 @@ enum DataErasureRequestStatus {
|
|
|
47
57
|
@@schema("public")
|
|
48
58
|
}
|
|
49
59
|
|
|
60
|
+
/// Catalog identity is (organisation_id, consent_type). Null organisation_id = platform default.
|
|
61
|
+
/// Platform rows also need a partial unique index on consent_type WHERE organisation_id IS NULL
|
|
62
|
+
/// (PostgreSQL treats NULLs as distinct in the composite unique below).
|
|
50
63
|
model ConsentDocument {
|
|
51
|
-
id
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
id String @id @default(uuid())
|
|
65
|
+
consent_type ConsentType
|
|
66
|
+
organisation_id String?
|
|
67
|
+
organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
|
|
68
|
+
created_at DateTime @default(now())
|
|
69
|
+
updated_at DateTime @updatedAt
|
|
70
|
+
versions ConsentDocumentVersion[]
|
|
71
|
+
|
|
72
|
+
@@unique([organisation_id, consent_type])
|
|
73
|
+
@@index([consent_type, organisation_id])
|
|
60
74
|
@@schema("public")
|
|
61
75
|
}
|
|
62
76
|
|
|
77
|
+
/// One immutable markdown object per version; S3 location and hash live on the linked Document.
|
|
63
78
|
model ConsentDocumentVersion {
|
|
64
|
-
id
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
version_number
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
published_at
|
|
72
|
-
created_at
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
@@
|
|
79
|
+
id String @id @default(uuid())
|
|
80
|
+
consent_document_id String
|
|
81
|
+
consent_document ConsentDocument @relation(fields: [consent_document_id], references: [id], onDelete: Cascade)
|
|
82
|
+
version_number Int
|
|
83
|
+
document_id String?
|
|
84
|
+
document Document? @relation(fields: [document_id], references: [id], onDelete: Restrict)
|
|
85
|
+
status ConsentCatalogVersionStatus @default(DRAFT)
|
|
86
|
+
published_at DateTime?
|
|
87
|
+
created_at DateTime @default(now())
|
|
88
|
+
updated_at DateTime @updatedAt
|
|
89
|
+
checkboxes ConsentCheckboxDefinition[]
|
|
90
|
+
consent_records ConsentRecord[]
|
|
91
|
+
|
|
92
|
+
@@unique([consent_document_id, version_number])
|
|
93
|
+
@@index([consent_document_id, status, version_number(sort: Desc)])
|
|
94
|
+
@@index([document_id])
|
|
78
95
|
@@schema("public")
|
|
79
96
|
}
|
|
80
97
|
|
|
81
98
|
model ConsentCheckboxDefinition {
|
|
82
|
-
id
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
id String @id @default(uuid())
|
|
100
|
+
consent_document_version_id String
|
|
101
|
+
consent_document_version ConsentDocumentVersion @relation(fields: [consent_document_version_id], references: [id], onDelete: Cascade)
|
|
85
102
|
/// Stable machine key in ConsentRecord.selections JSON
|
|
86
|
-
checkbox_key
|
|
87
|
-
label
|
|
88
|
-
sort_order
|
|
89
|
-
default_required_hint
|
|
103
|
+
checkbox_key String
|
|
104
|
+
label String
|
|
105
|
+
sort_order Int @default(0)
|
|
106
|
+
default_required_hint Boolean @default(true)
|
|
90
107
|
|
|
91
|
-
@@unique([
|
|
108
|
+
@@unique([consent_document_version_id, checkbox_key])
|
|
92
109
|
@@schema("public")
|
|
93
110
|
}
|
|
94
111
|
|
|
112
|
+
/// Consent type is resolved via consent_document_version -> consent_document.consent_type.
|
|
95
113
|
model ConsentRecord {
|
|
96
|
-
id
|
|
97
|
-
user_id
|
|
98
|
-
user
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
@@index([
|
|
112
|
-
@@index([
|
|
114
|
+
id String @id @default(uuid())
|
|
115
|
+
user_id String
|
|
116
|
+
user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
|
117
|
+
outcome ConsentOutcome
|
|
118
|
+
consent_document_version_id String
|
|
119
|
+
consent_document_version ConsentDocumentVersion @relation(fields: [consent_document_version_id], references: [id], onDelete: Restrict)
|
|
120
|
+
selections Json @default("{}")
|
|
121
|
+
reference_type ConsentReferenceType?
|
|
122
|
+
reference_id String?
|
|
123
|
+
ip_address String?
|
|
124
|
+
user_agent String?
|
|
125
|
+
decline_reason String?
|
|
126
|
+
created_at DateTime @default(now())
|
|
127
|
+
|
|
128
|
+
@@index([user_id, created_at(sort: Desc)])
|
|
129
|
+
@@index([reference_type, reference_id, created_at(sort: Desc)])
|
|
130
|
+
@@index([consent_document_version_id])
|
|
113
131
|
@@schema("public")
|
|
114
132
|
}
|
|
115
133
|
|
|
@@ -38,6 +38,7 @@ model Document {
|
|
|
38
38
|
offer_letter_template_snapshots OfferLetter[] @relation("OfferLetterTemplateSnapshot")
|
|
39
39
|
offer_draft_edited_html Offer[] @relation("OfferDraftEditedHtml")
|
|
40
40
|
application_fit_check_report Application? @relation("ApplicationFitCheckReportDocument")
|
|
41
|
+
consent_document_versions ConsentDocumentVersion[]
|
|
41
42
|
|
|
42
43
|
// Indexes
|
|
43
44
|
@@index([candidate_id])
|
|
Binary file
|
package/prisma/schema/migrations/20260826160000_add_application_fit_check_report_document/.DS_Store
ADDED
|
Binary file
|
|
@@ -85,6 +85,7 @@ model Organisation {
|
|
|
85
85
|
licensing_ledger_entries LicensingLedgerEntry[]
|
|
86
86
|
license_package_organisations LicensePackageOrganisation[]
|
|
87
87
|
ai_cost_ledger_entries AiCostLedgerEntry[]
|
|
88
|
+
consent_documents ConsentDocument[]
|
|
88
89
|
|
|
89
90
|
@@index([name])
|
|
90
91
|
@@schema("public")
|