@adaptware/eagles-db 0.6.6 → 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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "prisma-client-a95f32abf6c5a366a1c9e576f60929cad1ae5477837fd6844ab4fc4ab8247fa5",
2
+ "name": "prisma-client-e9417467f9e93e98cb327c7936ad0b7cf1a8f9394978c3b6bcf6b05f22c14ecc",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "default.js",
@@ -1273,6 +1273,14 @@ enum ConsentOutcome {
1273
1273
  @@schema("public")
1274
1274
  }
1275
1275
 
1276
+ enum ConsentCatalogVersionStatus {
1277
+ DRAFT
1278
+ PUBLISHED
1279
+ ARCHIVED
1280
+
1281
+ @@schema("public")
1282
+ }
1283
+
1276
1284
  enum DataErasureTrigger {
1277
1285
  ADMIN
1278
1286
  USER_REQUEST
@@ -1299,114 +1307,77 @@ enum DataErasureRequestStatus {
1299
1307
  @@schema("public")
1300
1308
  }
1301
1309
 
1302
- /// Lifecycle for org-managed legal versions (platform seed publishes as PUBLISHED immediately).
1303
- enum ConsentCatalogVersionStatus {
1304
- DRAFT
1305
- PUBLISHED
1306
- ARCHIVED
1307
- /// Emergency takedown — grants blocked even during manifest grace window
1308
- REVOKED
1309
-
1310
- @@schema("public")
1311
- }
1312
-
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).
1313
1313
  model ConsentDocument {
1314
1314
  id String @id @default(uuid())
1315
- /// Stable key within scope — platform: `platform_terms`, org interview: `interview_session`
1316
- slug String
1317
1315
  consent_type ConsentType
1318
- /// Null = platform-wide catalog row; set = tenant-specific overlay (v1: interview session notice)
1319
1316
  organisation_id String?
1320
1317
  organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
1321
- display_name String?
1322
- is_active Boolean @default(true)
1323
1318
  created_at DateTime @default(now())
1324
1319
  updated_at DateTime @updatedAt
1325
1320
  versions ConsentDocumentVersion[]
1326
1321
 
1327
- @@unique([organisation_id, slug])
1328
- @@index([consent_type, organisation_id, is_active])
1322
+ @@unique([organisation_id, consent_type])
1323
+ @@index([consent_type, organisation_id])
1329
1324
  @@schema("public")
1330
1325
  }
1331
1326
 
1327
+ /// One immutable markdown object per version; S3 location and hash live on the linked Document.
1332
1328
  model ConsentDocumentVersion {
1333
- id String @id @default(uuid())
1334
- document_id String
1335
- document ConsentDocument @relation(fields: [document_id], references: [id], onDelete: Cascade)
1336
- version_number Int
1337
- content_hash String
1338
- locale String @default("en")
1339
- template_version_label String?
1340
- s3_bucket String?
1341
- /// Immutable snapshot path (audit binding)
1342
- s3_archive_key String?
1343
- /// Read-optimized current copy under active/
1344
- s3_active_key String?
1345
- /// Optional immutable archive row in shared Document catalog (org ingest)
1346
- s3_document_id String?
1347
- s3_document Document? @relation(fields: [s3_document_id], references: [id], onDelete: SetNull)
1348
- status ConsentCatalogVersionStatus @default(PUBLISHED)
1349
- published_at DateTime?
1350
- created_at DateTime @default(now())
1351
- checkboxes ConsentCheckboxDefinition[]
1352
- consent_records ConsentRecord[]
1353
- system_consent_epochs SystemConsentEpoch[]
1354
-
1355
- @@unique([document_id, version_number])
1356
- @@index([document_id, published_at(sort: Desc)])
1357
- @@index([s3_document_id])
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])
1358
1345
  @@schema("public")
1359
1346
  }
1360
1347
 
1361
1348
  model ConsentCheckboxDefinition {
1362
- id String @id @default(uuid())
1363
- document_version_id String
1364
- document_version ConsentDocumentVersion @relation(fields: [document_version_id], references: [id], onDelete: Cascade)
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)
1365
1352
  /// Stable machine key in ConsentRecord.selections JSON
1366
- checkbox_key String
1367
- label String
1368
- sort_order Int @default(0)
1369
- default_required_hint Boolean @default(true)
1353
+ checkbox_key String
1354
+ label String
1355
+ sort_order Int @default(0)
1356
+ default_required_hint Boolean @default(true)
1370
1357
 
1371
- @@unique([document_version_id, checkbox_key])
1358
+ @@unique([consent_document_version_id, checkbox_key])
1372
1359
  @@schema("public")
