@valentine-efagene/qshelter-common 2.0.47 → 2.0.49

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.
@@ -31,9 +31,9 @@ export type * from './models/PaymentMethodPhaseStep.js';
31
31
  export type * from './models/PaymentMethodPhaseDocument.js';
32
32
  export type * from './models/Contract.js';
33
33
  export type * from './models/ContractPhase.js';
34
- export type * from './models/ContractPhaseStep.js';
35
- export type * from './models/ContractPhaseStepDocument.js';
36
- export type * from './models/ContractPhaseStepApproval.js';
34
+ export type * from './models/DocumentationStep.js';
35
+ export type * from './models/DocumentationStepDocument.js';
36
+ export type * from './models/DocumentationStepApproval.js';
37
37
  export type * from './models/ContractInstallment.js';
38
38
  export type * from './models/ContractPayment.js';
39
39
  export type * from './models/ContractDocument.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valentine-efagene/qshelter-common",
3
- "version": "2.0.47",
3
+ "version": "2.0.49",
4
4
  "description": "Shared database schemas and utilities for QShelter services",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -58,6 +58,7 @@ enum PhaseStatus {
58
58
  COMPLETED
59
59
  SKIPPED
60
60
  FAILED
61
+ SUPERSEDED // Phase replaced by payment method change
61
62
  }
62
63
 
63
64
  enum StepType {
@@ -224,9 +225,9 @@ model User {
224
225
  soldContracts Contract[] @relation("ContractSeller")
225
226
  contractPayments ContractPayment[] @relation("ContractPayer")
226
227
 
227
- // Phase step assignments and approvals
228
- assignedSteps ContractPhaseStep[] @relation("PhaseStepAssignee")
229
- stepApprovals ContractPhaseStepApproval[] @relation("PhaseStepApprover")
228
+ // Documentation step assignments and approvals
229
+ assignedSteps DocumentationStep[] @relation("DocumentationStepAssignee")
230
+ stepApprovals DocumentationStepApproval[] @relation("DocumentationStepApprover")
230
231
  uploadedDocs ContractDocument[] @relation("DocumentUploader")
231
232
 
232
233
  // Prequalification and payment method changes
@@ -1013,7 +1014,7 @@ model ContractPhase {
1013
1014
  // Relations
1014
1015
  installments ContractInstallment[]
1015
1016
  payments ContractPayment[]
1016
- steps ContractPhaseStep[] // For DOCUMENTATION phases (FSM steps)
1017
+ steps DocumentationStep[] // For DOCUMENTATION phases (FSM steps)
1017
1018
 
1018
1019
  @@index([contractId])
1019
1020
  @@index([paymentPlanId])
@@ -1024,7 +1025,7 @@ model ContractPhase {
1024
1025
  }
1025
1026
 
1026
1027
  // Steps within a DOCUMENTATION phase (FSM for document collection/approval)
1027
- model ContractPhaseStep {
1028
+ model DocumentationStep {
1028
1029
  id String @id @default(cuid())
1029
1030
  phaseId String
1030
1031
  phase ContractPhase @relation(fields: [phaseId], references: [id], onDelete: Cascade)
@@ -1041,10 +1042,10 @@ model ContractPhaseStep {
1041
1042
 
1042
1043
  // Assignment
1043
1044
  assigneeId String?
1044
- assignee User? @relation("PhaseStepAssignee", fields: [assigneeId], references: [id])
1045
+ assignee User? @relation("DocumentationStepAssignee", fields: [assigneeId], references: [id])
1045
1046
 
1046
1047
  // Required document types for UPLOAD steps (normalized)
1047
- requiredDocuments ContractPhaseStepDocument[]
1048
+ requiredDocuments DocumentationStepDocument[]
1048
1049
 
1049
1050
  // Timing
1050
1051
  dueDate DateTime?
@@ -1053,7 +1054,7 @@ model ContractPhaseStep {
1053
1054
  createdAt DateTime @default(now())
1054
1055
  updatedAt DateTime @updatedAt
1055
1056
 
1056
- approvals ContractPhaseStepApproval[]
1057
+ approvals DocumentationStepApproval[]
1057
1058
 
1058
1059
  @@index([phaseId])
1059
1060
  @@index([status])
@@ -1062,10 +1063,10 @@ model ContractPhaseStep {
1062
1063
  }
1063
1064
 
1064
1065
  // Required documents for a step (normalized from CSV)
1065
- model ContractPhaseStepDocument {
1066
+ model DocumentationStepDocument {
1066
1067
  id String @id @default(cuid())
1067
1068
  stepId String
1068
- step ContractPhaseStep @relation(fields: [stepId], references: [id], onDelete: Cascade)
1069
+ step DocumentationStep @relation(fields: [stepId], references: [id], onDelete: Cascade)
1069
1070
 
1070
1071
  documentType String
1071
1072
  isRequired Boolean @default(true)
@@ -1077,12 +1078,12 @@ model ContractPhaseStepDocument {
1077
1078
  }
1078
1079
 
1079
1080
  // Approvals for documentation steps
1080
- model ContractPhaseStepApproval {
1081
+ model DocumentationStepApproval {
1081
1082
  id String @id @default(cuid())
1082
1083
  stepId String
1083
- step ContractPhaseStep @relation(fields: [stepId], references: [id], onDelete: Cascade)
1084
+ step DocumentationStep @relation(fields: [stepId], references: [id], onDelete: Cascade)
1084
1085
  approverId String?
1085
- approver User? @relation("PhaseStepApprover", fields: [approverId], references: [id])
1086
+ approver User? @relation("DocumentationStepApprover", fields: [approverId], references: [id])
1086
1087
 
1087
1088
  decision ApprovalDecision
1088
1089
  comment String? @db.Text