@valentine-efagene/qshelter-common 2.0.84 → 2.0.87
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/browser.d.ts +25 -0
- package/dist/generated/client/client.d.ts +25 -0
- package/dist/generated/client/commonInputTypes.d.ts +30 -0
- package/dist/generated/client/enums.d.ts +18 -0
- package/dist/generated/client/enums.js +17 -0
- package/dist/generated/client/internal/class.d.ts +55 -0
- package/dist/generated/client/internal/class.js +2 -2
- package/dist/generated/client/internal/prismaNamespace.d.ts +469 -42
- package/dist/generated/client/internal/prismaNamespace.js +118 -40
- package/dist/generated/client/internal/prismaNamespaceBrowser.d.ts +129 -41
- package/dist/generated/client/internal/prismaNamespaceBrowser.js +118 -40
- package/dist/generated/client/models/Contract.d.ts +303 -1574
- package/dist/generated/client/models/ContractInstallment.d.ts +77 -77
- package/dist/generated/client/models/ContractPhase.d.ts +339 -1376
- package/dist/generated/client/models/DocumentationPhase.d.ts +1649 -0
- package/dist/generated/client/models/DocumentationPhase.js +1 -0
- package/dist/generated/client/models/DocumentationStep.d.ts +126 -387
- package/dist/generated/client/models/PaymentMethodPhaseField.d.ts +1378 -0
- package/dist/generated/client/models/PaymentMethodPhaseField.js +1 -0
- package/dist/generated/client/models/PaymentPhase.d.ts +1566 -0
- package/dist/generated/client/models/PaymentPhase.js +1 -0
- package/dist/generated/client/models/PaymentPlan.d.ts +53 -53
- package/dist/generated/client/models/PropertyPaymentMethodPhase.d.ts +171 -0
- package/dist/generated/client/models/PropertyTransferRequest.d.ts +196 -70
- package/dist/generated/client/models/QuestionnaireField.d.ts +1495 -0
- package/dist/generated/client/models/QuestionnaireField.js +1 -0
- package/dist/generated/client/models/QuestionnairePhase.d.ts +1383 -0
- package/dist/generated/client/models/QuestionnairePhase.js +1 -0
- package/dist/generated/client/models.d.ts +5 -0
- package/package.json +1 -1
- package/prisma/migrations/20260109132751_update_transfer_flow/migration.sql +343 -0
- package/prisma/schema.prisma +304 -98
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -31,9 +31,14 @@ export type * from './models/PropertyPaymentMethodPhase.js';
|
|
|
31
31
|
export type * from './models/PaymentMethodPhaseStep.js';
|
|
32
32
|
export type * from './models/StepEventAttachment.js';
|
|
33
33
|
export type * from './models/PaymentMethodPhaseDocument.js';
|
|
34
|
+
export type * from './models/PaymentMethodPhaseField.js';
|
|
34
35
|
export type * from './models/Contract.js';
|
|
35
36
|
export type * from './models/ContractRefund.js';
|
|
36
37
|
export type * from './models/ContractPhase.js';
|
|
38
|
+
export type * from './models/QuestionnairePhase.js';
|
|
39
|
+
export type * from './models/DocumentationPhase.js';
|
|
40
|
+
export type * from './models/PaymentPhase.js';
|
|
41
|
+
export type * from './models/QuestionnaireField.js';
|
|
37
42
|
export type * from './models/ContractEvent.js';
|
|
38
43
|
export type * from './models/DocumentationStep.js';
|
|
39
44
|
export type * from './models/DocumentationStepDocument.js';
|
package/package.json
CHANGED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `phaseId` on the `contract_installments` table. All the data in the column will be lost.
|
|
5
|
+
- You are about to drop the column `approvedDocumentsCount` on the `contract_phases` table. All the data in the column will be lost.
|
|
6
|
+
- You are about to drop the column `collectFunds` on the `contract_phases` table. All the data in the column will be lost.
|
|
7
|
+
- You are about to drop the column `completedStepsCount` on the `contract_phases` table. All the data in the column will be lost.
|
|
8
|
+
- You are about to drop the column `completionCriterion` on the `contract_phases` table. All the data in the column will be lost.
|
|
9
|
+
- You are about to drop the column `currentStepId` on the `contract_phases` table. All the data in the column will be lost.
|
|
10
|
+
- You are about to drop the column `interestRate` on the `contract_phases` table. All the data in the column will be lost.
|
|
11
|
+
- You are about to drop the column `minimumCompletionPercentage` on the `contract_phases` table. All the data in the column will be lost.
|
|
12
|
+
- You are about to drop the column `paidAmount` on the `contract_phases` table. All the data in the column will be lost.
|
|
13
|
+
- You are about to drop the column `paymentPlanId` on the `contract_phases` table. All the data in the column will be lost.
|
|
14
|
+
- You are about to drop the column `paymentPlanSnapshot` on the `contract_phases` table. All the data in the column will be lost.
|
|
15
|
+
- You are about to drop the column `remainingAmount` on the `contract_phases` table. All the data in the column will be lost.
|
|
16
|
+
- You are about to drop the column `requiredDocumentSnapshot` on the `contract_phases` table. All the data in the column will be lost.
|
|
17
|
+
- You are about to drop the column `requiredDocumentsCount` on the `contract_phases` table. All the data in the column will be lost.
|
|
18
|
+
- You are about to drop the column `stepDefinitionsSnapshot` on the `contract_phases` table. All the data in the column will be lost.
|
|
19
|
+
- You are about to drop the column `totalAmount` on the `contract_phases` table. All the data in the column will be lost.
|
|
20
|
+
- You are about to drop the column `totalStepsCount` on the `contract_phases` table. All the data in the column will be lost.
|
|
21
|
+
- You are about to drop the column `debtToIncomeRatio` on the `contracts` table. All the data in the column will be lost.
|
|
22
|
+
- You are about to drop the column `downPayment` on the `contracts` table. All the data in the column will be lost.
|
|
23
|
+
- You are about to drop the column `downPaymentPaid` on the `contracts` table. All the data in the column will be lost.
|
|
24
|
+
- You are about to drop the column `interestRate` on the `contracts` table. All the data in the column will be lost.
|
|
25
|
+
- You are about to drop the column `monthlyExpenses` on the `contracts` table. All the data in the column will be lost.
|
|
26
|
+
- You are about to drop the column `monthlyIncome` on the `contracts` table. All the data in the column will be lost.
|
|
27
|
+
- You are about to drop the column `periodicPayment` on the `contracts` table. All the data in the column will be lost.
|
|
28
|
+
- You are about to drop the column `preApprovalAnswers` on the `contracts` table. All the data in the column will be lost.
|
|
29
|
+
- You are about to drop the column `principal` on the `contracts` table. All the data in the column will be lost.
|
|
30
|
+
- You are about to drop the column `state` on the `contracts` table. All the data in the column will be lost.
|
|
31
|
+
- You are about to drop the column `termMonths` on the `contracts` table. All the data in the column will be lost.
|
|
32
|
+
- You are about to drop the column `totalInterestPaid` on the `contracts` table. All the data in the column will be lost.
|
|
33
|
+
- You are about to drop the column `totalPaidToDate` on the `contracts` table. All the data in the column will be lost.
|
|
34
|
+
- You are about to drop the column `underwritingScore` on the `contracts` table. All the data in the column will be lost.
|
|
35
|
+
- You are about to drop the column `paymentsMigrated` on the `property_transfer_requests` table. All the data in the column will be lost.
|
|
36
|
+
- You are about to drop the `contract_phase_step_approvals` table. If the table is not empty, all the data it contains will be lost.
|
|
37
|
+
- You are about to drop the `contract_phase_step_documents` table. If the table is not empty, all the data it contains will be lost.
|
|
38
|
+
- You are about to drop the `contract_phase_steps` table. If the table is not empty, all the data it contains will be lost.
|
|
39
|
+
- Added the required column `paymentPhaseId` to the `contract_installments` table without a default value. This is not possible if the table is not empty.
|
|
40
|
+
|
|
41
|
+
*/
|
|
42
|
+
-- DropForeignKey
|
|
43
|
+
ALTER TABLE `contract_installments` DROP FOREIGN KEY `contract_installments_phaseId_fkey`;
|
|
44
|
+
|
|
45
|
+
-- DropForeignKey
|
|
46
|
+
ALTER TABLE `contract_phase_step_approvals` DROP FOREIGN KEY `contract_phase_step_approvals_approverId_fkey`;
|
|
47
|
+
|
|
48
|
+
-- DropForeignKey
|
|
49
|
+
ALTER TABLE `contract_phase_step_approvals` DROP FOREIGN KEY `contract_phase_step_approvals_stepId_fkey`;
|
|
50
|
+
|
|
51
|
+
-- DropForeignKey
|
|
52
|
+
ALTER TABLE `contract_phase_step_documents` DROP FOREIGN KEY `contract_phase_step_documents_stepId_fkey`;
|
|
53
|
+
|
|
54
|
+
-- DropForeignKey
|
|
55
|
+
ALTER TABLE `contract_phase_steps` DROP FOREIGN KEY `contract_phase_steps_assigneeId_fkey`;
|
|
56
|
+
|
|
57
|
+
-- DropForeignKey
|
|
58
|
+
ALTER TABLE `contract_phase_steps` DROP FOREIGN KEY `contract_phase_steps_phaseId_fkey`;
|
|
59
|
+
|
|
60
|
+
-- DropForeignKey
|
|
61
|
+
ALTER TABLE `contract_phases` DROP FOREIGN KEY `contract_phases_currentStepId_fkey`;
|
|
62
|
+
|
|
63
|
+
-- DropForeignKey
|
|
64
|
+
ALTER TABLE `contract_phases` DROP FOREIGN KEY `contract_phases_paymentPlanId_fkey`;
|
|
65
|
+
|
|
66
|
+
-- DropIndex
|
|
67
|
+
DROP INDEX `contract_installments_phaseId_idx` ON `contract_installments`;
|
|
68
|
+
|
|
69
|
+
-- DropIndex
|
|
70
|
+
DROP INDEX `contract_phases_currentStepId_idx` ON `contract_phases`;
|
|
71
|
+
|
|
72
|
+
-- DropIndex
|
|
73
|
+
DROP INDEX `contract_phases_paymentPlanId_idx` ON `contract_phases`;
|
|
74
|
+
|
|
75
|
+
-- DropIndex
|
|
76
|
+
DROP INDEX `contracts_state_idx` ON `contracts`;
|
|
77
|
+
|
|
78
|
+
-- AlterTable
|
|
79
|
+
ALTER TABLE `contract_installments` DROP COLUMN `phaseId`,
|
|
80
|
+
ADD COLUMN `paymentPhaseId` VARCHAR(191) NOT NULL;
|
|
81
|
+
|
|
82
|
+
-- AlterTable
|
|
83
|
+
ALTER TABLE `contract_phases` DROP COLUMN `approvedDocumentsCount`,
|
|
84
|
+
DROP COLUMN `collectFunds`,
|
|
85
|
+
DROP COLUMN `completedStepsCount`,
|
|
86
|
+
DROP COLUMN `completionCriterion`,
|
|
87
|
+
DROP COLUMN `currentStepId`,
|
|
88
|
+
DROP COLUMN `interestRate`,
|
|
89
|
+
DROP COLUMN `minimumCompletionPercentage`,
|
|
90
|
+
DROP COLUMN `paidAmount`,
|
|
91
|
+
DROP COLUMN `paymentPlanId`,
|
|
92
|
+
DROP COLUMN `paymentPlanSnapshot`,
|
|
93
|
+
DROP COLUMN `remainingAmount`,
|
|
94
|
+
DROP COLUMN `requiredDocumentSnapshot`,
|
|
95
|
+
DROP COLUMN `requiredDocumentsCount`,
|
|
96
|
+
DROP COLUMN `stepDefinitionsSnapshot`,
|
|
97
|
+
DROP COLUMN `totalAmount`,
|
|
98
|
+
DROP COLUMN `totalStepsCount`,
|
|
99
|
+
MODIFY `phaseCategory` ENUM('QUESTIONNAIRE', 'DOCUMENTATION', 'PAYMENT') NOT NULL,
|
|
100
|
+
MODIFY `phaseType` ENUM('PRE_APPROVAL', 'UNDERWRITING', 'KYC', 'VERIFICATION', 'DOWNPAYMENT', 'MORTGAGE', 'BALLOON', 'CUSTOM') NOT NULL;
|
|
101
|
+
|
|
102
|
+
-- AlterTable
|
|
103
|
+
ALTER TABLE `contracts` DROP COLUMN `debtToIncomeRatio`,
|
|
104
|
+
DROP COLUMN `downPayment`,
|
|
105
|
+
DROP COLUMN `downPaymentPaid`,
|
|
106
|
+
DROP COLUMN `interestRate`,
|
|
107
|
+
DROP COLUMN `monthlyExpenses`,
|
|
108
|
+
DROP COLUMN `monthlyIncome`,
|
|
109
|
+
DROP COLUMN `periodicPayment`,
|
|
110
|
+
DROP COLUMN `preApprovalAnswers`,
|
|
111
|
+
DROP COLUMN `principal`,
|
|
112
|
+
DROP COLUMN `state`,
|
|
113
|
+
DROP COLUMN `termMonths`,
|
|
114
|
+
DROP COLUMN `totalInterestPaid`,
|
|
115
|
+
DROP COLUMN `totalPaidToDate`,
|
|
116
|
+
DROP COLUMN `underwritingScore`;
|
|
117
|
+
|
|
118
|
+
-- AlterTable
|
|
119
|
+
ALTER TABLE `property_payment_method_phases` MODIFY `phaseCategory` ENUM('QUESTIONNAIRE', 'DOCUMENTATION', 'PAYMENT') NOT NULL,
|
|
120
|
+
MODIFY `phaseType` ENUM('PRE_APPROVAL', 'UNDERWRITING', 'KYC', 'VERIFICATION', 'DOWNPAYMENT', 'MORTGAGE', 'BALLOON', 'CUSTOM') NOT NULL;
|
|
121
|
+
|
|
122
|
+
-- AlterTable
|
|
123
|
+
ALTER TABLE `property_transfer_requests` DROP COLUMN `paymentsMigrated`,
|
|
124
|
+
ADD COLUMN `refundTransactionId` VARCHAR(191) NULL,
|
|
125
|
+
ADD COLUMN `refundedAmount` DOUBLE NULL,
|
|
126
|
+
ADD COLUMN `refundedAt` DATETIME(3) NULL;
|
|
127
|
+
|
|
128
|
+
-- DropTable
|
|
129
|
+
DROP TABLE `contract_phase_step_approvals`;
|
|
130
|
+
|
|
131
|
+
-- DropTable
|
|
132
|
+
DROP TABLE `contract_phase_step_documents`;
|
|
133
|
+
|
|
134
|
+
-- DropTable
|
|
135
|
+
DROP TABLE `contract_phase_steps`;
|
|
136
|
+
|
|
137
|
+
-- CreateTable
|
|
138
|
+
CREATE TABLE `payment_method_phase_fields` (
|
|
139
|
+
`id` VARCHAR(191) NOT NULL,
|
|
140
|
+
`phaseId` VARCHAR(191) NOT NULL,
|
|
141
|
+
`name` VARCHAR(191) NOT NULL,
|
|
142
|
+
`label` VARCHAR(191) NOT NULL,
|
|
143
|
+
`description` TEXT NULL,
|
|
144
|
+
`placeholder` VARCHAR(191) NULL,
|
|
145
|
+
`fieldType` ENUM('TEXT', 'TEXTAREA', 'NUMBER', 'CURRENCY', 'EMAIL', 'PHONE', 'DATE', 'SELECT', 'MULTI_SELECT', 'CHECKBOX', 'RADIO', 'FILE') NOT NULL,
|
|
146
|
+
`isRequired` BOOLEAN NOT NULL DEFAULT true,
|
|
147
|
+
`order` INTEGER NOT NULL,
|
|
148
|
+
`validation` JSON NULL,
|
|
149
|
+
`displayCondition` JSON NULL,
|
|
150
|
+
`defaultValue` JSON NULL,
|
|
151
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
152
|
+
`updatedAt` DATETIME(3) NOT NULL,
|
|
153
|
+
|
|
154
|
+
INDEX `payment_method_phase_fields_phaseId_idx`(`phaseId`),
|
|
155
|
+
UNIQUE INDEX `payment_method_phase_fields_phaseId_name_key`(`phaseId`, `name`),
|
|
156
|
+
PRIMARY KEY (`id`)
|
|
157
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
158
|
+
|
|
159
|
+
-- CreateTable
|
|
160
|
+
CREATE TABLE `questionnaire_phases` (
|
|
161
|
+
`id` VARCHAR(191) NOT NULL,
|
|
162
|
+
`phaseId` VARCHAR(191) NOT NULL,
|
|
163
|
+
`completedFieldsCount` INTEGER NOT NULL DEFAULT 0,
|
|
164
|
+
`totalFieldsCount` INTEGER NOT NULL DEFAULT 0,
|
|
165
|
+
`underwritingScore` DOUBLE NULL,
|
|
166
|
+
`debtToIncomeRatio` DOUBLE NULL,
|
|
167
|
+
`underwritingDecision` VARCHAR(191) NULL,
|
|
168
|
+
`underwritingNotes` TEXT NULL,
|
|
169
|
+
`fieldsSnapshot` JSON NULL,
|
|
170
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
171
|
+
`updatedAt` DATETIME(3) NOT NULL,
|
|
172
|
+
|
|
173
|
+
UNIQUE INDEX `questionnaire_phases_phaseId_key`(`phaseId`),
|
|
174
|
+
INDEX `questionnaire_phases_phaseId_idx`(`phaseId`),
|
|
175
|
+
PRIMARY KEY (`id`)
|
|
176
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
177
|
+
|
|
178
|
+
-- CreateTable
|
|
179
|
+
CREATE TABLE `documentation_phases` (
|
|
180
|
+
`id` VARCHAR(191) NOT NULL,
|
|
181
|
+
`phaseId` VARCHAR(191) NOT NULL,
|
|
182
|
+
`currentStepId` VARCHAR(191) NULL,
|
|
183
|
+
`approvedDocumentsCount` INTEGER NOT NULL DEFAULT 0,
|
|
184
|
+
`requiredDocumentsCount` INTEGER NOT NULL DEFAULT 0,
|
|
185
|
+
`completedStepsCount` INTEGER NOT NULL DEFAULT 0,
|
|
186
|
+
`totalStepsCount` INTEGER NOT NULL DEFAULT 0,
|
|
187
|
+
`minimumCompletionPercentage` DOUBLE NULL,
|
|
188
|
+
`completionCriterion` ENUM('DOCUMENT_APPROVALS', 'PAYMENT_AMOUNT', 'STEPS_COMPLETED') NULL,
|
|
189
|
+
`stepDefinitionsSnapshot` JSON NULL,
|
|
190
|
+
`requiredDocumentSnapshot` JSON NULL,
|
|
191
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
192
|
+
`updatedAt` DATETIME(3) NOT NULL,
|
|
193
|
+
|
|
194
|
+
UNIQUE INDEX `documentation_phases_phaseId_key`(`phaseId`),
|
|
195
|
+
INDEX `documentation_phases_phaseId_idx`(`phaseId`),
|
|
196
|
+
INDEX `documentation_phases_currentStepId_idx`(`currentStepId`),
|
|
197
|
+
PRIMARY KEY (`id`)
|
|
198
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
199
|
+
|
|
200
|
+
-- CreateTable
|
|
201
|
+
CREATE TABLE `payment_phases` (
|
|
202
|
+
`id` VARCHAR(191) NOT NULL,
|
|
203
|
+
`phaseId` VARCHAR(191) NOT NULL,
|
|
204
|
+
`paymentPlanId` VARCHAR(191) NULL,
|
|
205
|
+
`totalAmount` DOUBLE NOT NULL,
|
|
206
|
+
`paidAmount` DOUBLE NOT NULL DEFAULT 0,
|
|
207
|
+
`interestRate` DOUBLE NOT NULL DEFAULT 0,
|
|
208
|
+
`collectFunds` BOOLEAN NOT NULL DEFAULT true,
|
|
209
|
+
`minimumCompletionPercentage` DOUBLE NULL,
|
|
210
|
+
`paymentPlanSnapshot` JSON NULL,
|
|
211
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
212
|
+
`updatedAt` DATETIME(3) NOT NULL,
|
|
213
|
+
|
|
214
|
+
UNIQUE INDEX `payment_phases_phaseId_key`(`phaseId`),
|
|
215
|
+
INDEX `payment_phases_phaseId_idx`(`phaseId`),
|
|
216
|
+
INDEX `payment_phases_paymentPlanId_idx`(`paymentPlanId`),
|
|
217
|
+
PRIMARY KEY (`id`)
|
|
218
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
219
|
+
|
|
220
|
+
-- CreateTable
|
|
221
|
+
CREATE TABLE `questionnaire_fields` (
|
|
222
|
+
`id` VARCHAR(191) NOT NULL,
|
|
223
|
+
`questionnairePhaseId` VARCHAR(191) NOT NULL,
|
|
224
|
+
`name` VARCHAR(191) NOT NULL,
|
|
225
|
+
`label` VARCHAR(191) NOT NULL,
|
|
226
|
+
`description` TEXT NULL,
|
|
227
|
+
`placeholder` VARCHAR(191) NULL,
|
|
228
|
+
`fieldType` ENUM('TEXT', 'TEXTAREA', 'NUMBER', 'CURRENCY', 'EMAIL', 'PHONE', 'DATE', 'SELECT', 'MULTI_SELECT', 'CHECKBOX', 'RADIO', 'FILE') NOT NULL,
|
|
229
|
+
`isRequired` BOOLEAN NOT NULL DEFAULT true,
|
|
230
|
+
`order` INTEGER NOT NULL,
|
|
231
|
+
`validation` JSON NULL,
|
|
232
|
+
`displayCondition` JSON NULL,
|
|
233
|
+
`defaultValue` JSON NULL,
|
|
234
|
+
`answer` JSON NULL,
|
|
235
|
+
`isValid` BOOLEAN NOT NULL DEFAULT false,
|
|
236
|
+
`validationErrors` JSON NULL,
|
|
237
|
+
`submittedAt` DATETIME(3) NULL,
|
|
238
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
239
|
+
`updatedAt` DATETIME(3) NOT NULL,
|
|
240
|
+
|
|
241
|
+
INDEX `questionnaire_fields_questionnairePhaseId_idx`(`questionnairePhaseId`),
|
|
242
|
+
UNIQUE INDEX `questionnaire_fields_questionnairePhaseId_name_key`(`questionnairePhaseId`, `name`),
|
|
243
|
+
PRIMARY KEY (`id`)
|
|
244
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
245
|
+
|
|
246
|
+
-- CreateTable
|
|
247
|
+
CREATE TABLE `documentation_steps` (
|
|
248
|
+
`id` VARCHAR(191) NOT NULL,
|
|
249
|
+
`documentationPhaseId` VARCHAR(191) NOT NULL,
|
|
250
|
+
`name` VARCHAR(191) NOT NULL,
|
|
251
|
+
`description` TEXT NULL,
|
|
252
|
+
`stepType` ENUM('UPLOAD', 'REVIEW', 'SIGNATURE', 'APPROVAL', 'EXTERNAL_CHECK', 'WAIT', 'GENERATE_DOCUMENT', 'PRE_APPROVAL', 'UNDERWRITING') NOT NULL,
|
|
253
|
+
`order` INTEGER NOT NULL,
|
|
254
|
+
`status` ENUM('PENDING', 'IN_PROGRESS', 'COMPLETED', 'FAILED', 'SKIPPED', 'NEEDS_RESUBMISSION', 'ACTION_REQUIRED', 'AWAITING_REVIEW') NOT NULL DEFAULT 'PENDING',
|
|
255
|
+
`actionReason` TEXT NULL,
|
|
256
|
+
`submissionCount` INTEGER NOT NULL DEFAULT 0,
|
|
257
|
+
`lastSubmittedAt` DATETIME(3) NULL,
|
|
258
|
+
`metadata` JSON NULL,
|
|
259
|
+
`assigneeId` VARCHAR(191) NULL,
|
|
260
|
+
`dueDate` DATETIME(3) NULL,
|
|
261
|
+
`completedAt` DATETIME(3) NULL,
|
|
262
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
263
|
+
`updatedAt` DATETIME(3) NOT NULL,
|
|
264
|
+
|
|
265
|
+
INDEX `documentation_steps_documentationPhaseId_idx`(`documentationPhaseId`),
|
|
266
|
+
INDEX `documentation_steps_status_idx`(`status`),
|
|
267
|
+
INDEX `documentation_steps_order_idx`(`order`),
|
|
268
|
+
PRIMARY KEY (`id`)
|
|
269
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
270
|
+
|
|
271
|
+
-- CreateTable
|
|
272
|
+
CREATE TABLE `documentation_step_documents` (
|
|
273
|
+
`id` VARCHAR(191) NOT NULL,
|
|
274
|
+
`stepId` VARCHAR(191) NOT NULL,
|
|
275
|
+
`documentType` VARCHAR(191) NOT NULL,
|
|
276
|
+
`isRequired` BOOLEAN NOT NULL DEFAULT true,
|
|
277
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
278
|
+
|
|
279
|
+
INDEX `documentation_step_documents_stepId_documentType_idx`(`stepId`, `documentType`),
|
|
280
|
+
PRIMARY KEY (`id`)
|
|
281
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
282
|
+
|
|
283
|
+
-- CreateTable
|
|
284
|
+
CREATE TABLE `documentation_step_approvals` (
|
|
285
|
+
`id` VARCHAR(191) NOT NULL,
|
|
286
|
+
`stepId` VARCHAR(191) NOT NULL,
|
|
287
|
+
`approverId` VARCHAR(191) NULL,
|
|
288
|
+
`decision` ENUM('APPROVED', 'REJECTED', 'REQUEST_CHANGES') NOT NULL,
|
|
289
|
+
`comment` TEXT NULL,
|
|
290
|
+
`decidedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
291
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
292
|
+
|
|
293
|
+
INDEX `documentation_step_approvals_stepId_idx`(`stepId`),
|
|
294
|
+
PRIMARY KEY (`id`)
|
|
295
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
296
|
+
|
|
297
|
+
-- CreateIndex
|
|
298
|
+
CREATE INDEX `contract_installments_paymentPhaseId_idx` ON `contract_installments`(`paymentPhaseId`);
|
|
299
|
+
|
|
300
|
+
-- CreateIndex
|
|
301
|
+
CREATE INDEX `contracts_currentPhaseId_idx` ON `contracts`(`currentPhaseId`);
|
|
302
|
+
|
|
303
|
+
-- AddForeignKey
|
|
304
|
+
ALTER TABLE `payment_method_phase_fields` ADD CONSTRAINT `payment_method_phase_fields_phaseId_fkey` FOREIGN KEY (`phaseId`) REFERENCES `property_payment_method_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
305
|
+
|
|
306
|
+
-- AddForeignKey
|
|
307
|
+
ALTER TABLE `contracts` ADD CONSTRAINT `contracts_currentPhaseId_fkey` FOREIGN KEY (`currentPhaseId`) REFERENCES `contract_phases`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
|
308
|
+
|
|
309
|
+
-- AddForeignKey
|
|
310
|
+
ALTER TABLE `questionnaire_phases` ADD CONSTRAINT `questionnaire_phases_phaseId_fkey` FOREIGN KEY (`phaseId`) REFERENCES `contract_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
311
|
+
|
|
312
|
+
-- AddForeignKey
|
|
313
|
+
ALTER TABLE `documentation_phases` ADD CONSTRAINT `documentation_phases_phaseId_fkey` FOREIGN KEY (`phaseId`) REFERENCES `contract_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
314
|
+
|
|
315
|
+
-- AddForeignKey
|
|
316
|
+
ALTER TABLE `documentation_phases` ADD CONSTRAINT `documentation_phases_currentStepId_fkey` FOREIGN KEY (`currentStepId`) REFERENCES `documentation_steps`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
|
317
|
+
|
|
318
|
+
-- AddForeignKey
|
|
319
|
+
ALTER TABLE `payment_phases` ADD CONSTRAINT `payment_phases_phaseId_fkey` FOREIGN KEY (`phaseId`) REFERENCES `contract_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
320
|
+
|
|
321
|
+
-- AddForeignKey
|
|
322
|
+
ALTER TABLE `payment_phases` ADD CONSTRAINT `payment_phases_paymentPlanId_fkey` FOREIGN KEY (`paymentPlanId`) REFERENCES `payment_plans`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
|
323
|
+
|
|
324
|
+
-- AddForeignKey
|
|
325
|
+
ALTER TABLE `questionnaire_fields` ADD CONSTRAINT `questionnaire_fields_questionnairePhaseId_fkey` FOREIGN KEY (`questionnairePhaseId`) REFERENCES `questionnaire_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
326
|
+
|
|
327
|
+
-- AddForeignKey
|
|
328
|
+
ALTER TABLE `documentation_steps` ADD CONSTRAINT `documentation_steps_documentationPhaseId_fkey` FOREIGN KEY (`documentationPhaseId`) REFERENCES `documentation_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
329
|
+
|
|
330
|
+
-- AddForeignKey
|
|
331
|
+
ALTER TABLE `documentation_steps` ADD CONSTRAINT `documentation_steps_assigneeId_fkey` FOREIGN KEY (`assigneeId`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
|
332
|
+
|
|
333
|
+
-- AddForeignKey
|
|
334
|
+
ALTER TABLE `documentation_step_documents` ADD CONSTRAINT `documentation_step_documents_stepId_fkey` FOREIGN KEY (`stepId`) REFERENCES `documentation_steps`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
335
|
+
|
|
336
|
+
-- AddForeignKey
|
|
337
|
+
ALTER TABLE `documentation_step_approvals` ADD CONSTRAINT `documentation_step_approvals_stepId_fkey` FOREIGN KEY (`stepId`) REFERENCES `documentation_steps`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
338
|
+
|
|
339
|
+
-- AddForeignKey
|
|
340
|
+
ALTER TABLE `documentation_step_approvals` ADD CONSTRAINT `documentation_step_approvals_approverId_fkey` FOREIGN KEY (`approverId`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
|
341
|
+
|
|
342
|
+
-- AddForeignKey
|
|
343
|
+
ALTER TABLE `contract_installments` ADD CONSTRAINT `contract_installments_paymentPhaseId_fkey` FOREIGN KEY (`paymentPhaseId`) REFERENCES `payment_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|