1373
1360
  }
1374
1361
 
1362
+ /// Consent type is resolved via consent_document_version -> consent_document.consent_type.
1375
1363
  model ConsentRecord {
1376
- id String @id @default(uuid())
1377
- user_id String
1378
- user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
1379
- consent_type ConsentType
1380
- outcome ConsentOutcome
1381
- document_version_id String
1382
- document_version ConsentDocumentVersion @relation(fields: [document_version_id], references: [id], onDelete: Restrict)
1383
- template_version_label String?
1384
- context_snapshot Json?
1385
- selections Json @default("{}")
1386
- reference_type ConsentReferenceType?
1387
- reference_id String?
1388
- ip_address String?
1389
- user_agent String?
1390
- decline_reason String?
1391
- created_at DateTime @default(now())
1392
-
1393
- @@index([user_id, consent_type, created_at(sort: Desc)])
1394
- @@index([reference_type, reference_id, consent_type, created_at(sort: Desc)])
1395
- @@schema("public")
1396
- }
1397
-
1398
- // Platform-wide re-consent watermark (complements per-interview consent_epoch_at).
1399
- // epoch_at is the effective instant for platform re-consent (can differ from created_at when policy changes are backdated).
1400
- model SystemConsentEpoch {
1401
- id String @id @default(uuid())
1402
- consent_type ConsentType
1403
- epoch_at DateTime @default(now())
1404
- document_version_id String?
1405
- document_version ConsentDocumentVersion? @relation(fields: [document_version_id], references: [id], onDelete: SetNull)
1406
- reason String?
1407
- created_at DateTime @default(now())
1408
-
1409
- @@index([consent_type, epoch_at(sort: Desc)])
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])
1410
1381
  @@schema("public")
1411
1382
  }
1412
1383
 
@@ -3733,79 +3704,74 @@ enum HiringUnitAssignmentScope {
3733
3704
  }
3734
3705
 
