@valentine-efagene/qshelter-common 2.0.29 → 2.0.31
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 +20 -0
- package/dist/generated/client/client.d.ts +20 -0
- package/dist/generated/client/commonInputTypes.d.ts +531 -51
- package/dist/generated/client/enums.d.ts +133 -0
- package/dist/generated/client/enums.js +117 -0
- package/dist/generated/client/internal/class.d.ts +44 -0
- package/dist/generated/client/internal/class.js +2 -2
- package/dist/generated/client/internal/prismaNamespace.d.ts +478 -35
- package/dist/generated/client/internal/prismaNamespace.js +139 -36
- package/dist/generated/client/internal/prismaNamespaceBrowser.d.ts +146 -35
- package/dist/generated/client/internal/prismaNamespaceBrowser.js +139 -36
- package/dist/generated/client/models/Contract.d.ts +423 -148
- package/dist/generated/client/models/ContractDocument.d.ts +32 -28
- package/dist/generated/client/models/ContractInstallment.d.ts +30 -26
- package/dist/generated/client/models/ContractPayment.d.ts +44 -40
- package/dist/generated/client/models/ContractPhase.d.ts +539 -121
- package/dist/generated/client/models/ContractPhaseStep.d.ts +208 -108
- package/dist/generated/client/models/ContractPhaseStepApproval.d.ts +32 -28
- package/dist/generated/client/models/ContractPhaseStepDocument.d.ts +1052 -0
- package/dist/generated/client/models/ContractPhaseStepDocument.js +1 -0
- package/dist/generated/client/models/ContractTermination.d.ts +3449 -0
- package/dist/generated/client/models/ContractTermination.js +1 -0
- package/dist/generated/client/models/PaymentMethodPhaseDocument.d.ts +1216 -0
- package/dist/generated/client/models/PaymentMethodPhaseDocument.js +1 -0
- package/dist/generated/client/models/PaymentMethodPhaseStep.d.ts +1187 -0
- package/dist/generated/client/models/PaymentMethodPhaseStep.js +1 -0
- package/dist/generated/client/models/PaymentPlan.d.ts +34 -30
- package/dist/generated/client/models/PropertyPaymentMethodPhase.d.ts +504 -135
- package/dist/generated/client/models/Tenant.d.ts +163 -0
- package/dist/generated/client/models/User.d.ts +586 -0
- package/dist/generated/client/models/index.d.ts +4 -0
- package/dist/generated/client/models/index.js +4 -0
- package/dist/generated/client/models.d.ts +4 -0
- package/package.json +1 -1
- package/prisma/migrations/20260101081428_normalize_schema/migration.sql +119 -0
- package/prisma/migrations/20260101102022_add_contract_termination/migration.sql +69 -0
- package/prisma/schema.prisma +340 -30
|
@@ -7,6 +7,8 @@ export * from './ContractPayment';
|
|
|
7
7
|
export * from './ContractPhase';
|
|
8
8
|
export * from './ContractPhaseStep';
|
|
9
9
|
export * from './ContractPhaseStepApproval';
|
|
10
|
+
export * from './ContractPhaseStepDocument';
|
|
11
|
+
export * from './ContractTermination';
|
|
10
12
|
export * from './ContractTransition';
|
|
11
13
|
export * from './DeviceEndpoint';
|
|
12
14
|
export * from './DocumentRequirementRule';
|
|
@@ -15,6 +17,8 @@ export * from './EmailPreference';
|
|
|
15
17
|
export * from './OAuthState';
|
|
16
18
|
export * from './PasswordReset';
|
|
17
19
|
export * from './PaymentMethodChangeRequest';
|
|
20
|
+
export * from './PaymentMethodPhaseDocument';
|
|
21
|
+
export * from './PaymentMethodPhaseStep';
|
|
18
22
|
export * from './PaymentPlan';
|
|
19
23
|
export * from './Permission';
|
|
20
24
|
export * from './Prequalification';
|
|
@@ -7,6 +7,8 @@ export * from './ContractPayment';
|
|
|
7
7
|
export * from './ContractPhase';
|
|
8
8
|
export * from './ContractPhaseStep';
|
|
9
9
|
export * from './ContractPhaseStepApproval';
|
|
10
|
+
export * from './ContractPhaseStepDocument';
|
|
11
|
+
export * from './ContractTermination';
|
|
10
12
|
export * from './ContractTransition';
|
|
11
13
|
export * from './DeviceEndpoint';
|
|
12
14
|
export * from './DocumentRequirementRule';
|
|
@@ -15,6 +17,8 @@ export * from './EmailPreference';
|
|
|
15
17
|
export * from './OAuthState';
|
|
16
18
|
export * from './PasswordReset';
|
|
17
19
|
export * from './PaymentMethodChangeRequest';
|
|
20
|
+
export * from './PaymentMethodPhaseDocument';
|
|
21
|
+
export * from './PaymentMethodPhaseStep';
|
|
18
22
|
export * from './PaymentPlan';
|
|
19
23
|
export * from './Permission';
|
|
20
24
|
export * from './Prequalification';
|
|
@@ -27,15 +27,19 @@ export type * from './models/PaymentPlan.js';
|
|
|
27
27
|
export type * from './models/PropertyPaymentMethod.js';
|
|
28
28
|
export type * from './models/PropertyPaymentMethodLink.js';
|
|
29
29
|
export type * from './models/PropertyPaymentMethodPhase.js';
|
|
30
|
+
export type * from './models/PaymentMethodPhaseStep.js';
|
|
31
|
+
export type * from './models/PaymentMethodPhaseDocument.js';
|
|
30
32
|
export type * from './models/Contract.js';
|
|
31
33
|
export type * from './models/ContractPhase.js';
|
|
32
34
|
export type * from './models/ContractPhaseStep.js';
|
|
35
|
+
export type * from './models/ContractPhaseStepDocument.js';
|
|
33
36
|
export type * from './models/ContractPhaseStepApproval.js';
|
|
34
37
|
export type * from './models/ContractInstallment.js';
|
|
35
38
|
export type * from './models/ContractPayment.js';
|
|
36
39
|
export type * from './models/ContractDocument.js';
|
|
37
40
|
export type * from './models/ContractTransition.js';
|
|
38
41
|
export type * from './models/ContractEvent.js';
|
|
42
|
+
export type * from './models/ContractTermination.js';
|
|
39
43
|
export type * from './models/Prequalification.js';
|
|
40
44
|
export type * from './models/PaymentMethodChangeRequest.js';
|
|
41
45
|
export type * from './models/DocumentRequirementRule.js';
|
package/package.json
CHANGED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to alter the column `status` on the `contract_documents` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(16))`.
|
|
5
|
+
- You are about to alter the column `status` on the `contract_installments` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(14))`.
|
|
6
|
+
- You are about to alter the column `status` on the `contract_payments` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(15))`.
|
|
7
|
+
- You are about to alter the column `decision` on the `contract_phase_step_approvals` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(13))`.
|
|
8
|
+
- You are about to drop the column `requiredDocumentTypes` on the `contract_phase_steps` table. All the data in the column will be lost.
|
|
9
|
+
- You are about to alter the column `stepType` on the `contract_phase_steps` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(11))`.
|
|
10
|
+
- You are about to alter the column `status` on the `contract_phase_steps` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(12))`.
|
|
11
|
+
- You are about to alter the column `phaseCategory` on the `contract_phases` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(7))`.
|
|
12
|
+
- You are about to alter the column `phaseType` on the `contract_phases` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(8))`.
|
|
13
|
+
- You are about to alter the column `status` on the `contract_phases` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(9))`.
|
|
14
|
+
- You are about to alter the column `status` on the `contracts` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(6))`.
|
|
15
|
+
- You are about to alter the column `state` on the `contracts` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(6))`.
|
|
16
|
+
- You are about to alter the column `paymentFrequency` on the `payment_plans` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(0))`.
|
|
17
|
+
- You are about to drop the column `requiredDocumentTypes` on the `property_payment_method_phases` table. All the data in the column will be lost.
|
|
18
|
+
- You are about to drop the column `stepDefinitions` on the `property_payment_method_phases` table. All the data in the column will be lost.
|
|
19
|
+
- You are about to alter the column `phaseCategory` on the `property_payment_method_phases` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(7))`.
|
|
20
|
+
- You are about to alter the column `phaseType` on the `property_payment_method_phases` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(8))`.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
-- AlterTable
|
|
24
|
+
ALTER TABLE `contract_documents` MODIFY `status` ENUM('PENDING', 'APPROVED', 'REJECTED') NOT NULL DEFAULT 'PENDING';
|
|
25
|
+
|
|
26
|
+
-- AlterTable
|
|
27
|
+
ALTER TABLE `contract_installments` MODIFY `status` ENUM('PENDING', 'PAID', 'OVERDUE', 'PARTIALLY_PAID', 'WAIVED') NOT NULL DEFAULT 'PENDING';
|
|
28
|
+
|
|
29
|
+
-- AlterTable
|
|
30
|
+
ALTER TABLE `contract_payments` MODIFY `status` ENUM('INITIATED', 'PENDING', 'COMPLETED', 'FAILED', 'REFUNDED') NOT NULL DEFAULT 'INITIATED';
|
|
31
|
+
|
|
32
|
+
-- AlterTable
|
|
33
|
+
ALTER TABLE `contract_phase_step_approvals` MODIFY `decision` ENUM('APPROVED', 'REJECTED', 'REQUEST_CHANGES') NOT NULL;
|
|
34
|
+
|
|
35
|
+
-- AlterTable
|
|
36
|
+
ALTER TABLE `contract_phase_steps` DROP COLUMN `requiredDocumentTypes`,
|
|
37
|
+
MODIFY `stepType` ENUM('UPLOAD', 'REVIEW', 'SIGNATURE', 'APPROVAL', 'EXTERNAL_CHECK', 'WAIT') NOT NULL,
|
|
38
|
+
MODIFY `status` ENUM('PENDING', 'IN_PROGRESS', 'COMPLETED', 'FAILED', 'SKIPPED') NOT NULL DEFAULT 'PENDING';
|
|
39
|
+
|
|
40
|
+
-- AlterTable
|
|
41
|
+
ALTER TABLE `contract_phases` ADD COLUMN `approvedDocumentsCount` INTEGER NOT NULL DEFAULT 0,
|
|
42
|
+
ADD COLUMN `completedStepsCount` INTEGER NOT NULL DEFAULT 0,
|
|
43
|
+
ADD COLUMN `completionCriterion` ENUM('DOCUMENT_APPROVALS', 'PAYMENT_AMOUNT', 'STEPS_COMPLETED') NULL,
|
|
44
|
+
ADD COLUMN `paymentPlanSnapshot` JSON NULL,
|
|
45
|
+
ADD COLUMN `requiredDocumentSnapshot` JSON NULL,
|
|
46
|
+
ADD COLUMN `requiredDocumentsCount` INTEGER NOT NULL DEFAULT 0,
|
|
47
|
+
ADD COLUMN `stepDefinitionsSnapshot` JSON NULL,
|
|
48
|
+
ADD COLUMN `totalStepsCount` INTEGER NOT NULL DEFAULT 0,
|
|
49
|
+
MODIFY `phaseCategory` ENUM('DOCUMENTATION', 'PAYMENT') NOT NULL,
|
|
50
|
+
MODIFY `phaseType` ENUM('KYC', 'VERIFICATION', 'DOWNPAYMENT', 'MORTGAGE', 'BALLOON', 'CUSTOM') NOT NULL,
|
|
51
|
+
MODIFY `status` ENUM('PENDING', 'IN_PROGRESS', 'AWAITING_APPROVAL', 'ACTIVE', 'COMPLETED', 'SKIPPED', 'FAILED') NOT NULL DEFAULT 'PENDING';
|
|
52
|
+
|
|
53
|
+
-- AlterTable
|
|
54
|
+
ALTER TABLE `contracts` MODIFY `status` ENUM('DRAFT', 'PENDING', 'ACTIVE', 'COMPLETED', 'CANCELLED', 'TERMINATED') NOT NULL DEFAULT 'DRAFT',
|
|
55
|
+
MODIFY `state` ENUM('DRAFT', 'PENDING', 'ACTIVE', 'COMPLETED', 'CANCELLED', 'TERMINATED') NOT NULL DEFAULT 'DRAFT';
|
|
56
|
+
|
|
57
|
+
-- AlterTable
|
|
58
|
+
ALTER TABLE `payment_plans` MODIFY `paymentFrequency` ENUM('MONTHLY', 'BIWEEKLY', 'WEEKLY', 'ONE_TIME', 'CUSTOM') NOT NULL;
|
|
59
|
+
|
|
60
|
+
-- AlterTable
|
|
61
|
+
ALTER TABLE `property_payment_method_phases` DROP COLUMN `requiredDocumentTypes`,
|
|
62
|
+
DROP COLUMN `stepDefinitions`,
|
|
63
|
+
ADD COLUMN `completionCriterion` ENUM('DOCUMENT_APPROVALS', 'PAYMENT_AMOUNT', 'STEPS_COMPLETED') NULL,
|
|
64
|
+
ADD COLUMN `requiredDocumentSnapshot` JSON NULL,
|
|
65
|
+
ADD COLUMN `stepDefinitionsSnapshot` JSON NULL,
|
|
66
|
+
MODIFY `phaseCategory` ENUM('DOCUMENTATION', 'PAYMENT') NOT NULL,
|
|
67
|
+
MODIFY `phaseType` ENUM('KYC', 'VERIFICATION', 'DOWNPAYMENT', 'MORTGAGE', 'BALLOON', 'CUSTOM') NOT NULL;
|
|
68
|
+
|
|
69
|
+
-- CreateTable
|
|
70
|
+
CREATE TABLE `payment_method_phase_steps` (
|
|
71
|
+
`id` VARCHAR(191) NOT NULL,
|
|
72
|
+
`phaseId` VARCHAR(191) NOT NULL,
|
|
73
|
+
`name` VARCHAR(191) NOT NULL,
|
|
74
|
+
`stepType` ENUM('UPLOAD', 'REVIEW', 'SIGNATURE', 'APPROVAL', 'EXTERNAL_CHECK', 'WAIT') NOT NULL,
|
|
75
|
+
`order` INTEGER NOT NULL,
|
|
76
|
+
`metadata` JSON NULL,
|
|
77
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
78
|
+
`updatedAt` DATETIME(3) NOT NULL,
|
|
79
|
+
|
|
80
|
+
INDEX `payment_method_phase_steps_phaseId_idx`(`phaseId`),
|
|
81
|
+
PRIMARY KEY (`id`)
|
|
82
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
83
|
+
|
|
84
|
+
-- CreateTable
|
|
85
|
+
CREATE TABLE `payment_method_phase_documents` (
|
|
86
|
+
`id` VARCHAR(191) NOT NULL,
|
|
87
|
+
`phaseId` VARCHAR(191) NOT NULL,
|
|
88
|
+
`documentType` VARCHAR(191) NOT NULL,
|
|
89
|
+
`isRequired` BOOLEAN NOT NULL DEFAULT true,
|
|
90
|
+
`description` TEXT NULL,
|
|
91
|
+
`allowedMimeTypes` VARCHAR(191) NULL,
|
|
92
|
+
`maxSizeBytes` INTEGER NULL,
|
|
93
|
+
`metadata` JSON NULL,
|
|
94
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
95
|
+
|
|
96
|
+
INDEX `payment_method_phase_documents_phaseId_documentType_idx`(`phaseId`, `documentType`),
|
|
97
|
+
PRIMARY KEY (`id`)
|
|
98
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
99
|
+
|
|
100
|
+
-- CreateTable
|
|
101
|
+
CREATE TABLE `contract_phase_step_documents` (
|
|
102
|
+
`id` VARCHAR(191) NOT NULL,
|
|
103
|
+
`stepId` VARCHAR(191) NOT NULL,
|
|
104
|
+
`documentType` VARCHAR(191) NOT NULL,
|
|
105
|
+
`isRequired` BOOLEAN NOT NULL DEFAULT true,
|
|
106
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
107
|
+
|
|
108
|
+
INDEX `contract_phase_step_documents_stepId_documentType_idx`(`stepId`, `documentType`),
|
|
109
|
+
PRIMARY KEY (`id`)
|
|
110
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
111
|
+
|
|
112
|
+
-- AddForeignKey
|
|
113
|
+
ALTER TABLE `payment_method_phase_steps` ADD CONSTRAINT `payment_method_phase_steps_phaseId_fkey` FOREIGN KEY (`phaseId`) REFERENCES `property_payment_method_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
114
|
+
|
|
115
|
+
-- AddForeignKey
|
|
116
|
+
ALTER TABLE `payment_method_phase_documents` ADD CONSTRAINT `payment_method_phase_documents_phaseId_fkey` FOREIGN KEY (`phaseId`) REFERENCES `property_payment_method_phases`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
117
|
+
|
|
118
|
+
-- AddForeignKey
|
|
119
|
+
ALTER TABLE `contract_phase_step_documents` ADD CONSTRAINT `contract_phase_step_documents_stepId_fkey` FOREIGN KEY (`stepId`) REFERENCES `contract_phase_steps`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE `contract_terminations` (
|
|
3
|
+
`id` VARCHAR(191) NOT NULL,
|
|
4
|
+
`contractId` VARCHAR(191) NOT NULL,
|
|
5
|
+
`tenantId` VARCHAR(191) NOT NULL,
|
|
6
|
+
`requestNumber` VARCHAR(191) NOT NULL,
|
|
7
|
+
`initiatedBy` ENUM('BUYER', 'SELLER', 'ADMIN', 'SYSTEM') NOT NULL,
|
|
8
|
+
`initiatorId` VARCHAR(191) NULL,
|
|
9
|
+
`type` ENUM('BUYER_WITHDRAWAL', 'SELLER_WITHDRAWAL', 'MUTUAL_AGREEMENT', 'PAYMENT_DEFAULT', 'DOCUMENT_FAILURE', 'FRAUD', 'FORCE_MAJEURE', 'PROPERTY_UNAVAILABLE', 'REGULATORY', 'OTHER') NOT NULL,
|
|
10
|
+
`reason` TEXT NULL,
|
|
11
|
+
`supportingDocs` JSON NULL,
|
|
12
|
+
`status` ENUM('REQUESTED', 'PENDING_REVIEW', 'PENDING_REFUND', 'REFUND_IN_PROGRESS', 'REFUND_COMPLETED', 'COMPLETED', 'REJECTED', 'CANCELLED') NOT NULL DEFAULT 'REQUESTED',
|
|
13
|
+
`requiresApproval` BOOLEAN NOT NULL DEFAULT true,
|
|
14
|
+
`autoApproveEligible` BOOLEAN NOT NULL DEFAULT false,
|
|
15
|
+
`reviewedBy` VARCHAR(191) NULL,
|
|
16
|
+
`reviewedAt` DATETIME(3) NULL,
|
|
17
|
+
`reviewNotes` TEXT NULL,
|
|
18
|
+
`rejectionReason` TEXT NULL,
|
|
19
|
+
`contractSnapshot` JSON NOT NULL,
|
|
20
|
+
`totalContractAmount` DOUBLE NOT NULL,
|
|
21
|
+
`totalPaidToDate` DOUBLE NOT NULL,
|
|
22
|
+
`outstandingBalance` DOUBLE NOT NULL,
|
|
23
|
+
`refundableAmount` DOUBLE NOT NULL DEFAULT 0,
|
|
24
|
+
`penaltyAmount` DOUBLE NOT NULL DEFAULT 0,
|
|
25
|
+
`forfeitedAmount` DOUBLE NOT NULL DEFAULT 0,
|
|
26
|
+
`adminFeeAmount` DOUBLE NOT NULL DEFAULT 0,
|
|
27
|
+
`netRefundAmount` DOUBLE NOT NULL DEFAULT 0,
|
|
28
|
+
`settlementNotes` TEXT NULL,
|
|
29
|
+
`refundStatus` ENUM('NOT_APPLICABLE', 'PENDING', 'INITIATED', 'PROCESSING', 'PARTIAL_COMPLETED', 'COMPLETED', 'FAILED') NOT NULL DEFAULT 'NOT_APPLICABLE',
|
|
30
|
+
`refundReference` VARCHAR(191) NULL,
|
|
31
|
+
`refundMethod` VARCHAR(191) NULL,
|
|
32
|
+
`refundAccountDetails` JSON NULL,
|
|
33
|
+
`refundInitiatedAt` DATETIME(3) NULL,
|
|
34
|
+
`refundCompletedAt` DATETIME(3) NULL,
|
|
35
|
+
`refundFailureReason` TEXT NULL,
|
|
36
|
+
`unitReleasedAt` DATETIME(3) NULL,
|
|
37
|
+
`unitReservedForId` VARCHAR(191) NULL,
|
|
38
|
+
`requestedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
39
|
+
`approvedAt` DATETIME(3) NULL,
|
|
40
|
+
`executedAt` DATETIME(3) NULL,
|
|
41
|
+
`completedAt` DATETIME(3) NULL,
|
|
42
|
+
`cancelledAt` DATETIME(3) NULL,
|
|
43
|
+
`idempotencyKey` VARCHAR(191) NULL,
|
|
44
|
+
`metadata` JSON NULL,
|
|
45
|
+
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
46
|
+
`updatedAt` DATETIME(3) NOT NULL,
|
|
47
|
+
|
|
48
|
+
UNIQUE INDEX `contract_terminations_requestNumber_key`(`requestNumber`),
|
|
49
|
+
UNIQUE INDEX `contract_terminations_idempotencyKey_key`(`idempotencyKey`),
|
|
50
|
+
INDEX `contract_terminations_contractId_idx`(`contractId`),
|
|
51
|
+
INDEX `contract_terminations_tenantId_idx`(`tenantId`),
|
|
52
|
+
INDEX `contract_terminations_status_idx`(`status`),
|
|
53
|
+
INDEX `contract_terminations_type_idx`(`type`),
|
|
54
|
+
INDEX `contract_terminations_initiatorId_idx`(`initiatorId`),
|
|
55
|
+
INDEX `contract_terminations_requestedAt_idx`(`requestedAt`),
|
|
56
|
+
PRIMARY KEY (`id`)
|
|
57
|
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
58
|
+
|
|
59
|
+
-- AddForeignKey
|
|
60
|
+
ALTER TABLE `contract_terminations` ADD CONSTRAINT `contract_terminations_contractId_fkey` FOREIGN KEY (`contractId`) REFERENCES `contracts`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
61
|
+
|
|
62
|
+
-- AddForeignKey
|
|
63
|
+
ALTER TABLE `contract_terminations` ADD CONSTRAINT `contract_terminations_tenantId_fkey` FOREIGN KEY (`tenantId`) REFERENCES `tenants`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
64
|
+
|
|
65
|
+
-- AddForeignKey
|
|
66
|
+
ALTER TABLE `contract_terminations` ADD CONSTRAINT `contract_terminations_initiatorId_fkey` FOREIGN KEY (`initiatorId`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
|
67
|
+
|
|
68
|
+
-- AddForeignKey
|
|
69
|
+
ALTER TABLE `contract_terminations` ADD CONSTRAINT `contract_terminations_reviewedBy_fkey` FOREIGN KEY (`reviewedBy`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|