@valentine-efagene/qshelter-common 2.0.56 → 2.0.58
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/dist/generated/client/enums.d.ts +3 -0
- package/dist/generated/client/enums.js +4 -1
- package/dist/generated/client/internal/class.js +2 -2
- package/dist/generated/client/internal/prismaNamespace.d.ts +6 -0
- package/dist/generated/client/internal/prismaNamespace.js +7 -1
- package/dist/generated/client/internal/prismaNamespaceBrowser.d.ts +6 -0
- package/dist/generated/client/internal/prismaNamespaceBrowser.js +7 -1
- package/dist/generated/client/models/ContractPhase.d.ts +345 -1
- package/dist/generated/client/models/DocumentationStep.d.ts +337 -1
- package/package.json +1 -1
- package/prisma/migrations/20260105081842_unify_contract_events/migration.sql +37 -0
- package/prisma/migrations/20260105085337_simplify_los_remove_prequalification/migration.sql +1 -0
- package/prisma/migrations/20260105094604_workflow_tracking_current_step/migration.sql +14 -0
- package/prisma/schema.prisma +28 -1
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `createdAt` on the `contract_events` table. All the data in the column will be lost.
|
|
5
|
+
- You are about to drop the column `event` on the `contract_events` table. All the data in the column will be lost.
|
|
6
|
+
- You are about to alter the column `data` on the `contract_events` table. The data in that column could be lost. The data in that column will be cast from `Text` to `Json`.
|
|
7
|
+
- You are about to drop the `contract_transitions` table. If the table is not empty, all the data it contains will be lost.
|
|
8
|
+
- Added the required column `eventType` to the `contract_events` table without a default value. This is not possible if the table is not empty.
|
|
9
|
+
|
|
10
|
+
*/
|
|
11
|
+
-- DropForeignKey
|
|
12
|
+
ALTER TABLE `contract_transitions` DROP FOREIGN KEY `contract_transitions_contractId_fkey`;
|
|
13
|
+
|
|
14
|
+
-- AlterTable
|
|
15
|
+
ALTER TABLE `contract_events` DROP COLUMN `createdAt`,
|
|
16
|
+
DROP COLUMN `event`,
|
|
17
|
+
ADD COLUMN `actorId` VARCHAR(191) NULL,
|
|
18
|
+
ADD COLUMN `actorType` VARCHAR(191) NULL,
|
|
19
|
+
ADD COLUMN `eventGroup` VARCHAR(191) NULL,
|
|
20
|
+
ADD COLUMN `eventType` VARCHAR(191) NOT NULL,
|
|
21
|
+
ADD COLUMN `fromState` VARCHAR(191) NULL,
|
|
22
|
+
ADD COLUMN `occurredAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
23
|
+
ADD COLUMN `toState` VARCHAR(191) NULL,
|
|
24
|
+
ADD COLUMN `trigger` VARCHAR(191) NULL,
|
|
25
|
+
MODIFY `data` JSON NULL;
|
|
26
|
+
|
|
27
|
+
-- DropTable
|
|
28
|
+
DROP TABLE `contract_transitions`;
|
|
29
|
+
|
|
30
|
+
-- CreateIndex
|
|
31
|
+
CREATE INDEX `contract_events_eventType_idx` ON `contract_events`(`eventType`);
|
|
32
|
+
|
|
33
|
+
-- CreateIndex
|
|
34
|
+
CREATE INDEX `contract_events_eventGroup_idx` ON `contract_events`(`eventGroup`);
|
|
35
|
+
|
|
36
|
+
-- CreateIndex
|
|
37
|
+
CREATE INDEX `contract_events_occurredAt_idx` ON `contract_events`(`occurredAt`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
-- This is an empty migration.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE `contract_phase_steps` ADD COLUMN `actionReason` TEXT NULL,
|
|
3
|
+
ADD COLUMN `lastSubmittedAt` DATETIME(3) NULL,
|
|
4
|
+
ADD COLUMN `submissionCount` INTEGER NOT NULL DEFAULT 0,
|
|
5
|
+
MODIFY `status` ENUM('PENDING', 'IN_PROGRESS', 'COMPLETED', 'FAILED', 'SKIPPED', 'NEEDS_RESUBMISSION', 'ACTION_REQUIRED', 'AWAITING_REVIEW') NOT NULL DEFAULT 'PENDING';
|
|
6
|
+
|
|
7
|
+
-- AlterTable
|
|
8
|
+
ALTER TABLE `contract_phases` ADD COLUMN `currentStepId` VARCHAR(191) NULL;
|
|
9
|
+
|
|
10
|
+
-- CreateIndex
|
|
11
|
+
CREATE INDEX `contract_phases_currentStepId_idx` ON `contract_phases`(`currentStepId`);
|
|
12
|
+
|
|
13
|
+
-- AddForeignKey
|
|
14
|
+
ALTER TABLE `contract_phases` ADD CONSTRAINT `contract_phases_currentStepId_fkey` FOREIGN KEY (`currentStepId`) REFERENCES `contract_phase_steps`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
package/prisma/schema.prisma
CHANGED
|
@@ -79,6 +79,9 @@ enum StepStatus {
|
|
|
79
79
|
COMPLETED
|
|
80
80
|
FAILED
|
|
81
81
|
SKIPPED
|
|
82
|
+
NEEDS_RESUBMISSION // User must re-upload or correct something (after rejection)
|
|
83
|
+
ACTION_REQUIRED // User action needed (generic - check actionReason)
|
|
84
|
+
AWAITING_REVIEW // Submitted, waiting for admin/system review
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
enum InstallmentStatus {
|
|
@@ -965,6 +968,15 @@ model ContractPhase {
|
|
|
965
968
|
// FSM state for this phase (DB-enforced enum)
|
|
966
969
|
status PhaseStatus @default(PENDING)
|
|
967
970
|
|
|
971
|
+
// =========================================================================
|
|
972
|
+
// WORKFLOW TRACKING - Current step pointer for UX and orchestration
|
|
973
|
+
// =========================================================================
|
|
974
|
+
// Canonical pointer to the step currently requiring attention.
|
|
975
|
+
// Updated by service when: phase activates (→ first step), step completes (→ next),
|
|
976
|
+
// step rejected (→ same step with NEEDS_RESUBMISSION), or phase completes (→ null).
|
|
977
|
+
currentStepId String?
|
|
978
|
+
currentStep DocumentationStep? @relation("CurrentStep", fields: [currentStepId], references: [id])
|
|
979
|
+
|
|
968
980
|
// Financial details (for PAYMENT phases)
|
|
969
981
|
totalAmount Float?
|
|
970
982
|
paidAmount Float @default(0)
|
|
@@ -1012,6 +1024,7 @@ model ContractPhase {
|
|
|
1012
1024
|
@@index([phaseCategory])
|
|
1013
1025
|
@@index([status])
|
|
1014
1026
|
@@index([order])
|
|
1027
|
+
@@index([currentStepId])
|
|
1015
1028
|
@@map("contract_phases")
|
|
1016
1029
|
}
|
|
1017
1030
|
|
|
@@ -1028,6 +1041,19 @@ model DocumentationStep {
|
|
|
1028
1041
|
|
|
1029
1042
|
status StepStatus @default(PENDING)
|
|
1030
1043
|
|
|
1044
|
+
// =========================================================================
|
|
1045
|
+
// USER ACTION TRACKING - For rejection/resubmission flows
|
|
1046
|
+
// =========================================================================
|
|
1047
|
+
// When status is NEEDS_RESUBMISSION or ACTION_REQUIRED, this explains why.
|
|
1048
|
+
// Populated from DocumentationStepApproval.comment on rejection.
|
|
1049
|
+
actionReason String? @db.Text
|
|
1050
|
+
|
|
1051
|
+
// Number of times this step has been submitted (for tracking resubmissions)
|
|
1052
|
+
submissionCount Int @default(0)
|
|
1053
|
+
|
|
1054
|
+
// Last submission timestamp (for tracking resubmission timing)
|
|
1055
|
+
lastSubmittedAt DateTime?
|
|
1056
|
+
|
|
1031
1057
|
// Configuration metadata (for GENERATE_DOCUMENT steps, etc.)
|
|
1032
1058
|
metadata Json?
|
|
1033
1059
|
|
|
@@ -1054,7 +1080,8 @@ model DocumentationStep {
|
|
|
1054
1080
|
createdAt DateTime @default(now())
|
|
1055
1081
|
updatedAt DateTime @updatedAt
|
|
1056
1082
|
|
|
1057
|
-
approvals
|
|
1083
|
+
approvals DocumentationStepApproval[]
|
|
1084
|
+
currentForPhase ContractPhase[] @relation("CurrentStep")
|
|
1058
1085
|
|
|
1059
1086
|
@@index([phaseId])
|
|
1060
1087
|
@@index([status])
|