3735
3706
  model Organisation {
3736
- id String @id @default(uuid())
3737
- name String @unique
3738
- industry String
3739
- about String
3740
- website String
3741
- size OrganisationSize @default(ONE_TO_TEN)
3742
- phone String
3743
- address String
3744
- company_values Json[]
3745
- allowed_email_domains String[]
3746
- send_email Boolean @default(true)
3747
- interviewers User[]
3748
- created_at DateTime @default(now())
3749
- updated_at DateTime @updatedAt
3750
- created_by String
3751
- updated_by String
3752
- is_active Boolean @default(true)
3753
- alias String? @unique
3754
- logo String?
3755
- job_sequence Int @default(1)
3756
- employee_sequence Int @default(1)
3757
- applications Application[]
3758
- user_roles UserRole[]
3759
- job_descriptions JobDescription[]
3760
- job_profiles JobProfile[]
3761
- assessment_library AssessmentLibrary[]
3762
- assignment_library AssignmentLibrary[]
3763
- interviews Interview[]
3764
- assignments Assignment[]
3765
- fit_check FitCheck[] // one-to-many link
3766
- resumes Resume[] // one-to-many link
3767
- approvals Approval[] // one-to-many link
3768
- suggestions Suggestion[]
3769
- ongoing_evaluations OngoingEvaluation[] // optional one-to-many
3770
- actions Action[]
3771
- integration_credentials IntegrationCredential[]
3772
- zoho_sync_mappings ZohoSyncMapping[]
3773
- assessments Assessment[]
3774
- timezone String @default("Asia/Kolkata")
3707
+ id String @id @default(uuid())
3708
+ name String @unique
3709
+ industry String
3710
+ about String
3711
+ website String
3712
+ size OrganisationSize @default(ONE_TO_TEN)
3713
+ phone String
3714
+ address String
3715
+ company_values Json[]
3716
+ allowed_email_domains String[]
3717
+ send_email Boolean @default(true)
3718
+ interviewers User[]
3719
+ created_at DateTime @default(now())
3720
+ updated_at DateTime @updatedAt
3721
+ created_by String
3722
+ updated_by String
3723
+ is_active Boolean @default(true)
3724
+ alias String? @unique
3725
+ logo String?
3726
+ job_sequence Int @default(1)
3727
+ employee_sequence Int @default(1)
3728
+ applications Application[]
3729
+ user_roles UserRole[]
3730
+ job_descriptions JobDescription[]
3731
+ job_profiles JobProfile[]
3732
+ assessment_library AssessmentLibrary[]
3733
+ assignment_library AssignmentLibrary[]
3734
+ interviews Interview[]
3735
+ assignments Assignment[]
3736
+ fit_check FitCheck[] // one-to-many link
3737
+ resumes Resume[] // one-to-many link
3738
+ approvals Approval[] // one-to-many link
3739
+ suggestions Suggestion[]
3740
+ ongoing_evaluations OngoingEvaluation[] // optional one-to-many
3741
+ actions Action[]
3742
+ integration_credentials IntegrationCredential[]
3743
+ zoho_sync_mappings ZohoSyncMapping[]
3744
+ assessments Assessment[]
3745
+ timezone String @default("Asia/Kolkata")
3775
3746
  /// ISO 3166-1 alpha-2 (e.g. IN).
3776
- country_code String @default("IN")
3747
+ country_code String @default("IN")
3777
3748
  /// Who may consume unused hiring units. Does not rewrite unit rows when changed.
3778
- hiring_unit_assignment_scope HiringUnitAssignmentScope @default(DEPARTMENT)
3779
- organisation_configs OrganisationConfig[]
3780
- activity_events ActivityEvent[]
3781
- usage_ledger_entries UsageLedgerEntry[]
3782
- usage_aggregates UsageAggregate[]
3783
- channel_provider_configs ChannelProviderConfig[]
3784
- conversations Conversation[]
3785
- communication_messages CommunicationMessage[]
3786
- job_application_fields JobApplicationField[]
3787
- documents Document[]
3788
- job_application_templates JobApplicationTemplate[]
3789
- offer_letter_templates OfferLetterTemplate[]
3790
- offers Offer[]
3791
- sources Source[]
3792
- evaluation_criteria EvaluationCriteria[]
3793
- departments Department[]
3794
- hiring_plans HiringPlan[]
3795
- employees Employee[]
3796
- competency_dictionaries CompetencyDictionary[]
3797
- purchased_license_packages PurchasedLicensePackage[]
3798
- purchased_hiring_units PurchasedHiringUnit[]
3799
- purchased_top_ups PurchasedTopUp[]
3800
- licensing_ledger_entries LicensingLedgerEntry[]
3801
- license_package_organisations LicensePackageOrganisation[]
3802
- ai_cost_ledger_entries AiCostLedgerEntry[]
3803
- consent_documents ConsentDocument[]
3804
- /// Deprecated — migrate to org-scoped ConsentDocument; kept for legacy S3 fallback until backfill completes
3805
- has_custom_consent Boolean @default(false)
3806
- consent_s3_bucket String?
3807
- consent_s3_region String?
3808
- custom_interview_consent_s3_key_prefix String?
3749
+ hiring_unit_assignment_scope HiringUnitAssignmentScope @default(DEPARTMENT)
3750
+ organisation_configs OrganisationConfig[]
3751
+ activity_events ActivityEvent[]
3752
+ usage_ledger_entries UsageLedgerEntry[]
3753
+ usage_aggregates UsageAggregate[]
3754
+ channel_provider_configs ChannelProviderConfig[]
3755
+ conversations Conversation[]
3756
+ communication_messages CommunicationMessage[]
3757
+ job_application_fields JobApplicationField[]
3758
+ documents Document[]
3759
+ job_application_templates JobApplicationTemplate[]
3760
+ offer_letter_templates OfferLetterTemplate[]
3761
+ offers Offer[]
3762
+ sources Source[]
3763
+ evaluation_criteria EvaluationCriteria[]
3764
+ departments Department[]
3765
+ hiring_plans HiringPlan[]
3766
+ employees Employee[]
3767
+ competency_dictionaries CompetencyDictionary[]
3768
+ purchased_license_packages PurchasedLicensePackage[]
3769
+ purchased_hiring_units PurchasedHiringUnit[]
3770
+ purchased_top_ups PurchasedTopUp[]
3771
+ licensing_ledger_entries LicensingLedgerEntry[]
3772
+ license_package_organisations LicensePackageOrganisation[]
3773
+ ai_cost_ledger_entries AiCostLedgerEntry[]
3774
+ consent_documents ConsentDocument[]
3809
3775
 
3810
3776
  @@index([name])
3811
3777
  @@schema("public")
@@ -4247,6 +4213,9 @@ model Resume {
4247
4213
  conversation_history Json?
4248
4214
  /// Progress 0-100 reported by the ResumeIntake workflow.
4249
4215
  intake_progress Int?
4216
+ /// Set when the candidate archives the resume; null = active. Archived
4217
+ /// resumes are hidden from resume pickers (e.g. the apply flow).
4218
+ archived_at DateTime?
4250
4219
  /// Last Orion execution id for the intake/generate workflow, for tracing.
4251
4220
  orion_execution_id String?
4252
4221
  /// Snapshot of the candidate's own words, taken immediately before the