@adaptware/eagles-db 0.5.37 → 0.5.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptware/eagles-db",
3
- "version": "0.5.37",
3
+ "version": "0.5.39",
4
4
  "description": "A Prisma client package for Treadspace database operations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/prisma/.DS_Store CHANGED
Binary file
Binary file
@@ -38,40 +38,44 @@ enum ApplicationOfferSubstatus {
38
38
 
39
39
  model Application {
40
40
  /// Primary key
41
- id String @id @default(uuid())
41
+ id String @id @default(uuid())
42
42
  /// Foreign keys
43
- organisation_id String
44
- candidate_id String
45
- resume_id String
46
- job_description_id String
47
- evaluation_plan_id String?
48
- recruiter_id String?
49
- source_id String?
43
+ organisation_id String
44
+ candidate_id String
45
+ resume_id String
46
+ job_description_id String
47
+ evaluation_plan_id String?
48
+ recruiter_id String?
49
+ source_id String?
50
50
  /// Data fields
51
- fit_check_score Float?
52
- applied_at DateTime @default(now())
53
- round_no Int @default(0)
54
- is_jaf_completed Boolean @default(false)
55
- proceed_to_next_round Boolean? @default(false)
56
- evaluationComment String?
51
+ fit_check_score Float?
52
+ applied_at DateTime @default(now())
53
+ round_no Int @default(0)
54
+ is_jaf_completed Boolean @default(false)
55
+ proceed_to_next_round Boolean? @default(false)
56
+ evaluationComment String?
57
57
  /// Candidate flag (orthogonal to ApplicationStatus). Latest actor/comment only.
58
- is_flagged Boolean @default(false)
59
- flag_comment String?
60
- flagged_at DateTime?
61
- flagged_by String?
62
- unflag_comment String?
63
- unflagged_at DateTime?
64
- unflagged_by String?
65
- fit_check_status FitCheckStatus?
66
- status ApplicationStatus @default(PENDING)
58
+ is_flagged Boolean @default(false)
59
+ flag_comment String?
60
+ flagged_at DateTime?
61
+ flagged_by String?
62
+ unflag_comment String?
63
+ unflagged_at DateTime?
64
+ unflagged_by String?
65
+ fit_check_status FitCheckStatus?
66
+ status ApplicationStatus @default(PENDING)
67
67
  /// Fine-grained offer-stage state. Meaningful only when status = OFFER (or was OFFER for a terminal-substatus that flipped to REJECTED / JOINED).
68
- offer_substatus ApplicationOfferSubstatus?
68
+ offer_substatus ApplicationOfferSubstatus?
69
69
  /// Audit fields
70
- created_at DateTime @default(now())
71
- updated_at DateTime @updatedAt
72
- created_by String
73
- updated_by String
74
- is_active Boolean @default(true)
70
+ created_at DateTime @default(now())
71
+ updated_at DateTime @updatedAt
72
+ created_by String
73
+ updated_by String
74
+ is_active Boolean @default(true)
75
+ fit_check_report_document_id String? @unique
76
+ fit_check_report_updated_flag Boolean @default(false)
77
+ fit_check_report_data Json? @default("{}")
78
+
75
79
  /// Relations
76
80
  evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id])
77
81
  candidate User @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
@@ -90,6 +94,7 @@ model Application {
90
94
  communication_messages CommunicationMessage[]
91
95
  job_application_responses JobApplicationResponse[]
92
96
  offer Offer?
97
+ fit_check_report_document Document? @relation("ApplicationFitCheckReportDocument", fields: [fit_check_report_document_id], references: [id], onDelete: SetNull)
93
98
 
94
99
  @@unique([candidate_id, job_description_id]) // Ensures candidate applies only once per job
95
100
  @@index([candidate_id])
@@ -37,6 +37,7 @@ model Document {
37
37
  offer_letters OfferLetter[] @relation("OfferLetterPdf")
38
38
  offer_letter_template_snapshots OfferLetter[] @relation("OfferLetterTemplateSnapshot")
39
39
  offer_draft_edited_html Offer[] @relation("OfferDraftEditedHtml")
40
+ application_fit_check_report Application? @relation("ApplicationFitCheckReportDocument")
40
41
 
41
42
  // Indexes
42
43
  @@index([candidate_id])
@@ -0,0 +1,13 @@
1
+ ALTER TABLE "Application"
2
+ ADD COLUMN IF NOT EXISTS "fit_check_report_document_id" TEXT,
3
+ ADD COLUMN IF NOT EXISTS "fit_check_report_updated_flag" BOOLEAN NOT NULL DEFAULT FALSE;
4
+
5
+ CREATE UNIQUE INDEX IF NOT EXISTS "Application_fit_check_report_document_id_key"
6
+ ON "Application"("fit_check_report_document_id");
7
+
8
+ ALTER TABLE "Application"
9
+ DROP CONSTRAINT IF EXISTS "Application_fit_check_report_document_id_fkey",
10
+ ADD CONSTRAINT "Application_fit_check_report_document_id_fkey"
11
+ FOREIGN KEY ("fit_check_report_document_id")
12
+ REFERENCES "Document"("id")
13
+ ON DELETE SET NULL ON UPDATE CASCADE;
@@ -1,2 +0,0 @@
1
- -- Migrate legacy terminal-positive status to SELECTED (SHORTLISTED enum value retained but unused).
2
- UPDATE applications SET status = 'SELECTED' WHERE status = 'SHORTLISTED';