@dynamatix/gb-schemas 2.0.38 → 2.0.39
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/applicants/mortgage-commitment.entity.d.ts +36 -19
- package/dist/entities/applicants/mortgage-commitment.entity.d.ts.map +1 -1
- package/dist/entities/applicants/mortgage-commitment.entity.js +10 -2
- package/entities/applicants/mortgage-commitment.entity.ts +47 -22
- package/package.json +1 -1
- package/prisma/applicants/mortgage-commitment.prisma +42 -29
- package/prisma/migrations/20250513170654_update_mortgage_commitment_schema/migration.sql +89 -0
- package/prisma/schema.prisma +48 -32
- package/prisma/shared/lookup.prisma +7 -4
|
@@ -3,32 +3,49 @@ import { LookupEntity } from '../shared/lookup.entity';
|
|
|
3
3
|
export declare class MortgageCommitmentEntity {
|
|
4
4
|
id: string;
|
|
5
5
|
applicantId: string;
|
|
6
|
-
lenderName: string;
|
|
7
|
-
propertyValue: number;
|
|
8
|
-
repaymentTypeLid: string;
|
|
9
|
-
mortgageTypeLid?: string;
|
|
10
|
-
fixedTerm: string;
|
|
11
|
-
originalLoanAmount: number;
|
|
12
|
-
outstandingBalance: number;
|
|
13
|
-
startDate: string;
|
|
14
|
-
monthlyPayment: number;
|
|
15
6
|
commitmentId: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
lenderName?: string;
|
|
8
|
+
propertyValue?: number;
|
|
9
|
+
repaymentTypeLid?: string;
|
|
10
|
+
mortgageTypeLid?: string;
|
|
11
|
+
fixedTerm?: string;
|
|
12
|
+
originalLoanAmount?: number;
|
|
13
|
+
outstandingBalance?: number;
|
|
14
|
+
startDate?: string;
|
|
15
|
+
monthlyPayment?: number;
|
|
16
|
+
furtherAdvances?: boolean;
|
|
17
|
+
furtherAdvanceDetails?: string;
|
|
18
|
+
accountUptoDate?: boolean;
|
|
19
|
+
accountUptoDateFailDetails?: string;
|
|
20
|
+
accountInArrears?: boolean;
|
|
21
|
+
accountInArrearsDetails?: string;
|
|
22
|
+
doHaveSharedResponsibility?: boolean;
|
|
23
|
+
sharedMortgage?: string;
|
|
24
|
+
source?: string;
|
|
25
|
+
isSelected?: boolean;
|
|
26
|
+
mortgageHPPRationale?: string;
|
|
27
|
+
financeTypeHppLid?: string;
|
|
28
|
+
hppRepaymentTypeLid?: string;
|
|
29
|
+
mortgageRate?: number;
|
|
30
|
+
financeHomeTypeLid?: string;
|
|
31
|
+
remainingTermMonth?: number;
|
|
32
|
+
chargeTypeLid?: string;
|
|
33
|
+
securityDetails?: string;
|
|
34
|
+
purpose?: string;
|
|
35
|
+
remainingTerm?: string;
|
|
25
36
|
createdAt: Date;
|
|
26
37
|
updatedAt: Date;
|
|
27
38
|
applicant?: ApplicantEntity;
|
|
28
39
|
repaymentType?: LookupEntity;
|
|
29
40
|
mortgageType?: LookupEntity;
|
|
30
|
-
|
|
41
|
+
financeTypeHpp?: LookupEntity;
|
|
42
|
+
hppRepaymentType?: LookupEntity;
|
|
43
|
+
financeHomeType?: LookupEntity;
|
|
44
|
+
chargeType?: LookupEntity;
|
|
31
45
|
constructor(partial: Partial<MortgageCommitmentEntity>);
|
|
46
|
+
get applicationId(): string | undefined;
|
|
47
|
+
get lendingType(): string | undefined;
|
|
48
|
+
get applicationType(): string | undefined;
|
|
32
49
|
get furtherAdvancesDisplay(): string;
|
|
33
50
|
get accountUptoDateDisplay(): string;
|
|
34
51
|
get accountInArrearsDisplay(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mortgage-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/mortgage-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,wBAAwB;IACjC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"mortgage-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/mortgage-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,wBAAwB;IACjC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,YAAY,EAAG,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,UAAU,CAAC,EAAE,YAAY,CAAC;gBAEd,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC;IAKtD,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,eAAe,IAAI,MAAM,GAAG,SAAS,CAExC;IAED,IAAI,sBAAsB,IAAI,MAAM,CAEnC;IAED,IAAI,sBAAsB,IAAI,MAAM,CAEnC;IAED,IAAI,uBAAuB,IAAI,MAAM,CAEpC;IAED,IAAI,iCAAiC,IAAI,MAAM,CAE9C;CACJ"}
|
|
@@ -2,8 +2,16 @@ export class MortgageCommitmentEntity {
|
|
|
2
2
|
constructor(partial) {
|
|
3
3
|
Object.assign(this, partial);
|
|
4
4
|
}
|
|
5
|
-
// Virtual
|
|
6
|
-
|
|
5
|
+
// Virtual properties from Mongoose model
|
|
6
|
+
get applicationId() {
|
|
7
|
+
return this.applicant?.applicationId;
|
|
8
|
+
}
|
|
9
|
+
get lendingType() {
|
|
10
|
+
return this.applicant?.application?.lendingType?.name;
|
|
11
|
+
}
|
|
12
|
+
get applicationType() {
|
|
13
|
+
return this.applicant?.application?.applicationType?.name;
|
|
14
|
+
}
|
|
7
15
|
get furtherAdvancesDisplay() {
|
|
8
16
|
return this.furtherAdvances ? "Yes" : "No";
|
|
9
17
|
}
|
|
@@ -4,25 +4,36 @@ import { LookupEntity } from '../shared/lookup.entity';
|
|
|
4
4
|
export class MortgageCommitmentEntity {
|
|
5
5
|
id!: string;
|
|
6
6
|
applicantId!: string;
|
|
7
|
-
lenderName!: string;
|
|
8
|
-
propertyValue!: number;
|
|
9
|
-
repaymentTypeLid!: string;
|
|
10
|
-
mortgageTypeLid?: string;
|
|
11
|
-
fixedTerm!: string;
|
|
12
|
-
originalLoanAmount!: number;
|
|
13
|
-
outstandingBalance!: number;
|
|
14
|
-
startDate!: string;
|
|
15
|
-
monthlyPayment!: number;
|
|
16
7
|
commitmentId!: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
lenderName?: string;
|
|
9
|
+
propertyValue?: number;
|
|
10
|
+
repaymentTypeLid?: string;
|
|
11
|
+
mortgageTypeLid?: string;
|
|
12
|
+
fixedTerm?: string;
|
|
13
|
+
originalLoanAmount?: number;
|
|
14
|
+
outstandingBalance?: number;
|
|
15
|
+
startDate?: string;
|
|
16
|
+
monthlyPayment?: number;
|
|
17
|
+
furtherAdvances?: boolean;
|
|
18
|
+
furtherAdvanceDetails?: string;
|
|
19
|
+
accountUptoDate?: boolean;
|
|
20
|
+
accountUptoDateFailDetails?: string;
|
|
21
|
+
accountInArrears?: boolean;
|
|
22
|
+
accountInArrearsDetails?: string;
|
|
23
|
+
doHaveSharedResponsibility?: boolean;
|
|
24
|
+
sharedMortgage?: string;
|
|
25
|
+
source?: string;
|
|
26
|
+
isSelected?: boolean;
|
|
27
|
+
mortgageHPPRationale?: string;
|
|
28
|
+
financeTypeHppLid?: string;
|
|
29
|
+
hppRepaymentTypeLid?: string;
|
|
30
|
+
mortgageRate?: number;
|
|
31
|
+
financeHomeTypeLid?: string;
|
|
32
|
+
remainingTermMonth?: number;
|
|
33
|
+
chargeTypeLid?: string;
|
|
34
|
+
securityDetails?: string;
|
|
35
|
+
purpose?: string;
|
|
36
|
+
remainingTerm?: string;
|
|
26
37
|
createdAt!: Date;
|
|
27
38
|
updatedAt!: Date;
|
|
28
39
|
|
|
@@ -30,14 +41,28 @@ export class MortgageCommitmentEntity {
|
|
|
30
41
|
applicant?: ApplicantEntity;
|
|
31
42
|
repaymentType?: LookupEntity;
|
|
32
43
|
mortgageType?: LookupEntity;
|
|
33
|
-
|
|
44
|
+
financeTypeHpp?: LookupEntity;
|
|
45
|
+
hppRepaymentType?: LookupEntity;
|
|
46
|
+
financeHomeType?: LookupEntity;
|
|
47
|
+
chargeType?: LookupEntity;
|
|
34
48
|
|
|
35
49
|
constructor(partial: Partial<MortgageCommitmentEntity>) {
|
|
36
50
|
Object.assign(this, partial);
|
|
37
51
|
}
|
|
38
52
|
|
|
39
|
-
// Virtual
|
|
40
|
-
|
|
53
|
+
// Virtual properties from Mongoose model
|
|
54
|
+
get applicationId(): string | undefined {
|
|
55
|
+
return this.applicant?.applicationId;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get lendingType(): string | undefined {
|
|
59
|
+
return this.applicant?.application?.lendingType?.name;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get applicationType(): string | undefined {
|
|
63
|
+
return this.applicant?.application?.applicationType?.name;
|
|
64
|
+
}
|
|
65
|
+
|
|
41
66
|
get furtherAdvancesDisplay(): string {
|
|
42
67
|
return this.furtherAdvances ? "Yes" : "No";
|
|
43
68
|
}
|
|
@@ -53,4 +78,4 @@ export class MortgageCommitmentEntity {
|
|
|
53
78
|
get doHaveSharedResponsibilityDisplay(): string {
|
|
54
79
|
return this.doHaveSharedResponsibility ? "Yes" : "No";
|
|
55
80
|
}
|
|
56
|
-
}
|
|
81
|
+
}
|
package/package.json
CHANGED
|
@@ -1,34 +1,47 @@
|
|
|
1
1
|
model MortgageCommitment {
|
|
2
|
-
id
|
|
3
|
-
applicantId
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
applicantId String @map("applicant_id")
|
|
4
|
+
commitmentId String @unique @map("commitment_id")
|
|
5
|
+
lenderName String? @map("lender_name")
|
|
6
|
+
propertyValue Decimal? @map("property_value") @db.Decimal(10, 2)
|
|
7
|
+
repaymentTypeLid String? @map("repayment_type_lid")
|
|
8
|
+
mortgageTypeLid String? @map("mortgage_type_lid")
|
|
9
|
+
fixedTerm String? @map("fixed_term")
|
|
10
|
+
originalLoanAmount Decimal? @map("original_loan_amount") @db.Decimal(10, 2)
|
|
11
|
+
outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
|
|
12
|
+
startDate String? @map("start_date")
|
|
13
|
+
monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
|
|
14
|
+
furtherAdvances Boolean? @map("further_advances")
|
|
15
|
+
furtherAdvanceDetails String? @map("further_advance_details")
|
|
16
|
+
accountUptoDate Boolean? @map("account_upto_date")
|
|
17
|
+
accountUptoDateFailDetails String? @map("account_upto_date_fail_details")
|
|
18
|
+
accountInArrears Boolean? @map("account_in_arrears")
|
|
19
|
+
accountInArrearsDetails String? @map("account_in_arrears_details")
|
|
20
|
+
doHaveSharedResponsibility Boolean? @map("do_have_shared_responsibility")
|
|
21
|
+
sharedMortgage String? @map("shared_mortgage")
|
|
22
|
+
source String? @default("Broker") @map("source")
|
|
23
|
+
isSelected Boolean? @default(true) @map("is_selected")
|
|
24
|
+
mortgageHPPRationale String? @default("") @map("mortgage_hpp_rationale")
|
|
25
|
+
financeTypeHppLid String? @map("finance_type_hpp_lid")
|
|
26
|
+
hppRepaymentTypeLid String? @map("hpp_repayment_type_lid")
|
|
27
|
+
mortgageRate Float? @map("mortgage_rate")
|
|
28
|
+
financeHomeTypeLid String? @map("finance_home_type_lid")
|
|
29
|
+
remainingTermMonth Int? @map("remaining_term_month")
|
|
30
|
+
chargeTypeLid String? @map("charge_type_lid")
|
|
31
|
+
securityDetails String? @map("security_details")
|
|
32
|
+
purpose String? @map("purpose")
|
|
33
|
+
remainingTerm String? @map("remaining_term")
|
|
34
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
35
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
26
36
|
|
|
27
37
|
// Relations
|
|
28
|
-
applicant
|
|
29
|
-
repaymentType
|
|
30
|
-
mortgageType
|
|
31
|
-
|
|
38
|
+
applicant Applicant @relation("ApplicantMortgageCommitments", fields: [applicantId], references: [id])
|
|
39
|
+
repaymentType Lookup? @relation("RepaymentType", fields: [repaymentTypeLid], references: [id])
|
|
40
|
+
mortgageType Lookup? @relation("MortgageType", fields: [mortgageTypeLid], references: [id])
|
|
41
|
+
financeTypeHpp Lookup? @relation("FinanceTypeHpp", fields: [financeTypeHppLid], references: [id])
|
|
42
|
+
hppRepaymentType Lookup? @relation("HppRepaymentType", fields: [hppRepaymentTypeLid], references: [id])
|
|
43
|
+
financeHomeType Lookup? @relation("FinanceHomeType", fields: [financeHomeTypeLid], references: [id])
|
|
44
|
+
chargeType Lookup? @relation("ChargeType", fields: [chargeTypeLid], references: [id])
|
|
32
45
|
|
|
33
46
|
@@map("applicant_mortgage_commitments")
|
|
34
|
-
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `accountInArrears` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
5
|
+
- You are about to drop the column `accountInArrearsDetails` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
6
|
+
- You are about to drop the column `accountUptoDate` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
7
|
+
- You are about to drop the column `accountUptoDateFailDetails` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
8
|
+
- You are about to drop the column `commitment_type_lid` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
9
|
+
- You are about to drop the column `doHaveSharedResponsibility` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
10
|
+
- You are about to drop the column `fixedTerm` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
11
|
+
- You are about to drop the column `furtherAdvanceDetails` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
12
|
+
- You are about to drop the column `furtherAdvances` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
13
|
+
- You are about to drop the column `joint_names` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
14
|
+
- You are about to drop the column `originalLoanAmount` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
15
|
+
- You are about to drop the column `sharedMortgage` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
16
|
+
- You are about to drop the column `startDate` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
|
|
17
|
+
- You are about to alter the column `property_value` on the `applicant_mortgage_commitments` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Decimal(10,2)`.
|
|
18
|
+
- You are about to alter the column `outstanding_balance` on the `applicant_mortgage_commitments` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Decimal(10,2)`.
|
|
19
|
+
- You are about to alter the column `monthly_payment` on the `applicant_mortgage_commitments` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Decimal(10,2)`.
|
|
20
|
+
- A unique constraint covering the columns `[commitment_id]` on the table `applicant_mortgage_commitments` will be added. If there are existing duplicate values, this will fail.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
-- DropForeignKey
|
|
24
|
+
ALTER TABLE "applicant_mortgage_commitments" DROP CONSTRAINT "applicant_mortgage_commitments_commitment_type_lid_fkey";
|
|
25
|
+
|
|
26
|
+
-- DropForeignKey
|
|
27
|
+
ALTER TABLE "applicant_mortgage_commitments" DROP CONSTRAINT "applicant_mortgage_commitments_repayment_type_lid_fkey";
|
|
28
|
+
|
|
29
|
+
-- AlterTable
|
|
30
|
+
ALTER TABLE "applicant_mortgage_commitments" DROP COLUMN "accountInArrears",
|
|
31
|
+
DROP COLUMN "accountInArrearsDetails",
|
|
32
|
+
DROP COLUMN "accountUptoDate",
|
|
33
|
+
DROP COLUMN "accountUptoDateFailDetails",
|
|
34
|
+
DROP COLUMN "commitment_type_lid",
|
|
35
|
+
DROP COLUMN "doHaveSharedResponsibility",
|
|
36
|
+
DROP COLUMN "fixedTerm",
|
|
37
|
+
DROP COLUMN "furtherAdvanceDetails",
|
|
38
|
+
DROP COLUMN "furtherAdvances",
|
|
39
|
+
DROP COLUMN "joint_names",
|
|
40
|
+
DROP COLUMN "originalLoanAmount",
|
|
41
|
+
DROP COLUMN "sharedMortgage",
|
|
42
|
+
DROP COLUMN "startDate",
|
|
43
|
+
ADD COLUMN "account_in_arrears" BOOLEAN,
|
|
44
|
+
ADD COLUMN "account_in_arrears_details" TEXT,
|
|
45
|
+
ADD COLUMN "account_upto_date" BOOLEAN,
|
|
46
|
+
ADD COLUMN "account_upto_date_fail_details" TEXT,
|
|
47
|
+
ADD COLUMN "charge_type_lid" TEXT,
|
|
48
|
+
ADD COLUMN "do_have_shared_responsibility" BOOLEAN,
|
|
49
|
+
ADD COLUMN "finance_home_type_lid" TEXT,
|
|
50
|
+
ADD COLUMN "finance_type_hpp_lid" TEXT,
|
|
51
|
+
ADD COLUMN "fixed_term" TEXT,
|
|
52
|
+
ADD COLUMN "further_advance_details" TEXT,
|
|
53
|
+
ADD COLUMN "further_advances" BOOLEAN,
|
|
54
|
+
ADD COLUMN "hpp_repayment_type_lid" TEXT,
|
|
55
|
+
ADD COLUMN "is_selected" BOOLEAN DEFAULT true,
|
|
56
|
+
ADD COLUMN "mortgage_hpp_rationale" TEXT DEFAULT '',
|
|
57
|
+
ADD COLUMN "mortgage_rate" DOUBLE PRECISION,
|
|
58
|
+
ADD COLUMN "original_loan_amount" DECIMAL(10,2),
|
|
59
|
+
ADD COLUMN "purpose" TEXT,
|
|
60
|
+
ADD COLUMN "remaining_term" TEXT,
|
|
61
|
+
ADD COLUMN "remaining_term_month" INTEGER,
|
|
62
|
+
ADD COLUMN "security_details" TEXT,
|
|
63
|
+
ADD COLUMN "shared_mortgage" TEXT,
|
|
64
|
+
ADD COLUMN "source" TEXT DEFAULT 'Broker',
|
|
65
|
+
ADD COLUMN "start_date" TEXT,
|
|
66
|
+
ALTER COLUMN "lender_name" DROP NOT NULL,
|
|
67
|
+
ALTER COLUMN "property_value" DROP NOT NULL,
|
|
68
|
+
ALTER COLUMN "property_value" SET DATA TYPE DECIMAL(10,2),
|
|
69
|
+
ALTER COLUMN "repayment_type_lid" DROP NOT NULL,
|
|
70
|
+
ALTER COLUMN "outstanding_balance" SET DATA TYPE DECIMAL(10,2),
|
|
71
|
+
ALTER COLUMN "monthly_payment" SET DATA TYPE DECIMAL(10,2);
|
|
72
|
+
|
|
73
|
+
-- CreateIndex
|
|
74
|
+
CREATE UNIQUE INDEX "applicant_mortgage_commitments_commitment_id_key" ON "applicant_mortgage_commitments"("commitment_id");
|
|
75
|
+
|
|
76
|
+
-- AddForeignKey
|
|
77
|
+
ALTER TABLE "applicant_mortgage_commitments" ADD CONSTRAINT "applicant_mortgage_commitments_repayment_type_lid_fkey" FOREIGN KEY ("repayment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
78
|
+
|
|
79
|
+
-- AddForeignKey
|
|
80
|
+
ALTER TABLE "applicant_mortgage_commitments" ADD CONSTRAINT "applicant_mortgage_commitments_finance_type_hpp_lid_fkey" FOREIGN KEY ("finance_type_hpp_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
81
|
+
|
|
82
|
+
-- AddForeignKey
|
|
83
|
+
ALTER TABLE "applicant_mortgage_commitments" ADD CONSTRAINT "applicant_mortgage_commitments_hpp_repayment_type_lid_fkey" FOREIGN KEY ("hpp_repayment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
84
|
+
|
|
85
|
+
-- AddForeignKey
|
|
86
|
+
ALTER TABLE "applicant_mortgage_commitments" ADD CONSTRAINT "applicant_mortgage_commitments_finance_home_type_lid_fkey" FOREIGN KEY ("finance_home_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
87
|
+
|
|
88
|
+
-- AddForeignKey
|
|
89
|
+
ALTER TABLE "applicant_mortgage_commitments" ADD CONSTRAINT "applicant_mortgage_commitments_charge_type_lid_fkey" FOREIGN KEY ("charge_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
package/prisma/schema.prisma
CHANGED
|
@@ -202,9 +202,12 @@ model Lookup {
|
|
|
202
202
|
propertyType_securities Security[] @relation("PropertyType")
|
|
203
203
|
|
|
204
204
|
// MortgageCommitment Relations
|
|
205
|
-
repaymentType_mortgageCommitments
|
|
206
|
-
mortgageType_mortgageCommitments
|
|
207
|
-
|
|
205
|
+
repaymentType_mortgageCommitments MortgageCommitment[] @relation("RepaymentType")
|
|
206
|
+
mortgageType_mortgageCommitments MortgageCommitment[] @relation("MortgageType")
|
|
207
|
+
financeTypeHpp_mortgageCommitments MortgageCommitment[] @relation("FinanceTypeHpp")
|
|
208
|
+
hppRepaymentType_mortgageCommitments MortgageCommitment[] @relation("HppRepaymentType")
|
|
209
|
+
financeHomeType_mortgageCommitments MortgageCommitment[] @relation("FinanceHomeType")
|
|
210
|
+
chargeType_mortgageCommitments MortgageCommitment[] @relation("ChargeType")
|
|
208
211
|
|
|
209
212
|
// OtherIncome Relations
|
|
210
213
|
payFrequency1_otherIncomes ApplicantOtherIncome[] @relation("PayFrequency1")
|
|
@@ -247,7 +250,7 @@ model Lookup {
|
|
|
247
250
|
|
|
248
251
|
// CreditCardCommitment Relations
|
|
249
252
|
// commitmentType_creditCardCommitments CreditCardCommitment[] @relation("CommitmentType")
|
|
250
|
-
repaymentType_creditCardCommitments
|
|
253
|
+
repaymentType_creditCardCommitments CreditCardCommitment[] @relation("CreditCardRepaymentType")
|
|
251
254
|
|
|
252
255
|
creditDataStatus ApplicantCreditData[] @relation("CreditDataStatus")
|
|
253
256
|
incomeSourceEmploymentStatus ApplicantIncomeSource[] @relation("IncomeSourceEmploymentStatus")
|
|
@@ -951,36 +954,49 @@ model LoanCommitment {
|
|
|
951
954
|
|
|
952
955
|
// From prisma/applicants/mortgage-commitment.prisma
|
|
953
956
|
model MortgageCommitment {
|
|
954
|
-
id
|
|
955
|
-
applicantId
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
957
|
+
id String @id @default(uuid())
|
|
958
|
+
applicantId String @map("applicant_id")
|
|
959
|
+
commitmentId String @unique @map("commitment_id")
|
|
960
|
+
lenderName String? @map("lender_name")
|
|
961
|
+
propertyValue Decimal? @map("property_value") @db.Decimal(10, 2)
|
|
962
|
+
repaymentTypeLid String? @map("repayment_type_lid")
|
|
963
|
+
mortgageTypeLid String? @map("mortgage_type_lid")
|
|
964
|
+
fixedTerm String? @map("fixed_term")
|
|
965
|
+
originalLoanAmount Decimal? @map("original_loan_amount") @db.Decimal(10, 2)
|
|
966
|
+
outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
|
|
967
|
+
startDate String? @map("start_date")
|
|
968
|
+
monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
|
|
969
|
+
furtherAdvances Boolean? @map("further_advances")
|
|
970
|
+
furtherAdvanceDetails String? @map("further_advance_details")
|
|
971
|
+
accountUptoDate Boolean? @map("account_upto_date")
|
|
972
|
+
accountUptoDateFailDetails String? @map("account_upto_date_fail_details")
|
|
973
|
+
accountInArrears Boolean? @map("account_in_arrears")
|
|
974
|
+
accountInArrearsDetails String? @map("account_in_arrears_details")
|
|
975
|
+
doHaveSharedResponsibility Boolean? @map("do_have_shared_responsibility")
|
|
976
|
+
sharedMortgage String? @map("shared_mortgage")
|
|
977
|
+
source String? @default("Broker") @map("source")
|
|
978
|
+
isSelected Boolean? @default(true) @map("is_selected")
|
|
979
|
+
mortgageHPPRationale String? @default("") @map("mortgage_hpp_rationale")
|
|
980
|
+
financeTypeHppLid String? @map("finance_type_hpp_lid")
|
|
981
|
+
hppRepaymentTypeLid String? @map("hpp_repayment_type_lid")
|
|
982
|
+
mortgageRate Float? @map("mortgage_rate")
|
|
983
|
+
financeHomeTypeLid String? @map("finance_home_type_lid")
|
|
984
|
+
remainingTermMonth Int? @map("remaining_term_month")
|
|
985
|
+
chargeTypeLid String? @map("charge_type_lid")
|
|
986
|
+
securityDetails String? @map("security_details")
|
|
987
|
+
purpose String? @map("purpose")
|
|
988
|
+
remainingTerm String? @map("remaining_term")
|
|
989
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
990
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
978
991
|
|
|
979
992
|
// Relations
|
|
980
|
-
applicant
|
|
981
|
-
repaymentType
|
|
982
|
-
mortgageType
|
|
983
|
-
|
|
993
|
+
applicant Applicant @relation("ApplicantMortgageCommitments", fields: [applicantId], references: [id])
|
|
994
|
+
repaymentType Lookup? @relation("RepaymentType", fields: [repaymentTypeLid], references: [id])
|
|
995
|
+
mortgageType Lookup? @relation("MortgageType", fields: [mortgageTypeLid], references: [id])
|
|
996
|
+
financeTypeHpp Lookup? @relation("FinanceTypeHpp", fields: [financeTypeHppLid], references: [id])
|
|
997
|
+
hppRepaymentType Lookup? @relation("HppRepaymentType", fields: [hppRepaymentTypeLid], references: [id])
|
|
998
|
+
financeHomeType Lookup? @relation("FinanceHomeType", fields: [financeHomeTypeLid], references: [id])
|
|
999
|
+
chargeType Lookup? @relation("ChargeType", fields: [chargeTypeLid], references: [id])
|
|
984
1000
|
|
|
985
1001
|
@@map("applicant_mortgage_commitments")
|
|
986
1002
|
}
|
|
@@ -81,9 +81,12 @@ model Lookup {
|
|
|
81
81
|
propertyType_securities Security[] @relation("PropertyType")
|
|
82
82
|
|
|
83
83
|
// MortgageCommitment Relations
|
|
84
|
-
repaymentType_mortgageCommitments
|
|
85
|
-
mortgageType_mortgageCommitments
|
|
86
|
-
|
|
84
|
+
repaymentType_mortgageCommitments MortgageCommitment[] @relation("RepaymentType")
|
|
85
|
+
mortgageType_mortgageCommitments MortgageCommitment[] @relation("MortgageType")
|
|
86
|
+
financeTypeHpp_mortgageCommitments MortgageCommitment[] @relation("FinanceTypeHpp")
|
|
87
|
+
hppRepaymentType_mortgageCommitments MortgageCommitment[] @relation("HppRepaymentType")
|
|
88
|
+
financeHomeType_mortgageCommitments MortgageCommitment[] @relation("FinanceHomeType")
|
|
89
|
+
chargeType_mortgageCommitments MortgageCommitment[] @relation("ChargeType")
|
|
87
90
|
|
|
88
91
|
// OtherIncome Relations
|
|
89
92
|
payFrequency1_otherIncomes ApplicantOtherIncome[] @relation("PayFrequency1")
|
|
@@ -126,7 +129,7 @@ model Lookup {
|
|
|
126
129
|
|
|
127
130
|
// CreditCardCommitment Relations
|
|
128
131
|
// commitmentType_creditCardCommitments CreditCardCommitment[] @relation("CommitmentType")
|
|
129
|
-
repaymentType_creditCardCommitments
|
|
132
|
+
repaymentType_creditCardCommitments CreditCardCommitment[] @relation("CreditCardRepaymentType")
|
|
130
133
|
|
|
131
134
|
creditDataStatus ApplicantCreditData[] @relation("CreditDataStatus")
|
|
132
135
|
incomeSourceEmploymentStatus ApplicantIncomeSource[] @relation("IncomeSourceEmploymentStatus")
|