@dynamatix/gb-schemas 2.0.54 → 2.0.56
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/entities/applications/product-features.entity.d.ts +1 -0
- package/dist/entities/applications/product-features.entity.d.ts.map +1 -1
- package/entities/applications/product-features.entity.ts +2 -1
- package/package.json +1 -1
- package/prisma/applicants/credit-card-commitment.prisma +1 -1
- package/prisma/applications/application.prisma +17 -16
- package/prisma/applications/product-features.prisma +54 -50
- package/prisma/migrations/20250515172824_update_security_schema/migration.sql +43 -43
- package/prisma/migrations/20250516053810_update_underwriter_schema/migration.sql +14 -14
- package/prisma/migrations/20250516075153_update_commitments_schemas/migration.sql +134 -134
- package/prisma/migrations/20250516094438_update_credit_card_commitment_schema/migration.sql +8 -0
- package/prisma/migrations/20250519075211_update_product_features_schema/migration.sql +15 -0
- package/prisma/schema.prisma +72 -67
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-features.entity.d.ts","sourceRoot":"","sources":["../../../entities/applications/product-features.entity.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAqB;IAC9B,EAAE,EAAG,MAAM,CAAC;IACZ,IAAI,EAAG,MAAM,CAAC;IACd,aAAa,EAAG,MAAM,CAAC;IACvB,GAAG,EAAG,MAAM,CAAC;IACb,SAAS,EAAG,MAAM,CAAC;IACnB,iBAAiB,EAAG,MAAM,CAAC;IAC3B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAG,MAAM,CAAC;IACrB,SAAS,EAAG,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAG,MAAM,CAAC;IACpB,eAAe,EAAG,MAAM,CAAC;IACzB,OAAO,EAAG,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;gBAEL,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC;CAGtD"}
|
|
1
|
+
{"version":3,"file":"product-features.entity.d.ts","sourceRoot":"","sources":["../../../entities/applications/product-features.entity.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAqB;IAC9B,EAAE,EAAG,MAAM,CAAC;IACZ,aAAa,EAAG,MAAM,CAAC;IACvB,IAAI,EAAG,MAAM,CAAC;IACd,aAAa,EAAG,MAAM,CAAC;IACvB,GAAG,EAAG,MAAM,CAAC;IACb,SAAS,EAAG,MAAM,CAAC;IACnB,iBAAiB,EAAG,MAAM,CAAC;IAC3B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAG,MAAM,CAAC;IACrB,SAAS,EAAG,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAG,MAAM,CAAC;IACpB,eAAe,EAAG,MAAM,CAAC;IACzB,OAAO,EAAG,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;gBAEL,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC;CAGtD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export class ProductFeaturesEntity {
|
|
2
2
|
id!: string;
|
|
3
|
+
applicationId!: string;
|
|
3
4
|
name!: string;
|
|
4
5
|
clientAdvance!: string;
|
|
5
6
|
ltv!: string;
|
|
@@ -53,4 +54,4 @@ export class ProductFeaturesEntity {
|
|
|
53
54
|
constructor(partial: Partial<ProductFeaturesEntity>) {
|
|
54
55
|
Object.assign(this, partial);
|
|
55
56
|
}
|
|
56
|
-
}
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
model CreditCardCommitment {
|
|
2
2
|
id String @id @default(uuid())
|
|
3
3
|
applicantId String @map("applicant_id")
|
|
4
|
-
commitmentId String @map("commitment_id")
|
|
4
|
+
commitmentId String @unique @map("commitment_id")
|
|
5
5
|
lenderName String @map("lender_name")
|
|
6
6
|
creditLimit Decimal @map("credit_limit") @db.Decimal(10, 2)
|
|
7
7
|
outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
|
|
@@ -54,24 +54,25 @@ model Application {
|
|
|
54
54
|
applicantIds String[] @map("applicant_ids")
|
|
55
55
|
propertyIds String[] @map("property_ids")
|
|
56
56
|
createdAt DateTime @default(now()) @map("created_at")
|
|
57
|
-
updatedAt DateTime @
|
|
57
|
+
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
|
|
58
58
|
|
|
59
59
|
// Relations
|
|
60
|
-
broker
|
|
61
|
-
security
|
|
62
|
-
solicitor
|
|
63
|
-
product
|
|
64
|
-
directDebit
|
|
65
|
-
creditProfile
|
|
66
|
-
mortgage
|
|
67
|
-
company
|
|
68
|
-
rationale
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
broker Broker? @relation("ApplicationBroker", fields: [brokerId], references: [id])
|
|
61
|
+
security Security? @relation("ApplicationSecurity")
|
|
62
|
+
solicitor Solicitor? @relation("ApplicationSolicitor")
|
|
63
|
+
product Product? @relation("ApplicationProduct", fields: [productId], references: [id])
|
|
64
|
+
directDebit ApplicationDirectDebit? @relation("ApplicationDirectDebit")
|
|
65
|
+
creditProfile ApplicationCreditProfile? @relation("ApplicationCreditProfile")
|
|
66
|
+
mortgage ApplicationMortgage? @relation("ApplicationMortgage")
|
|
67
|
+
company ApplicationCompany? @relation("ApplicationCompany")
|
|
68
|
+
rationale ApplicationRationale? @relation("ApplicationRationale")
|
|
69
|
+
productFeatures ProductFeatures? @relation("ApplicationProductFeature")
|
|
70
|
+
applicants Applicant[] @relation("ApplicationApplicants")
|
|
71
|
+
properties Property[] @relation("ApplicationProperties")
|
|
72
|
+
documents ApplicationDocument[]
|
|
73
|
+
notes ApplicationNote[]
|
|
74
|
+
audits ApplicationAudit[]
|
|
75
|
+
products ApplicationProduct[] @relation("ApplicationProducts")
|
|
75
76
|
|
|
76
77
|
// Lookup relations
|
|
77
78
|
applicationType Lookup @relation("ApplicationType", fields: [applicationTypeLid], references: [id])
|
|
@@ -1,54 +1,58 @@
|
|
|
1
1
|
model ProductFeatures {
|
|
2
|
-
id
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
applicationId String @unique @map("application_id")
|
|
4
|
+
name String @map("name")
|
|
5
|
+
clientAdvance String @map("client_advance")
|
|
6
|
+
ltv String @map("ltv")
|
|
7
|
+
repayment String @map("repayment")
|
|
8
|
+
variableRepayment String @map("variable_repayment")
|
|
9
|
+
reversionRateWithoutBaseRate String? @map("reversion_rate_without_base_rate")
|
|
10
|
+
totalReversionRate String? @map("total_reversion_rate")
|
|
11
|
+
initialRate String @map("initial_rate")
|
|
12
|
+
fixedTerm String @map("fixed_term")
|
|
13
|
+
fixedTermEndDate String? @map("fixed_term_end_date")
|
|
14
|
+
baseRate String? @map("base_rate")
|
|
15
|
+
productRate String? @map("product_rate")
|
|
16
|
+
apr String? @map("apr")
|
|
17
|
+
rentalCoverage String? @map("rental_coverage")
|
|
18
|
+
repaymentType String? @map("repayment_type")
|
|
19
|
+
applicationCategory String? @map("application_category")
|
|
20
|
+
securityType String? @map("security_type")
|
|
21
|
+
erc String? @map("erc")
|
|
22
|
+
loanType String? @map("loan_type")
|
|
23
|
+
maxLtvLimit String? @map("max_ltv_limit")
|
|
24
|
+
reimbursement String? @map("reimbursement")
|
|
25
|
+
reimbursementPerPound String? @map("reimbursement_per_pound")
|
|
26
|
+
stressedApr String? @map("stressed_apr")
|
|
27
|
+
stressedRate String? @map("stressed_rate")
|
|
28
|
+
stressedRepayment String? @map("stressed_repayment")
|
|
29
|
+
liborFloorRate String? @map("libor_floor_rate")
|
|
30
|
+
totalTermInMonths String? @map("total_term_in_months")
|
|
31
|
+
chargeType String @default("") @map("charge_type")
|
|
32
|
+
productCategory String @default("") @map("product_category")
|
|
33
|
+
ercCode String @default("") @map("erc_code")
|
|
34
|
+
variableTerm String? @map("variable_term")
|
|
35
|
+
totalFeePayable String? @map("total_fee_payable")
|
|
36
|
+
dipIssueDate String? @map("dip_issue_date")
|
|
37
|
+
estimatedCompletionDate String? @map("estimated_completion_date")
|
|
38
|
+
dipExpiryDate String? @map("dip_expiry_date")
|
|
39
|
+
fixedRepaymentUntillDate String? @map("fixed_repayment_untill_date")
|
|
40
|
+
rentalReviewDate String? @map("rental_review_date")
|
|
41
|
+
totalReimbursementWithFee String? @map("total_reimbursement_with_fee")
|
|
42
|
+
finalRentPayment String? @map("final_rent_payment")
|
|
43
|
+
clientDeposit String? @map("client_deposit")
|
|
44
|
+
firstRentPayment String? @map("first_rent_payment")
|
|
45
|
+
ercFeatures Json? @map("erc_features")
|
|
46
|
+
icr String? @map("icr")
|
|
47
|
+
ufssProductCode String? @map("ufss_product_code")
|
|
48
|
+
ufssInterestRateCode String? @map("ufss_interest_rate_code")
|
|
49
|
+
stressedPayment String? @map("stressed_payment")
|
|
50
|
+
stressedPaymentRate String? @map("stressed_payment_rate")
|
|
51
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
52
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
53
|
+
|
|
54
|
+
// Relationships
|
|
55
|
+
application Application @relation("ApplicationProductFeature", fields: [applicationId], references: [id])
|
|
52
56
|
|
|
53
57
|
@@map("product_features")
|
|
54
58
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Warnings:
|
|
3
|
-
|
|
4
|
-
- You are about to drop the column `sector_experience` on the `securities` table. All the data in the column will be lost.
|
|
5
|
-
- Added the required column `sector_experience_lid` to the `securities` table without a default value. This is not possible if the table is not empty.
|
|
6
|
-
- Made the column `property_type_lid` on table `securities` required. This step will fail if there are existing NULL values in that column.
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
-- DropForeignKey
|
|
10
|
-
ALTER TABLE "securities" DROP CONSTRAINT "securities_property_tenure_lid_fkey";
|
|
11
|
-
|
|
12
|
-
-- DropForeignKey
|
|
13
|
-
ALTER TABLE "securities" DROP CONSTRAINT "securities_property_type_lid_fkey";
|
|
14
|
-
|
|
15
|
-
-- AlterTable
|
|
16
|
-
ALTER TABLE "securities" DROP COLUMN "sector_experience",
|
|
17
|
-
ADD COLUMN "sector_experience_lid" TEXT NOT NULL,
|
|
18
|
-
ALTER COLUMN "construction_details" DROP DEFAULT,
|
|
19
|
-
ALTER COLUMN "flat_number_of_bedrooms" DROP DEFAULT,
|
|
20
|
-
ALTER COLUMN "is_ground_rent" DROP DEFAULT,
|
|
21
|
-
ALTER COLUMN "house_number_of_living_rooms" DROP DEFAULT,
|
|
22
|
-
ALTER COLUMN "house_number_of_tenancies" DROP DEFAULT,
|
|
23
|
-
ALTER COLUMN "property_address_city" DROP NOT NULL,
|
|
24
|
-
ALTER COLUMN "property_address_city" DROP DEFAULT,
|
|
25
|
-
ALTER COLUMN "property_address_line1" DROP DEFAULT,
|
|
26
|
-
ALTER COLUMN "property_address_line2" DROP NOT NULL,
|
|
27
|
-
ALTER COLUMN "property_address_line3" DROP NOT NULL,
|
|
28
|
-
ALTER COLUMN "property_address_post_code" DROP DEFAULT,
|
|
29
|
-
ALTER COLUMN "property_tenure_lid" DROP NOT NULL,
|
|
30
|
-
ALTER COLUMN "property_type_lid" SET NOT NULL,
|
|
31
|
-
ALTER COLUMN "property_year_built" DROP DEFAULT,
|
|
32
|
-
ALTER COLUMN "receipt_of_discount_details" DROP DEFAULT,
|
|
33
|
-
ALTER COLUMN "service_charge" DROP DEFAULT,
|
|
34
|
-
ALTER COLUMN "unexpired_remaining_lease" DROP DEFAULT;
|
|
35
|
-
|
|
36
|
-
-- AddForeignKey
|
|
37
|
-
ALTER TABLE "securities" ADD CONSTRAINT "securities_property_tenure_lid_fkey" FOREIGN KEY ("property_tenure_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
38
|
-
|
|
39
|
-
-- AddForeignKey
|
|
40
|
-
ALTER TABLE "securities" ADD CONSTRAINT "securities_property_type_lid_fkey" FOREIGN KEY ("property_type_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
41
|
-
|
|
42
|
-
-- AddForeignKey
|
|
43
|
-
ALTER TABLE "securities" ADD CONSTRAINT "securities_sector_experience_lid_fkey" FOREIGN KEY ("sector_experience_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `sector_experience` on the `securities` table. All the data in the column will be lost.
|
|
5
|
+
- Added the required column `sector_experience_lid` to the `securities` table without a default value. This is not possible if the table is not empty.
|
|
6
|
+
- Made the column `property_type_lid` on table `securities` required. This step will fail if there are existing NULL values in that column.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
-- DropForeignKey
|
|
10
|
+
ALTER TABLE "securities" DROP CONSTRAINT "securities_property_tenure_lid_fkey";
|
|
11
|
+
|
|
12
|
+
-- DropForeignKey
|
|
13
|
+
ALTER TABLE "securities" DROP CONSTRAINT "securities_property_type_lid_fkey";
|
|
14
|
+
|
|
15
|
+
-- AlterTable
|
|
16
|
+
ALTER TABLE "securities" DROP COLUMN "sector_experience",
|
|
17
|
+
ADD COLUMN "sector_experience_lid" TEXT NOT NULL,
|
|
18
|
+
ALTER COLUMN "construction_details" DROP DEFAULT,
|
|
19
|
+
ALTER COLUMN "flat_number_of_bedrooms" DROP DEFAULT,
|
|
20
|
+
ALTER COLUMN "is_ground_rent" DROP DEFAULT,
|
|
21
|
+
ALTER COLUMN "house_number_of_living_rooms" DROP DEFAULT,
|
|
22
|
+
ALTER COLUMN "house_number_of_tenancies" DROP DEFAULT,
|
|
23
|
+
ALTER COLUMN "property_address_city" DROP NOT NULL,
|
|
24
|
+
ALTER COLUMN "property_address_city" DROP DEFAULT,
|
|
25
|
+
ALTER COLUMN "property_address_line1" DROP DEFAULT,
|
|
26
|
+
ALTER COLUMN "property_address_line2" DROP NOT NULL,
|
|
27
|
+
ALTER COLUMN "property_address_line3" DROP NOT NULL,
|
|
28
|
+
ALTER COLUMN "property_address_post_code" DROP DEFAULT,
|
|
29
|
+
ALTER COLUMN "property_tenure_lid" DROP NOT NULL,
|
|
30
|
+
ALTER COLUMN "property_type_lid" SET NOT NULL,
|
|
31
|
+
ALTER COLUMN "property_year_built" DROP DEFAULT,
|
|
32
|
+
ALTER COLUMN "receipt_of_discount_details" DROP DEFAULT,
|
|
33
|
+
ALTER COLUMN "service_charge" DROP DEFAULT,
|
|
34
|
+
ALTER COLUMN "unexpired_remaining_lease" DROP DEFAULT;
|
|
35
|
+
|
|
36
|
+
-- AddForeignKey
|
|
37
|
+
ALTER TABLE "securities" ADD CONSTRAINT "securities_property_tenure_lid_fkey" FOREIGN KEY ("property_tenure_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
38
|
+
|
|
39
|
+
-- AddForeignKey
|
|
40
|
+
ALTER TABLE "securities" ADD CONSTRAINT "securities_property_type_lid_fkey" FOREIGN KEY ("property_type_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
41
|
+
|
|
42
|
+
-- AddForeignKey
|
|
43
|
+
ALTER TABLE "securities" ADD CONSTRAINT "securities_sector_experience_lid_fkey" FOREIGN KEY ("sector_experience_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Warnings:
|
|
3
|
-
|
|
4
|
-
- You are about to drop the column `user_id` on the `underwriters` table. All the data in the column will be lost.
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
-- DropForeignKey
|
|
8
|
-
ALTER TABLE "underwriters" DROP CONSTRAINT "underwriters_user_id_fkey";
|
|
9
|
-
|
|
10
|
-
-- AlterTable
|
|
11
|
-
ALTER TABLE "underwriters" DROP COLUMN "user_id";
|
|
12
|
-
|
|
13
|
-
-- AddForeignKey
|
|
14
|
-
ALTER TABLE "underwriters" ADD CONSTRAINT "underwriters_underwriter_id_fkey" FOREIGN KEY ("underwriter_id") REFERENCES "users"("account_id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `user_id` on the `underwriters` table. All the data in the column will be lost.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
-- DropForeignKey
|
|
8
|
+
ALTER TABLE "underwriters" DROP CONSTRAINT "underwriters_user_id_fkey";
|
|
9
|
+
|
|
10
|
+
-- AlterTable
|
|
11
|
+
ALTER TABLE "underwriters" DROP COLUMN "user_id";
|
|
12
|
+
|
|
13
|
+
-- AddForeignKey
|
|
14
|
+
ALTER TABLE "underwriters" ADD CONSTRAINT "underwriters_underwriter_id_fkey" FOREIGN KEY ("underwriter_id") REFERENCES "users"("account_id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Warnings:
|
|
3
|
-
|
|
4
|
-
- You are about to drop the column `credit_card_rationale` on the `applicant_creditcard_commitments` table. All the data in the column will be lost.
|
|
5
|
-
- You are about to drop the column `mortgage_hpp_rationale` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
6
|
-
- You are about to drop the column `purpose` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
7
|
-
- You are about to drop the column `remaining_term` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
8
|
-
- You are about to drop the column `security_details` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
9
|
-
- You are about to drop the column `commitmentId` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
10
|
-
- You are about to drop the column `doHaveSharedResponsibility` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
11
|
-
- You are about to drop the column `lenderName` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
12
|
-
- You are about to drop the column `monthlyPayment` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
13
|
-
- You are about to drop the column `outstandingBalance` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
14
|
-
- You are about to drop the column `remainingTerm` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
15
|
-
- You are about to drop the column `securityDetails` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
16
|
-
- You are about to drop the column `sharedMortgage` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
17
|
-
- You are about to drop the column `startDate` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
18
|
-
- You are about to drop the column `commitmentId` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
19
|
-
- You are about to drop the column `doHaveSharedResponsibility` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
20
|
-
- You are about to drop the column `lenderName` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
21
|
-
- You are about to drop the column `monthlyPayment` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
22
|
-
- You are about to drop the column `outstandingBalance` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
23
|
-
- You are about to drop the column `remainingTerm` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
24
|
-
- You are about to drop the column `sharedMortgage` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
25
|
-
- You are about to drop the column `startDate` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
26
|
-
- A unique constraint covering the columns `[commitment_id]` on the table `applicant_secured_loan_commitments` will be added. If there are existing duplicate values, this will fail.
|
|
27
|
-
- A unique constraint covering the columns `[commitment_id]` on the table `applicant_unsecured_loan_commitments` will be added. If there are existing duplicate values, this will fail.
|
|
28
|
-
- Made the column `lender_name` on table `applicant_creditcard_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
29
|
-
- Made the column `is_selected` on table `applicant_creditcard_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
30
|
-
- Made the column `source` on table `applicant_creditcard_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
31
|
-
- Made the column `is_selected` on table `applicant_mortgage_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
32
|
-
- Made the column `source` on table `applicant_mortgage_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
33
|
-
- Added the required column `commitment_id` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
34
|
-
- Added the required column `lender_name` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
35
|
-
- Added the required column `monthly_payment` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
36
|
-
- Added the required column `outstanding_balance` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
37
|
-
- Added the required column `commitment_id` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
38
|
-
- Added the required column `lender_name` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
39
|
-
- Added the required column `monthly_payment` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
40
|
-
- Added the required column `outstanding_balance` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
41
|
-
|
|
42
|
-
*/
|
|
43
|
-
-- DropForeignKey
|
|
44
|
-
ALTER TABLE "applicant_creditcard_commitments" DROP CONSTRAINT "applicant_creditcard_commitments_credit_card_repayment_typ_fkey";
|
|
45
|
-
|
|
46
|
-
-- DropIndex
|
|
47
|
-
DROP INDEX "applicant_creditcard_commitments_commitment_id_key";
|
|
48
|
-
|
|
49
|
-
-- AlterTable
|
|
50
|
-
ALTER TABLE "applicant_creditcard_commitments" DROP COLUMN "credit_card_rationale",
|
|
51
|
-
ALTER COLUMN "lender_name" SET NOT NULL,
|
|
52
|
-
ALTER COLUMN "credit_card_repayment_type_lid" DROP NOT NULL,
|
|
53
|
-
ALTER COLUMN "is_selected" SET NOT NULL,
|
|
54
|
-
ALTER COLUMN "source" SET NOT NULL;
|
|
55
|
-
|
|
56
|
-
-- AlterTable
|
|
57
|
-
ALTER TABLE "applicant_mortgage_commitments" DROP COLUMN "mortgage_hpp_rationale",
|
|
58
|
-
DROP COLUMN "purpose",
|
|
59
|
-
DROP COLUMN "remaining_term",
|
|
60
|
-
DROP COLUMN "security_details",
|
|
61
|
-
ALTER COLUMN "outstanding_balance" DROP NOT NULL,
|
|
62
|
-
ALTER COLUMN "monthly_payment" DROP NOT NULL,
|
|
63
|
-
ALTER COLUMN "is_selected" SET NOT NULL,
|
|
64
|
-
ALTER COLUMN "source" SET NOT NULL;
|
|
65
|
-
|
|
66
|
-
-- AlterTable
|
|
67
|
-
ALTER TABLE "applicant_secured_loan_commitments" DROP COLUMN "commitmentId",
|
|
68
|
-
DROP COLUMN "doHaveSharedResponsibility",
|
|
69
|
-
DROP COLUMN "lenderName",
|
|
70
|
-
DROP COLUMN "monthlyPayment",
|
|
71
|
-
DROP COLUMN "outstandingBalance",
|
|
72
|
-
DROP COLUMN "remainingTerm",
|
|
73
|
-
DROP COLUMN "securityDetails",
|
|
74
|
-
DROP COLUMN "sharedMortgage",
|
|
75
|
-
DROP COLUMN "startDate",
|
|
76
|
-
ADD COLUMN "commitment_id" TEXT NOT NULL,
|
|
77
|
-
ADD COLUMN "commitment_type_lid" TEXT,
|
|
78
|
-
ADD COLUMN "do_have_shared_responsibility" BOOLEAN,
|
|
79
|
-
ADD COLUMN "is_selected" BOOLEAN NOT NULL DEFAULT true,
|
|
80
|
-
ADD COLUMN "lender_name" TEXT NOT NULL,
|
|
81
|
-
ADD COLUMN "loan_type_lid" TEXT,
|
|
82
|
-
ADD COLUMN "monthly_payment" DECIMAL(10,2) NOT NULL,
|
|
83
|
-
ADD COLUMN "outstanding_balance" DECIMAL(10,2) NOT NULL,
|
|
84
|
-
ADD COLUMN "remaining_term" INTEGER,
|
|
85
|
-
ADD COLUMN "security_details" TEXT,
|
|
86
|
-
ADD COLUMN "shared_mortgage" TEXT,
|
|
87
|
-
ADD COLUMN "source" TEXT NOT NULL DEFAULT 'Broker',
|
|
88
|
-
ADD COLUMN "start_date" TEXT,
|
|
89
|
-
ALTER COLUMN "purpose" DROP NOT NULL;
|
|
90
|
-
|
|
91
|
-
-- AlterTable
|
|
92
|
-
ALTER TABLE "applicant_unsecured_loan_commitments" DROP COLUMN "commitmentId",
|
|
93
|
-
DROP COLUMN "doHaveSharedResponsibility",
|
|
94
|
-
DROP COLUMN "lenderName",
|
|
95
|
-
DROP COLUMN "monthlyPayment",
|
|
96
|
-
DROP COLUMN "outstandingBalance",
|
|
97
|
-
DROP COLUMN "remainingTerm",
|
|
98
|
-
DROP COLUMN "sharedMortgage",
|
|
99
|
-
DROP COLUMN "startDate",
|
|
100
|
-
ADD COLUMN "commitment_id" TEXT NOT NULL,
|
|
101
|
-
ADD COLUMN "commitment_type_lid" TEXT,
|
|
102
|
-
ADD COLUMN "do_have_shared_responsibility" BOOLEAN,
|
|
103
|
-
ADD COLUMN "is_selected" BOOLEAN NOT NULL DEFAULT true,
|
|
104
|
-
ADD COLUMN "lender_name" TEXT NOT NULL,
|
|
105
|
-
ADD COLUMN "loan_type_lid" TEXT,
|
|
106
|
-
ADD COLUMN "monthly_payment" DECIMAL(10,2) NOT NULL,
|
|
107
|
-
ADD COLUMN "outstanding_balance" DECIMAL(10,2) NOT NULL,
|
|
108
|
-
ADD COLUMN "remaining_term" INTEGER,
|
|
109
|
-
ADD COLUMN "security_details" TEXT,
|
|
110
|
-
ADD COLUMN "shared_mortgage" TEXT,
|
|
111
|
-
ADD COLUMN "source" TEXT NOT NULL DEFAULT 'Broker',
|
|
112
|
-
ADD COLUMN "start_date" TEXT,
|
|
113
|
-
ALTER COLUMN "purpose" DROP NOT NULL;
|
|
114
|
-
|
|
115
|
-
-- CreateIndex
|
|
116
|
-
CREATE UNIQUE INDEX "applicant_secured_loan_commitments_commitment_id_key" ON "applicant_secured_loan_commitments"("commitment_id");
|
|
117
|
-
|
|
118
|
-
-- CreateIndex
|
|
119
|
-
CREATE UNIQUE INDEX "applicant_unsecured_loan_commitments_commitment_id_key" ON "applicant_unsecured_loan_commitments"("commitment_id");
|
|
120
|
-
|
|
121
|
-
-- AddForeignKey
|
|
122
|
-
ALTER TABLE "applicant_creditcard_commitments" ADD CONSTRAINT "applicant_creditcard_commitments_credit_card_repayment_typ_fkey" FOREIGN KEY ("credit_card_repayment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
123
|
-
|
|
124
|
-
-- AddForeignKey
|
|
125
|
-
ALTER TABLE "applicant_secured_loan_commitments" ADD CONSTRAINT "applicant_secured_loan_commitments_commitment_type_lid_fkey" FOREIGN KEY ("commitment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
126
|
-
|
|
127
|
-
-- AddForeignKey
|
|
128
|
-
ALTER TABLE "applicant_secured_loan_commitments" ADD CONSTRAINT "applicant_secured_loan_commitments_loan_type_lid_fkey" FOREIGN KEY ("loan_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
129
|
-
|
|
130
|
-
-- AddForeignKey
|
|
131
|
-
ALTER TABLE "applicant_unsecured_loan_commitments" ADD CONSTRAINT "applicant_unsecured_loan_commitments_commitment_type_lid_fkey" FOREIGN KEY ("commitment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
132
|
-
|
|
133
|
-
-- AddForeignKey
|
|
134
|
-
ALTER TABLE "applicant_unsecured_loan_commitments" ADD CONSTRAINT "applicant_unsecured_loan_commitments_loan_type_lid_fkey" FOREIGN KEY ("loan_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `credit_card_rationale` on the `applicant_creditcard_commitments` table. All the data in the column will be lost.
|
|
5
|
+
- You are about to drop the column `mortgage_hpp_rationale` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
6
|
+
- You are about to drop the column `purpose` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
7
|
+
- You are about to drop the column `remaining_term` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
8
|
+
- You are about to drop the column `security_details` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
9
|
+
- You are about to drop the column `commitmentId` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
10
|
+
- You are about to drop the column `doHaveSharedResponsibility` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
11
|
+
- You are about to drop the column `lenderName` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
12
|
+
- You are about to drop the column `monthlyPayment` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
13
|
+
- You are about to drop the column `outstandingBalance` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
14
|
+
- You are about to drop the column `remainingTerm` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
15
|
+
- You are about to drop the column `securityDetails` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
16
|
+
- You are about to drop the column `sharedMortgage` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
17
|
+
- You are about to drop the column `startDate` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
|
|
18
|
+
- You are about to drop the column `commitmentId` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
19
|
+
- You are about to drop the column `doHaveSharedResponsibility` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
20
|
+
- You are about to drop the column `lenderName` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
21
|
+
- You are about to drop the column `monthlyPayment` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
22
|
+
- You are about to drop the column `outstandingBalance` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
23
|
+
- You are about to drop the column `remainingTerm` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
24
|
+
- You are about to drop the column `sharedMortgage` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
25
|
+
- You are about to drop the column `startDate` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
|
|
26
|
+
- A unique constraint covering the columns `[commitment_id]` on the table `applicant_secured_loan_commitments` will be added. If there are existing duplicate values, this will fail.
|
|
27
|
+
- A unique constraint covering the columns `[commitment_id]` on the table `applicant_unsecured_loan_commitments` will be added. If there are existing duplicate values, this will fail.
|
|
28
|
+
- Made the column `lender_name` on table `applicant_creditcard_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
29
|
+
- Made the column `is_selected` on table `applicant_creditcard_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
30
|
+
- Made the column `source` on table `applicant_creditcard_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
31
|
+
- Made the column `is_selected` on table `applicant_mortgage_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
32
|
+
- Made the column `source` on table `applicant_mortgage_commitments` required. This step will fail if there are existing NULL values in that column.
|
|
33
|
+
- Added the required column `commitment_id` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
34
|
+
- Added the required column `lender_name` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
35
|
+
- Added the required column `monthly_payment` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
36
|
+
- Added the required column `outstanding_balance` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
37
|
+
- Added the required column `commitment_id` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
38
|
+
- Added the required column `lender_name` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
39
|
+
- Added the required column `monthly_payment` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
40
|
+
- Added the required column `outstanding_balance` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
|
|
41
|
+
|
|
42
|
+
*/
|
|
43
|
+
-- DropForeignKey
|
|
44
|
+
ALTER TABLE "applicant_creditcard_commitments" DROP CONSTRAINT "applicant_creditcard_commitments_credit_card_repayment_typ_fkey";
|
|
45
|
+
|
|
46
|
+
-- DropIndex
|
|
47
|
+
DROP INDEX "applicant_creditcard_commitments_commitment_id_key";
|
|
48
|
+
|
|
49
|
+
-- AlterTable
|
|
50
|
+
ALTER TABLE "applicant_creditcard_commitments" DROP COLUMN "credit_card_rationale",
|
|
51
|
+
ALTER COLUMN "lender_name" SET NOT NULL,
|
|
52
|
+
ALTER COLUMN "credit_card_repayment_type_lid" DROP NOT NULL,
|
|
53
|
+
ALTER COLUMN "is_selected" SET NOT NULL,
|
|
54
|
+
ALTER COLUMN "source" SET NOT NULL;
|
|
55
|
+
|
|
56
|
+
-- AlterTable
|
|
57
|
+
ALTER TABLE "applicant_mortgage_commitments" DROP COLUMN "mortgage_hpp_rationale",
|
|
58
|
+
DROP COLUMN "purpose",
|
|
59
|
+
DROP COLUMN "remaining_term",
|
|
60
|
+
DROP COLUMN "security_details",
|
|
61
|
+
ALTER COLUMN "outstanding_balance" DROP NOT NULL,
|
|
62
|
+
ALTER COLUMN "monthly_payment" DROP NOT NULL,
|
|
63
|
+
ALTER COLUMN "is_selected" SET NOT NULL,
|
|
64
|
+
ALTER COLUMN "source" SET NOT NULL;
|
|
65
|
+
|
|
66
|
+
-- AlterTable
|
|
67
|
+
ALTER TABLE "applicant_secured_loan_commitments" DROP COLUMN "commitmentId",
|
|
68
|
+
DROP COLUMN "doHaveSharedResponsibility",
|
|
69
|
+
DROP COLUMN "lenderName",
|
|
70
|
+
DROP COLUMN "monthlyPayment",
|
|
71
|
+
DROP COLUMN "outstandingBalance",
|
|
72
|
+
DROP COLUMN "remainingTerm",
|
|
73
|
+
DROP COLUMN "securityDetails",
|
|
74
|
+
DROP COLUMN "sharedMortgage",
|
|
75
|
+
DROP COLUMN "startDate",
|
|
76
|
+
ADD COLUMN "commitment_id" TEXT NOT NULL,
|
|
77
|
+
ADD COLUMN "commitment_type_lid" TEXT,
|
|
78
|
+
ADD COLUMN "do_have_shared_responsibility" BOOLEAN,
|
|
79
|
+
ADD COLUMN "is_selected" BOOLEAN NOT NULL DEFAULT true,
|
|
80
|
+
ADD COLUMN "lender_name" TEXT NOT NULL,
|
|
81
|
+
ADD COLUMN "loan_type_lid" TEXT,
|
|
82
|
+
ADD COLUMN "monthly_payment" DECIMAL(10,2) NOT NULL,
|
|
83
|
+
ADD COLUMN "outstanding_balance" DECIMAL(10,2) NOT NULL,
|
|
84
|
+
ADD COLUMN "remaining_term" INTEGER,
|
|
85
|
+
ADD COLUMN "security_details" TEXT,
|
|
86
|
+
ADD COLUMN "shared_mortgage" TEXT,
|
|
87
|
+
ADD COLUMN "source" TEXT NOT NULL DEFAULT 'Broker',
|
|
88
|
+
ADD COLUMN "start_date" TEXT,
|
|
89
|
+
ALTER COLUMN "purpose" DROP NOT NULL;
|
|
90
|
+
|
|
91
|
+
-- AlterTable
|
|
92
|
+
ALTER TABLE "applicant_unsecured_loan_commitments" DROP COLUMN "commitmentId",
|
|
93
|
+
DROP COLUMN "doHaveSharedResponsibility",
|
|
94
|
+
DROP COLUMN "lenderName",
|
|
95
|
+
DROP COLUMN "monthlyPayment",
|
|
96
|
+
DROP COLUMN "outstandingBalance",
|
|
97
|
+
DROP COLUMN "remainingTerm",
|
|
98
|
+
DROP COLUMN "sharedMortgage",
|
|
99
|
+
DROP COLUMN "startDate",
|
|
100
|
+
ADD COLUMN "commitment_id" TEXT NOT NULL,
|
|
101
|
+
ADD COLUMN "commitment_type_lid" TEXT,
|
|
102
|
+
ADD COLUMN "do_have_shared_responsibility" BOOLEAN,
|
|
103
|
+
ADD COLUMN "is_selected" BOOLEAN NOT NULL DEFAULT true,
|
|
104
|
+
ADD COLUMN "lender_name" TEXT NOT NULL,
|
|
105
|
+
ADD COLUMN "loan_type_lid" TEXT,
|
|
106
|
+
ADD COLUMN "monthly_payment" DECIMAL(10,2) NOT NULL,
|
|
107
|
+
ADD COLUMN "outstanding_balance" DECIMAL(10,2) NOT NULL,
|
|
108
|
+
ADD COLUMN "remaining_term" INTEGER,
|
|
109
|
+
ADD COLUMN "security_details" TEXT,
|
|
110
|
+
ADD COLUMN "shared_mortgage" TEXT,
|
|
111
|
+
ADD COLUMN "source" TEXT NOT NULL DEFAULT 'Broker',
|
|
112
|
+
ADD COLUMN "start_date" TEXT,
|
|
113
|
+
ALTER COLUMN "purpose" DROP NOT NULL;
|
|
114
|
+
|
|
115
|
+
-- CreateIndex
|
|
116
|
+
CREATE UNIQUE INDEX "applicant_secured_loan_commitments_commitment_id_key" ON "applicant_secured_loan_commitments"("commitment_id");
|
|
117
|
+
|
|
118
|
+
-- CreateIndex
|
|
119
|
+
CREATE UNIQUE INDEX "applicant_unsecured_loan_commitments_commitment_id_key" ON "applicant_unsecured_loan_commitments"("commitment_id");
|
|
120
|
+
|
|
121
|
+
-- AddForeignKey
|
|
122
|
+
ALTER TABLE "applicant_creditcard_commitments" ADD CONSTRAINT "applicant_creditcard_commitments_credit_card_repayment_typ_fkey" FOREIGN KEY ("credit_card_repayment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
123
|
+
|
|
124
|
+
-- AddForeignKey
|
|
125
|
+
ALTER TABLE "applicant_secured_loan_commitments" ADD CONSTRAINT "applicant_secured_loan_commitments_commitment_type_lid_fkey" FOREIGN KEY ("commitment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
126
|
+
|
|
127
|
+
-- AddForeignKey
|
|
128
|
+
ALTER TABLE "applicant_secured_loan_commitments" ADD CONSTRAINT "applicant_secured_loan_commitments_loan_type_lid_fkey" FOREIGN KEY ("loan_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
129
|
+
|
|
130
|
+
-- AddForeignKey
|
|
131
|
+
ALTER TABLE "applicant_unsecured_loan_commitments" ADD CONSTRAINT "applicant_unsecured_loan_commitments_commitment_type_lid_fkey" FOREIGN KEY ("commitment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
132
|
+
|
|
133
|
+
-- AddForeignKey
|
|
134
|
+
ALTER TABLE "applicant_unsecured_loan_commitments" ADD CONSTRAINT "applicant_unsecured_loan_commitments_loan_type_lid_fkey" FOREIGN KEY ("loan_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- A unique constraint covering the columns `[commitment_id]` on the table `applicant_creditcard_commitments` will be added. If there are existing duplicate values, this will fail.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
-- CreateIndex
|
|
8
|
+
CREATE UNIQUE INDEX "applicant_creditcard_commitments_commitment_id_key" ON "applicant_creditcard_commitments"("commitment_id");
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- A unique constraint covering the columns `[application_id]` on the table `product_features` will be added. If there are existing duplicate values, this will fail.
|
|
5
|
+
- Added the required column `application_id` to the `product_features` table without a default value. This is not possible if the table is not empty.
|
|
6
|
+
|
|
7
|
+
*/
|
|
8
|
+
-- AlterTable
|
|
9
|
+
ALTER TABLE "product_features" ADD COLUMN "application_id" TEXT NOT NULL;
|
|
10
|
+
|
|
11
|
+
-- CreateIndex
|
|
12
|
+
CREATE UNIQUE INDEX "product_features_application_id_key" ON "product_features"("application_id");
|
|
13
|
+
|
|
14
|
+
-- AddForeignKey
|
|
15
|
+
ALTER TABLE "product_features" ADD CONSTRAINT "product_features_application_id_fkey" FOREIGN KEY ("application_id") REFERENCES "applications"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
package/prisma/schema.prisma
CHANGED
|
@@ -918,7 +918,7 @@ model Applicant {
|
|
|
918
918
|
model CreditCardCommitment {
|
|
919
919
|
id String @id @default(uuid())
|
|
920
920
|
applicantId String @map("applicant_id")
|
|
921
|
-
commitmentId String @map("commitment_id")
|
|
921
|
+
commitmentId String @unique @map("commitment_id")
|
|
922
922
|
lenderName String @map("lender_name")
|
|
923
923
|
creditLimit Decimal @map("credit_limit") @db.Decimal(10, 2)
|
|
924
924
|
outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
|
|
@@ -1554,24 +1554,25 @@ model Application {
|
|
|
1554
1554
|
applicantIds String[] @map("applicant_ids")
|
|
1555
1555
|
propertyIds String[] @map("property_ids")
|
|
1556
1556
|
createdAt DateTime @default(now()) @map("created_at")
|
|
1557
|
-
updatedAt DateTime @
|
|
1557
|
+
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
|
|
1558
1558
|
|
|
1559
1559
|
// Relations
|
|
1560
|
-
broker
|
|
1561
|
-
security
|
|
1562
|
-
solicitor
|
|
1563
|
-
product
|
|
1564
|
-
directDebit
|
|
1565
|
-
creditProfile
|
|
1566
|
-
mortgage
|
|
1567
|
-
company
|
|
1568
|
-
rationale
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1560
|
+
broker Broker? @relation("ApplicationBroker", fields: [brokerId], references: [id])
|
|
1561
|
+
security Security? @relation("ApplicationSecurity")
|
|
1562
|
+
solicitor Solicitor? @relation("ApplicationSolicitor")
|
|
1563
|
+
product Product? @relation("ApplicationProduct", fields: [productId], references: [id])
|
|
1564
|
+
directDebit ApplicationDirectDebit? @relation("ApplicationDirectDebit")
|
|
1565
|
+
creditProfile ApplicationCreditProfile? @relation("ApplicationCreditProfile")
|
|
1566
|
+
mortgage ApplicationMortgage? @relation("ApplicationMortgage")
|
|
1567
|
+
company ApplicationCompany? @relation("ApplicationCompany")
|
|
1568
|
+
rationale ApplicationRationale? @relation("ApplicationRationale")
|
|
1569
|
+
productFeatures ProductFeatures? @relation("ApplicationProductFeature")
|
|
1570
|
+
applicants Applicant[] @relation("ApplicationApplicants")
|
|
1571
|
+
properties Property[] @relation("ApplicationProperties")
|
|
1572
|
+
documents ApplicationDocument[]
|
|
1573
|
+
notes ApplicationNote[]
|
|
1574
|
+
audits ApplicationAudit[]
|
|
1575
|
+
products ApplicationProduct[] @relation("ApplicationProducts")
|
|
1575
1576
|
|
|
1576
1577
|
// Lookup relations
|
|
1577
1578
|
applicationType Lookup @relation("ApplicationType", fields: [applicationTypeLid], references: [id])
|
|
@@ -1669,56 +1670,60 @@ model ChecklistItem {
|
|
|
1669
1670
|
|
|
1670
1671
|
// From prisma/applications/product-features.prisma
|
|
1671
1672
|
model ProductFeatures {
|
|
1672
|
-
id
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1673
|
+
id String @id @default(uuid())
|
|
1674
|
+
applicationId String @unique @map("application_id")
|
|
1675
|
+
name String @map("name")
|
|
1676
|
+
clientAdvance String @map("client_advance")
|
|
1677
|
+
ltv String @map("ltv")
|
|
1678
|
+
repayment String @map("repayment")
|
|
1679
|
+
variableRepayment String @map("variable_repayment")
|
|
1680
|
+
reversionRateWithoutBaseRate String? @map("reversion_rate_without_base_rate")
|
|
1681
|
+
totalReversionRate String? @map("total_reversion_rate")
|
|
1682
|
+
initialRate String @map("initial_rate")
|
|
1683
|
+
fixedTerm String @map("fixed_term")
|
|
1684
|
+
fixedTermEndDate String? @map("fixed_term_end_date")
|
|
1685
|
+
baseRate String? @map("base_rate")
|
|
1686
|
+
productRate String? @map("product_rate")
|
|
1687
|
+
apr String? @map("apr")
|
|
1688
|
+
rentalCoverage String? @map("rental_coverage")
|
|
1689
|
+
repaymentType String? @map("repayment_type")
|
|
1690
|
+
applicationCategory String? @map("application_category")
|
|
1691
|
+
securityType String? @map("security_type")
|
|
1692
|
+
erc String? @map("erc")
|
|
1693
|
+
loanType String? @map("loan_type")
|
|
1694
|
+
maxLtvLimit String? @map("max_ltv_limit")
|
|
1695
|
+
reimbursement String? @map("reimbursement")
|
|
1696
|
+
reimbursementPerPound String? @map("reimbursement_per_pound")
|
|
1697
|
+
stressedApr String? @map("stressed_apr")
|
|
1698
|
+
stressedRate String? @map("stressed_rate")
|
|
1699
|
+
stressedRepayment String? @map("stressed_repayment")
|
|
1700
|
+
liborFloorRate String? @map("libor_floor_rate")
|
|
1701
|
+
totalTermInMonths String? @map("total_term_in_months")
|
|
1702
|
+
chargeType String @default("") @map("charge_type")
|
|
1703
|
+
productCategory String @default("") @map("product_category")
|
|
1704
|
+
ercCode String @default("") @map("erc_code")
|
|
1705
|
+
variableTerm String? @map("variable_term")
|
|
1706
|
+
totalFeePayable String? @map("total_fee_payable")
|
|
1707
|
+
dipIssueDate String? @map("dip_issue_date")
|
|
1708
|
+
estimatedCompletionDate String? @map("estimated_completion_date")
|
|
1709
|
+
dipExpiryDate String? @map("dip_expiry_date")
|
|
1710
|
+
fixedRepaymentUntillDate String? @map("fixed_repayment_untill_date")
|
|
1711
|
+
rentalReviewDate String? @map("rental_review_date")
|
|
1712
|
+
totalReimbursementWithFee String? @map("total_reimbursement_with_fee")
|
|
1713
|
+
finalRentPayment String? @map("final_rent_payment")
|
|
1714
|
+
clientDeposit String? @map("client_deposit")
|
|
1715
|
+
firstRentPayment String? @map("first_rent_payment")
|
|
1716
|
+
ercFeatures Json? @map("erc_features")
|
|
1717
|
+
icr String? @map("icr")
|
|
1718
|
+
ufssProductCode String? @map("ufss_product_code")
|
|
1719
|
+
ufssInterestRateCode String? @map("ufss_interest_rate_code")
|
|
1720
|
+
stressedPayment String? @map("stressed_payment")
|
|
1721
|
+
stressedPaymentRate String? @map("stressed_payment_rate")
|
|
1722
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
1723
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1724
|
+
|
|
1725
|
+
// Relationships
|
|
1726
|
+
application Application @relation("ApplicationProductFeature", fields: [applicationId], references: [id])
|
|
1722
1727
|
|
|
1723
1728
|
@@map("product_features")
|
|
1724
1729
|
}
|