@valentine-efagene/qshelter-common 2.0.142 → 2.0.143

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": "@valentine-efagene/qshelter-common",
3
- "version": "2.0.142",
3
+ "version": "2.0.143",
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",
@@ -0,0 +1,102 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `completedStepsCount` on the `documentation_phases` table. All the data in the column will be lost.
5
+ - You are about to drop the column `completionCriterion` on the `documentation_phases` table. All the data in the column will be lost.
6
+ - You are about to drop the column `currentStepId` on the `documentation_phases` table. All the data in the column will be lost.
7
+ - You are about to drop the column `minimumCompletionPercentage` on the `documentation_phases` table. All the data in the column will be lost.
8
+ - You are about to drop the column `requiredDocumentSnapshot` on the `documentation_phases` table. All the data in the column will be lost.
9
+ - You are about to drop the column `stepDefinitionsSnapshot` on the `documentation_phases` table. All the data in the column will be lost.
10
+ - You are about to drop the column `totalStepsCount` on the `documentation_phases` table. All the data in the column will be lost.
11
+ - You are about to drop the `documentation_plan_steps` table. If the table is not empty, all the data it contains will be lost.
12
+ - You are about to drop the `documentation_step_approvals` table. If the table is not empty, all the data it contains will be lost.
13
+ - You are about to drop the `documentation_step_documents` table. If the table is not empty, all the data it contains will be lost.
14
+ - You are about to drop the `documentation_steps` table. If the table is not empty, all the data it contains will be lost.
15
+
16
+ */
17
+ -- DropForeignKey
18
+ ALTER TABLE `documentation_phases` DROP FOREIGN KEY `documentation_phases_currentStepId_fkey`;
19
+
20
+ -- DropForeignKey
21
+ ALTER TABLE `documentation_plan_steps` DROP FOREIGN KEY `documentation_plan_steps_planId_fkey`;
22
+
23
+ -- DropForeignKey
24
+ ALTER TABLE `documentation_step_approvals` DROP FOREIGN KEY `documentation_step_approvals_approverId_fkey`;
25
+
26
+ -- DropForeignKey
27
+ ALTER TABLE `documentation_step_approvals` DROP FOREIGN KEY `documentation_step_approvals_stepId_fkey`;
28
+
29
+ -- DropForeignKey
30
+ ALTER TABLE `documentation_step_approvals` DROP FOREIGN KEY `documentation_step_approvals_tenantId_fkey`;
31
+
32
+ -- DropForeignKey
33
+ ALTER TABLE `documentation_step_documents` DROP FOREIGN KEY `documentation_step_documents_stepId_fkey`;
34
+
35
+ -- DropForeignKey
36
+ ALTER TABLE `documentation_step_documents` DROP FOREIGN KEY `documentation_step_documents_tenantId_fkey`;
37
+
38
+ -- DropForeignKey
39
+ ALTER TABLE `documentation_steps` DROP FOREIGN KEY `documentation_steps_assigneeId_fkey`;
40
+
41
+ -- DropForeignKey
42
+ ALTER TABLE `documentation_steps` DROP FOREIGN KEY `documentation_steps_documentationPhaseId_fkey`;
43
+
44
+ -- DropForeignKey
45
+ ALTER TABLE `documentation_steps` DROP FOREIGN KEY `documentation_steps_gateActedById_fkey`;
46
+
47
+ -- DropForeignKey
48
+ ALTER TABLE `documentation_steps` DROP FOREIGN KEY `documentation_steps_tenantId_fkey`;
49
+
50
+ -- DropIndex
51
+ DROP INDEX `documentation_phases_currentStepId_idx` ON `documentation_phases`;
52
+
53
+ -- AlterTable
54
+ ALTER TABLE `documentation_phases` DROP COLUMN `completedStepsCount`,
55
+ DROP COLUMN `completionCriterion`,
56
+ DROP COLUMN `currentStepId`,
57
+ DROP COLUMN `minimumCompletionPercentage`,
58
+ DROP COLUMN `requiredDocumentSnapshot`,
59
+ DROP COLUMN `stepDefinitionsSnapshot`,
60
+ DROP COLUMN `totalStepsCount`,
61
+ ADD COLUMN `approvalStagesSnapshot` JSON NULL,
62
+ ADD COLUMN `currentStageOrder` INTEGER NOT NULL DEFAULT 1,
63
+ ADD COLUMN `documentDefinitionsSnapshot` JSON NULL;
64
+
65
+ -- DropTable
66
+ DROP TABLE `documentation_plan_steps`;
67
+
68
+ -- DropTable
69
+ DROP TABLE `documentation_step_approvals`;
70
+
71
+ -- DropTable
72
+ DROP TABLE `documentation_step_documents`;
73
+
74
+ -- DropTable
75
+ DROP TABLE `documentation_steps`;
76
+
77
+ -- CreateTable
78
+ CREATE TABLE `questionnaire_phase_reviews` (
79
+ `id` VARCHAR(191) NOT NULL,
80
+ `tenantId` VARCHAR(191) NOT NULL,
81
+ `questionnairePhaseId` VARCHAR(191) NOT NULL,
82
+ `reviewerId` VARCHAR(191) NOT NULL,
83
+ `decision` ENUM('PENDING', 'APPROVED', 'REJECTED', 'CHANGES_REQUESTED', 'WAIVED') NOT NULL,
84
+ `notes` TEXT NULL,
85
+ `scoreAtReview` INTEGER NULL,
86
+ `passedAtReview` BOOLEAN NULL,
87
+ `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
88
+
89
+ INDEX `questionnaire_phase_reviews_tenantId_idx`(`tenantId`),
90
+ INDEX `questionnaire_phase_reviews_questionnairePhaseId_idx`(`questionnairePhaseId`),
91
+ INDEX `questionnaire_phase_reviews_reviewerId_idx`(`reviewerId`),
92
+ PRIMARY KEY (`id`)
93
+ ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
94
+
95
+ -- AddForeignKey
96
+ ALTER TABLE `questionnaire_phase_reviews` ADD CONSTRAINT `questionnaire_phase_reviews_tenantId_fkey` FOREIGN KEY (`tenantId`) REFERENCES `tenants`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
97
+
98
+ -- AddForeignKey
99
+ ALTER TABLE `questionnaire_phase_reviews` ADD CONSTRAINT `questionnaire_phase_reviews_questionnairePhaseId_fkey` FOREIGN KEY (`questionnairePhaseId`) REFERENCES `questionnaire_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
100
+
101
+ -- AddForeignKey
102
+ ALTER TABLE `questionnaire_phase_reviews` ADD CONSTRAINT `questionnaire_phase_reviews_reviewerId_fkey` FOREIGN KEY (`reviewerId`) REFERENCES `users`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;