@dynamatix/gb-schemas 2.0.23 → 2.0.24
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/entities/applications/application-direct-debit.entity.ts +4 -2
- package/entities/applications/application-mortgage.entity.ts +2 -3
- package/package.json +1 -1
- package/prisma/applications/application-direct-debit.prisma +4 -0
- package/prisma/applications/application-mortgage.prisma +9 -10
- package/prisma/migrations/20250507184905_update_mortgage_schema/migration.sql +8 -0
- package/prisma/migrations/20250507194746_update_direct_debit_schema/migration.sql +5 -0
- package/prisma/schema.prisma +78 -72
- package/prisma/shared/lookup.prisma +67 -64
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApplicationEntity } from './application.entity';
|
|
2
|
+
import { LookupEntity } from '../shared/lookup.entity';
|
|
2
3
|
|
|
3
4
|
export class ApplicationDirectDebitEntity {
|
|
4
5
|
id!: string;
|
|
@@ -11,15 +12,16 @@ export class ApplicationDirectDebitEntity {
|
|
|
11
12
|
city?: string;
|
|
12
13
|
contactPostcode!: string;
|
|
13
14
|
institution?: string;
|
|
14
|
-
isConfirmDeclaration
|
|
15
|
+
isConfirmDeclaration!: boolean;
|
|
15
16
|
nameOfAccountHolder!: string;
|
|
16
|
-
selectedPaymentDayLid
|
|
17
|
+
selectedPaymentDayLid!: string;
|
|
17
18
|
sortCode!: number;
|
|
18
19
|
createdAt!: Date;
|
|
19
20
|
updatedAt!: Date;
|
|
20
21
|
|
|
21
22
|
// Relations
|
|
22
23
|
application!: ApplicationEntity;
|
|
24
|
+
selectedPaymentDay?: LookupEntity;
|
|
23
25
|
|
|
24
26
|
constructor(partial: Partial<ApplicationDirectDebitEntity>) {
|
|
25
27
|
Object.assign(this, partial);
|
|
@@ -6,7 +6,6 @@ export class ApplicationMortgageEntity {
|
|
|
6
6
|
applicationId!: string;
|
|
7
7
|
pageValidFlag!: boolean;
|
|
8
8
|
existingMortgageLender?: string;
|
|
9
|
-
topSlicing!: boolean;
|
|
10
9
|
purposeOfMortgage!: string;
|
|
11
10
|
depositComeFromLids!: string[];
|
|
12
11
|
ifOtherDetails!: string;
|
|
@@ -20,8 +19,8 @@ export class ApplicationMortgageEntity {
|
|
|
20
19
|
monthlyRentalIncome!: number;
|
|
21
20
|
outstandingBalance!: number;
|
|
22
21
|
fundRaisedFor!: string;
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
sourceofFundsLid!: string;
|
|
23
|
+
sourceofFundDetails!: string;
|
|
25
24
|
propertyValuationDetails!: string;
|
|
26
25
|
telephoneNumber!: string;
|
|
27
26
|
isDistressedSale!: boolean;
|
package/package.json
CHANGED
|
@@ -19,5 +19,9 @@ model ApplicationDirectDebit {
|
|
|
19
19
|
// Relations
|
|
20
20
|
application Application @relation("ApplicationDirectDebit", fields: [applicationId], references: [id])
|
|
21
21
|
|
|
22
|
+
// Lookup relations
|
|
23
|
+
applicationType Lookup @relation("PaymentDay", fields: [selectedPaymentDayLid], references: [id])
|
|
24
|
+
|
|
25
|
+
@@index([selectedPaymentDayLid])
|
|
22
26
|
@@map("application_direct_debits")
|
|
23
27
|
}
|
|
@@ -3,22 +3,21 @@ model ApplicationMortgage {
|
|
|
3
3
|
applicationId String @unique @map("application_id")
|
|
4
4
|
pageValidFlag Boolean @default(false) @map("page_valid_flag")
|
|
5
5
|
existingMortgageLender String? @map("existing_mortgage_lender") @db.VarChar(35)
|
|
6
|
-
topSlicing Boolean @default(false) @map("top_slicing")
|
|
7
6
|
purposeOfMortgage String @map("purpose_of_mortgage") @db.VarChar(50)
|
|
8
7
|
depositComeFromLids String[] @map("deposit_come_from_lids")
|
|
9
8
|
ifOtherDetails String @map("if_other_details") @db.VarChar(50)
|
|
10
|
-
purchasePrice Decimal @map("purchase_price")
|
|
9
|
+
purchasePrice Decimal @map("purchase_price")
|
|
11
10
|
repaymentTypeLid String @map("repayment_type_lid")
|
|
12
11
|
exitStrategyLid String @map("exit_strategy_lid")
|
|
13
12
|
isCapitalRaise Boolean @default(false) @map("is_capital_raise")
|
|
14
13
|
purchaseDate String @map("purchase_date") @db.VarChar(10)
|
|
15
|
-
estimatedValue Decimal @map("estimated_value")
|
|
16
|
-
loanRequired Decimal @map("loan_required")
|
|
17
|
-
monthlyRentalIncome Decimal @map("monthly_rental_income")
|
|
18
|
-
outstandingBalance Decimal @map("outstanding_balance")
|
|
14
|
+
estimatedValue Decimal @map("estimated_value")
|
|
15
|
+
loanRequired Decimal @map("loan_required")
|
|
16
|
+
monthlyRentalIncome Decimal @map("monthly_rental_income")
|
|
17
|
+
outstandingBalance Decimal @map("outstanding_balance")
|
|
19
18
|
fundRaisedFor String @map("fund_raised_for") @db.VarChar(250)
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
sourceofFundsLid String @map("source_of_funds_lid")
|
|
20
|
+
sourceofFundDetails String @map("source_of_fund_details") @db.VarChar(50)
|
|
22
21
|
propertyValuationDetails String @map("property_valuation_details") @db.VarChar(35)
|
|
23
22
|
telephoneNumber String @map("telephone_number") @db.VarChar(15)
|
|
24
23
|
isDistressedSale Boolean @default(false) @map("is_distressed_sale")
|
|
@@ -38,11 +37,11 @@ model ApplicationMortgage {
|
|
|
38
37
|
application Application @relation("ApplicationMortgage", fields: [applicationId], references: [id])
|
|
39
38
|
repaymentType Lookup @relation("RepaymentType", fields: [repaymentTypeLid], references: [id])
|
|
40
39
|
exitStrategy Lookup @relation("ExitStrategy", fields: [exitStrategyLid], references: [id])
|
|
41
|
-
|
|
40
|
+
sourceofFunds Lookup @relation("SourceofFunds", fields: [sourceofFundsLid], references: [id])
|
|
42
41
|
saleMade Lookup? @relation("SaleMade", fields: [saleMadeLid], references: [id])
|
|
43
42
|
leaseType Lookup @relation("LeaseType", fields: [leaseTypeLid], references: [id])
|
|
44
43
|
depositComeFrom Lookup[] @relation("DepositComeFrom")
|
|
45
44
|
proposedTenants Lookup[] @relation("ProposedTenants")
|
|
46
45
|
|
|
47
46
|
@@map("application_mortgages")
|
|
48
|
-
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
-- CreateIndex
|
|
2
|
+
CREATE INDEX "application_direct_debits_selected_payment_day_lid_idx" ON "application_direct_debits"("selected_payment_day_lid");
|
|
3
|
+
|
|
4
|
+
-- AddForeignKey
|
|
5
|
+
ALTER TABLE "application_direct_debits" ADD CONSTRAINT "application_direct_debits_selected_payment_day_lid_fkey" FOREIGN KEY ("selected_payment_day_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
package/prisma/schema.prisma
CHANGED
|
@@ -130,63 +130,62 @@ model Lookup {
|
|
|
130
130
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
131
131
|
|
|
132
132
|
// Relations
|
|
133
|
-
group
|
|
133
|
+
group LookupGroup @relation("LookupToGroup", fields: [groupId], references: [id])
|
|
134
134
|
|
|
135
135
|
// Application Relations
|
|
136
136
|
applicationType_applications Application[] @relation("ApplicationType")
|
|
137
|
-
lendingType_applications
|
|
138
|
-
purchaseType_applications
|
|
139
|
-
status_applications
|
|
140
|
-
repaymentType_applications
|
|
141
|
-
sourceOfWealth_applications
|
|
137
|
+
lendingType_applications Application[] @relation("LendingType")
|
|
138
|
+
purchaseType_applications Application[] @relation("PurchaseType")
|
|
139
|
+
status_applications Application[] @relation("Status")
|
|
140
|
+
repaymentType_applications Application[] @relation("RepaymentType")
|
|
141
|
+
sourceOfWealth_applications Application[] @relation("SourceOfWealth")
|
|
142
142
|
|
|
143
143
|
// ApplicationDocument Relations
|
|
144
144
|
documentType_documents ApplicationDocument[] @relation("DocumentType")
|
|
145
145
|
|
|
146
146
|
// ApplicationMortgage Relations
|
|
147
|
-
repaymentType_mortgages
|
|
148
|
-
exitStrategy_mortgages
|
|
149
|
-
|
|
150
|
-
saleMade_mortgages
|
|
151
|
-
leaseType_mortgages
|
|
147
|
+
repaymentType_mortgages ApplicationMortgage[] @relation("RepaymentType")
|
|
148
|
+
exitStrategy_mortgages ApplicationMortgage[] @relation("ExitStrategy")
|
|
149
|
+
sourceofFunds_mortgages ApplicationMortgage[] @relation("SourceofFunds")
|
|
150
|
+
saleMade_mortgages ApplicationMortgage[] @relation("SaleMade")
|
|
151
|
+
leaseType_mortgages ApplicationMortgage[] @relation("LeaseType")
|
|
152
152
|
depositComeFrom_mortgages ApplicationMortgage[] @relation("DepositComeFrom")
|
|
153
153
|
proposedTenants_mortgages ApplicationMortgage[] @relation("ProposedTenants")
|
|
154
154
|
|
|
155
155
|
// ApplicationNote Relations
|
|
156
|
-
noteType_notes
|
|
156
|
+
noteType_notes ApplicationNote[] @relation("NoteType")
|
|
157
157
|
noteSubType_notes ApplicationNote[] @relation("NoteSubType")
|
|
158
158
|
|
|
159
159
|
// ApplicationProduct Relations
|
|
160
|
-
lendingType_products
|
|
161
|
-
repaymentType_products
|
|
162
|
-
financeRecommended_products
|
|
163
|
-
procFeeRate_products
|
|
164
|
-
clubNetworkName_products
|
|
160
|
+
lendingType_products ApplicationProduct[] @relation("LendingType")
|
|
161
|
+
repaymentType_products ApplicationProduct[] @relation("RepaymentType")
|
|
162
|
+
financeRecommended_products ApplicationProduct[] @relation("FinanceRecommended")
|
|
163
|
+
procFeeRate_products ApplicationProduct[] @relation("ProcFeeRate")
|
|
164
|
+
clubNetworkName_products ApplicationProduct[] @relation("ClubNetworkName")
|
|
165
165
|
productFeePaymentType_products ApplicationProduct[] @relation("ProductFeePaymentType")
|
|
166
166
|
|
|
167
167
|
// ApplicationRationale Relations
|
|
168
168
|
affordabilityStatus_rationales ApplicationRationale[] @relation("AffordabilityStatus")
|
|
169
|
-
applicantsStatus_rationales
|
|
169
|
+
applicantsStatus_rationales ApplicationRationale[] @relation("ApplicantsStatus")
|
|
170
170
|
creditConductStatus_rationales ApplicationRationale[] @relation("CreditConductStatus")
|
|
171
|
-
fraudCheckStatus_rationales
|
|
172
|
-
incomeSourceStatus_rationales
|
|
173
|
-
loanStatus_rationales
|
|
174
|
-
securityStatus_rationales
|
|
175
|
-
propertyStatus_rationales
|
|
171
|
+
fraudCheckStatus_rationales ApplicationRationale[] @relation("FraudCheckStatus")
|
|
172
|
+
incomeSourceStatus_rationales ApplicationRationale[] @relation("IncomeSourceStatus")
|
|
173
|
+
loanStatus_rationales ApplicationRationale[] @relation("LoanStatus")
|
|
174
|
+
securityStatus_rationales ApplicationRationale[] @relation("SecurityStatus")
|
|
175
|
+
propertyStatus_rationales ApplicationRationale[] @relation("PropertyStatus")
|
|
176
176
|
|
|
177
177
|
// Company Relations
|
|
178
|
-
businessType_companies
|
|
178
|
+
businessType_companies Company[] @relation("BusinessType")
|
|
179
179
|
taxJurisdiction_companies Company[] @relation("TaxJurisdiction")
|
|
180
|
-
addressCountry_companies
|
|
180
|
+
addressCountry_companies Company[] @relation("AddressCountry")
|
|
181
181
|
applicationType_companies Company[] @relation("ApplicationType")
|
|
182
182
|
|
|
183
183
|
// ResidenceCommitment Relations
|
|
184
|
-
financeTypeHpp_residenceCommitments
|
|
184
|
+
financeTypeHpp_residenceCommitments ResidenceCommitment[] @relation("FinanceTypeHpp")
|
|
185
185
|
hppRepaymentType_residenceCommitments ResidenceCommitment[] @relation("HppRepaymentType")
|
|
186
|
-
mortgageType_residenceCommitments
|
|
187
|
-
financeHomeType_residenceCommitments
|
|
188
|
-
chargeType_residenceCommitments
|
|
189
|
-
|
|
186
|
+
mortgageType_residenceCommitments ResidenceCommitment[] @relation("MortgageType")
|
|
187
|
+
financeHomeType_residenceCommitments ResidenceCommitment[] @relation("FinanceHomeType")
|
|
188
|
+
chargeType_residenceCommitments ResidenceCommitment[] @relation("ChargeType")
|
|
190
189
|
|
|
191
190
|
// ApplicantShareholding Relations
|
|
192
191
|
directorShareholder_shareholdings ApplicantShareholding[] @relation("DirectorShareholder")
|
|
@@ -199,14 +198,14 @@ model Lookup {
|
|
|
199
198
|
|
|
200
199
|
// Security Relations
|
|
201
200
|
propertyAddressCountry_securities Security[] @relation("PropertyAddressCountry")
|
|
202
|
-
propertyTenure_securities
|
|
203
|
-
propertyType_securities
|
|
201
|
+
propertyTenure_securities Security[] @relation("PropertyTenure")
|
|
202
|
+
propertyType_securities Security[] @relation("PropertyType")
|
|
204
203
|
|
|
205
204
|
// MortgageCommitment Relations
|
|
206
|
-
repaymentType_mortgageCommitments
|
|
207
|
-
mortgageType_mortgageCommitments
|
|
205
|
+
repaymentType_mortgageCommitments MortgageCommitment[] @relation("RepaymentType")
|
|
206
|
+
mortgageType_mortgageCommitments MortgageCommitment[] @relation("MortgageType")
|
|
208
207
|
commitmentType_mortgageCommitments MortgageCommitment[] @relation("CommitmentType")
|
|
209
|
-
|
|
208
|
+
|
|
210
209
|
// OtherIncome Relations
|
|
211
210
|
payFrequency1_otherIncomes ApplicantOtherIncome[] @relation("PayFrequency1")
|
|
212
211
|
payFrequency2_otherIncomes ApplicantOtherIncome[] @relation("PayFrequency2")
|
|
@@ -214,51 +213,55 @@ model Lookup {
|
|
|
214
213
|
payFrequency4_otherIncomes ApplicantOtherIncome[] @relation("PayFrequency4")
|
|
215
214
|
|
|
216
215
|
// Income Relations
|
|
217
|
-
accountantsCountry_incomes
|
|
218
|
-
businessCountry_incomes
|
|
219
|
-
businessType_incomes
|
|
216
|
+
accountantsCountry_incomes ApplicantIncome[] @relation("AccountantsCountry")
|
|
217
|
+
businessCountry_incomes ApplicantIncome[] @relation("BusinessCountry")
|
|
218
|
+
businessType_incomes ApplicantIncome[] @relation("BusinessType")
|
|
220
219
|
charteredCertifiedOrOther_incomes ApplicantIncome[] @relation("CharteredCertifiedOrOther")
|
|
221
|
-
registeredCountry_incomes
|
|
220
|
+
registeredCountry_incomes ApplicantIncome[] @relation("RegisteredCountry")
|
|
222
221
|
|
|
223
222
|
// LoanCommitment Relations
|
|
224
223
|
commitmentType_loanCommitments LoanCommitment[] @relation("CommitmentType")
|
|
225
|
-
loanType_loanCommitments
|
|
224
|
+
loanType_loanCommitments LoanCommitment[] @relation("LoanType")
|
|
226
225
|
|
|
227
226
|
// Applicant Relations
|
|
228
|
-
addressCountry_applicants
|
|
227
|
+
addressCountry_applicants Applicant[] @relation("AddressCountry")
|
|
229
228
|
correspondenceAddressCountry_applicants Applicant[] @relation("CorrespondenceAddressCountry")
|
|
230
|
-
countryOfResidence_applicants
|
|
231
|
-
class_applicants
|
|
232
|
-
linkedJurisdictionCountry_applicants
|
|
233
|
-
maritalStatus_applicants
|
|
234
|
-
nationality_applicants
|
|
235
|
-
previous1AddressCountry_applicants
|
|
236
|
-
previous2AddressCountry_applicants
|
|
237
|
-
residentialStatus_applicants
|
|
238
|
-
taxJurisdiction_applicants
|
|
239
|
-
taxPayer_applicants
|
|
240
|
-
ukPassportProfession_applicants
|
|
241
|
-
vulnerabilityTypes_applicants
|
|
229
|
+
countryOfResidence_applicants Applicant[] @relation("CountryOfResidence")
|
|
230
|
+
class_applicants Applicant[] @relation("Class")
|
|
231
|
+
linkedJurisdictionCountry_applicants Applicant[] @relation("LinkedJurisdictionCountry")
|
|
232
|
+
maritalStatus_applicants Applicant[] @relation("MaritalStatus")
|
|
233
|
+
nationality_applicants Applicant[] @relation("Nationality")
|
|
234
|
+
previous1AddressCountry_applicants Applicant[] @relation("Previous1AddressCountry")
|
|
235
|
+
previous2AddressCountry_applicants Applicant[] @relation("Previous2AddressCountry")
|
|
236
|
+
residentialStatus_applicants Applicant[] @relation("ResidentialStatus")
|
|
237
|
+
taxJurisdiction_applicants Applicant[] @relation("TaxJurisdiction")
|
|
238
|
+
taxPayer_applicants Applicant[] @relation("TaxPayer")
|
|
239
|
+
ukPassportProfession_applicants Applicant[] @relation("UkPassportProfession")
|
|
240
|
+
vulnerabilityTypes_applicants Applicant[] @relation("VulnerabilityTypes")
|
|
242
241
|
|
|
243
242
|
// Employment Relations
|
|
244
|
-
addressCountry_employments
|
|
245
|
-
industry_employments
|
|
246
|
-
jobTitle_employments
|
|
243
|
+
addressCountry_employments ApplicantEmployment[] @relation("AddressCountry")
|
|
244
|
+
industry_employments ApplicantEmployment[] @relation("Industry")
|
|
245
|
+
jobTitle_employments ApplicantEmployment[] @relation("JobTitle")
|
|
247
246
|
acceptableIncomeTypes_employments ApplicantEmployment[] @relation("AcceptableIncomeTypes")
|
|
248
247
|
|
|
249
248
|
// CreditCardCommitment Relations
|
|
250
249
|
commitmentType_creditCardCommitments CreditCardCommitment[] @relation("CommitmentType")
|
|
251
|
-
repaymentType_creditCardCommitments
|
|
252
|
-
|
|
253
|
-
creditDataStatus
|
|
254
|
-
incomeSourceEmploymentStatus ApplicantIncomeSource[]
|
|
255
|
-
applicantEmploymentIncome
|
|
256
|
-
applicantExpenditure
|
|
250
|
+
repaymentType_creditCardCommitments CreditCardCommitment[] @relation("CreditCardRepaymentType")
|
|
251
|
+
|
|
252
|
+
creditDataStatus ApplicantCreditData[] @relation("CreditDataStatus")
|
|
253
|
+
incomeSourceEmploymentStatus ApplicantIncomeSource[] @relation("IncomeSourceEmploymentStatus")
|
|
254
|
+
applicantEmploymentIncome ApplicantEmploymentIncome[] @relation("ApplicantEmploymentIncomeType")
|
|
255
|
+
applicantExpenditure ApplicantExpenditure[] @relation("ExpenditureType")
|
|
257
256
|
|
|
257
|
+
// ApprivoSyncJourney Relations
|
|
258
258
|
apprivoSyncJourneys ApprivoSyncJourney[] @relation("ApprivoSyncJourney")
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
// DirectDebit Relations
|
|
261
|
+
selectedPaymentDay ApplicationDirectDebit[] @relation("PaymentDay")
|
|
262
|
+
|
|
261
263
|
@@unique([groupId, value])
|
|
264
|
+
@@map("lookups")
|
|
262
265
|
}
|
|
263
266
|
|
|
264
267
|
// From prisma/shared/system-parameter.prisma
|
|
@@ -1145,6 +1148,10 @@ model ApplicationDirectDebit {
|
|
|
1145
1148
|
// Relations
|
|
1146
1149
|
application Application @relation("ApplicationDirectDebit", fields: [applicationId], references: [id])
|
|
1147
1150
|
|
|
1151
|
+
// Lookup relations
|
|
1152
|
+
applicationType Lookup @relation("PaymentDay", fields: [selectedPaymentDayLid], references: [id])
|
|
1153
|
+
|
|
1154
|
+
@@index([selectedPaymentDayLid])
|
|
1148
1155
|
@@map("application_direct_debits")
|
|
1149
1156
|
}
|
|
1150
1157
|
|
|
@@ -1216,22 +1223,21 @@ model ApplicationMortgage {
|
|
|
1216
1223
|
applicationId String @unique @map("application_id")
|
|
1217
1224
|
pageValidFlag Boolean @default(false) @map("page_valid_flag")
|
|
1218
1225
|
existingMortgageLender String? @map("existing_mortgage_lender") @db.VarChar(35)
|
|
1219
|
-
topSlicing Boolean @default(false) @map("top_slicing")
|
|
1220
1226
|
purposeOfMortgage String @map("purpose_of_mortgage") @db.VarChar(50)
|
|
1221
1227
|
depositComeFromLids String[] @map("deposit_come_from_lids")
|
|
1222
1228
|
ifOtherDetails String @map("if_other_details") @db.VarChar(50)
|
|
1223
|
-
purchasePrice Decimal @map("purchase_price")
|
|
1229
|
+
purchasePrice Decimal @map("purchase_price")
|
|
1224
1230
|
repaymentTypeLid String @map("repayment_type_lid")
|
|
1225
1231
|
exitStrategyLid String @map("exit_strategy_lid")
|
|
1226
1232
|
isCapitalRaise Boolean @default(false) @map("is_capital_raise")
|
|
1227
1233
|
purchaseDate String @map("purchase_date") @db.VarChar(10)
|
|
1228
|
-
estimatedValue Decimal @map("estimated_value")
|
|
1229
|
-
loanRequired Decimal @map("loan_required")
|
|
1230
|
-
monthlyRentalIncome Decimal @map("monthly_rental_income")
|
|
1231
|
-
outstandingBalance Decimal @map("outstanding_balance")
|
|
1234
|
+
estimatedValue Decimal @map("estimated_value")
|
|
1235
|
+
loanRequired Decimal @map("loan_required")
|
|
1236
|
+
monthlyRentalIncome Decimal @map("monthly_rental_income")
|
|
1237
|
+
outstandingBalance Decimal @map("outstanding_balance")
|
|
1232
1238
|
fundRaisedFor String @map("fund_raised_for") @db.VarChar(250)
|
|
1233
|
-
|
|
1234
|
-
|
|
1239
|
+
sourceofFundsLid String @map("source_of_funds_lid")
|
|
1240
|
+
sourceofFundDetails String @map("source_of_fund_details") @db.VarChar(50)
|
|
1235
1241
|
propertyValuationDetails String @map("property_valuation_details") @db.VarChar(35)
|
|
1236
1242
|
telephoneNumber String @map("telephone_number") @db.VarChar(15)
|
|
1237
1243
|
isDistressedSale Boolean @default(false) @map("is_distressed_sale")
|
|
@@ -1251,7 +1257,7 @@ model ApplicationMortgage {
|
|
|
1251
1257
|
application Application @relation("ApplicationMortgage", fields: [applicationId], references: [id])
|
|
1252
1258
|
repaymentType Lookup @relation("RepaymentType", fields: [repaymentTypeLid], references: [id])
|
|
1253
1259
|
exitStrategy Lookup @relation("ExitStrategy", fields: [exitStrategyLid], references: [id])
|
|
1254
|
-
|
|
1260
|
+
sourceofFunds Lookup @relation("SourceofFunds", fields: [sourceofFundsLid], references: [id])
|
|
1255
1261
|
saleMade Lookup? @relation("SaleMade", fields: [saleMadeLid], references: [id])
|
|
1256
1262
|
leaseType Lookup @relation("LeaseType", fields: [leaseTypeLid], references: [id])
|
|
1257
1263
|
depositComeFrom Lookup[] @relation("DepositComeFrom")
|
|
@@ -9,63 +9,62 @@ model Lookup {
|
|
|
9
9
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
10
10
|
|
|
11
11
|
// Relations
|
|
12
|
-
group
|
|
12
|
+
group LookupGroup @relation("LookupToGroup", fields: [groupId], references: [id])
|
|
13
13
|
|
|
14
14
|
// Application Relations
|
|
15
15
|
applicationType_applications Application[] @relation("ApplicationType")
|
|
16
|
-
lendingType_applications
|
|
17
|
-
purchaseType_applications
|
|
18
|
-
status_applications
|
|
19
|
-
repaymentType_applications
|
|
20
|
-
sourceOfWealth_applications
|
|
16
|
+
lendingType_applications Application[] @relation("LendingType")
|
|
17
|
+
purchaseType_applications Application[] @relation("PurchaseType")
|
|
18
|
+
status_applications Application[] @relation("Status")
|
|
19
|
+
repaymentType_applications Application[] @relation("RepaymentType")
|
|
20
|
+
sourceOfWealth_applications Application[] @relation("SourceOfWealth")
|
|
21
21
|
|
|
22
22
|
// ApplicationDocument Relations
|
|
23
23
|
documentType_documents ApplicationDocument[] @relation("DocumentType")
|
|
24
24
|
|
|
25
25
|
// ApplicationMortgage Relations
|
|
26
|
-
repaymentType_mortgages
|
|
27
|
-
exitStrategy_mortgages
|
|
28
|
-
|
|
29
|
-
saleMade_mortgages
|
|
30
|
-
leaseType_mortgages
|
|
26
|
+
repaymentType_mortgages ApplicationMortgage[] @relation("RepaymentType")
|
|
27
|
+
exitStrategy_mortgages ApplicationMortgage[] @relation("ExitStrategy")
|
|
28
|
+
sourceofFunds_mortgages ApplicationMortgage[] @relation("SourceofFunds")
|
|
29
|
+
saleMade_mortgages ApplicationMortgage[] @relation("SaleMade")
|
|
30
|
+
leaseType_mortgages ApplicationMortgage[] @relation("LeaseType")
|
|
31
31
|
depositComeFrom_mortgages ApplicationMortgage[] @relation("DepositComeFrom")
|
|
32
32
|
proposedTenants_mortgages ApplicationMortgage[] @relation("ProposedTenants")
|
|
33
33
|
|
|
34
34
|
// ApplicationNote Relations
|
|
35
|
-
noteType_notes
|
|
35
|
+
noteType_notes ApplicationNote[] @relation("NoteType")
|
|
36
36
|
noteSubType_notes ApplicationNote[] @relation("NoteSubType")
|
|
37
37
|
|
|
38
38
|
// ApplicationProduct Relations
|
|
39
|
-
lendingType_products
|
|
40
|
-
repaymentType_products
|
|
41
|
-
financeRecommended_products
|
|
42
|
-
procFeeRate_products
|
|
43
|
-
clubNetworkName_products
|
|
39
|
+
lendingType_products ApplicationProduct[] @relation("LendingType")
|
|
40
|
+
repaymentType_products ApplicationProduct[] @relation("RepaymentType")
|
|
41
|
+
financeRecommended_products ApplicationProduct[] @relation("FinanceRecommended")
|
|
42
|
+
procFeeRate_products ApplicationProduct[] @relation("ProcFeeRate")
|
|
43
|
+
clubNetworkName_products ApplicationProduct[] @relation("ClubNetworkName")
|
|
44
44
|
productFeePaymentType_products ApplicationProduct[] @relation("ProductFeePaymentType")
|
|
45
45
|
|
|
46
46
|
// ApplicationRationale Relations
|
|
47
47
|
affordabilityStatus_rationales ApplicationRationale[] @relation("AffordabilityStatus")
|
|
48
|
-
applicantsStatus_rationales
|
|
48
|
+
applicantsStatus_rationales ApplicationRationale[] @relation("ApplicantsStatus")
|
|
49
49
|
creditConductStatus_rationales ApplicationRationale[] @relation("CreditConductStatus")
|
|
50
|
-
fraudCheckStatus_rationales
|
|
51
|
-
incomeSourceStatus_rationales
|
|
52
|
-
loanStatus_rationales
|
|
53
|
-
securityStatus_rationales
|
|
54
|
-
propertyStatus_rationales
|
|
50
|
+
fraudCheckStatus_rationales ApplicationRationale[] @relation("FraudCheckStatus")
|
|
51
|
+
incomeSourceStatus_rationales ApplicationRationale[] @relation("IncomeSourceStatus")
|
|
52
|
+
loanStatus_rationales ApplicationRationale[] @relation("LoanStatus")
|
|
53
|
+
securityStatus_rationales ApplicationRationale[] @relation("SecurityStatus")
|
|
54
|
+
propertyStatus_rationales ApplicationRationale[] @relation("PropertyStatus")
|
|
55
55
|
|
|
56
56
|
// Company Relations
|
|
57
|
-
businessType_companies
|
|
57
|
+
businessType_companies Company[] @relation("BusinessType")
|
|
58
58
|
taxJurisdiction_companies Company[] @relation("TaxJurisdiction")
|
|
59
|
-
addressCountry_companies
|
|
59
|
+
addressCountry_companies Company[] @relation("AddressCountry")
|
|
60
60
|
applicationType_companies Company[] @relation("ApplicationType")
|
|
61
61
|
|
|
62
62
|
// ResidenceCommitment Relations
|
|
63
|
-
financeTypeHpp_residenceCommitments
|
|
63
|
+
financeTypeHpp_residenceCommitments ResidenceCommitment[] @relation("FinanceTypeHpp")
|
|
64
64
|
hppRepaymentType_residenceCommitments ResidenceCommitment[] @relation("HppRepaymentType")
|
|
65
|
-
mortgageType_residenceCommitments
|
|
66
|
-
financeHomeType_residenceCommitments
|
|
67
|
-
chargeType_residenceCommitments
|
|
68
|
-
|
|
65
|
+
mortgageType_residenceCommitments ResidenceCommitment[] @relation("MortgageType")
|
|
66
|
+
financeHomeType_residenceCommitments ResidenceCommitment[] @relation("FinanceHomeType")
|
|
67
|
+
chargeType_residenceCommitments ResidenceCommitment[] @relation("ChargeType")
|
|
69
68
|
|
|
70
69
|
// ApplicantShareholding Relations
|
|
71
70
|
directorShareholder_shareholdings ApplicantShareholding[] @relation("DirectorShareholder")
|
|
@@ -78,14 +77,14 @@ model Lookup {
|
|
|
78
77
|
|
|
79
78
|
// Security Relations
|
|
80
79
|
propertyAddressCountry_securities Security[] @relation("PropertyAddressCountry")
|
|
81
|
-
propertyTenure_securities
|
|
82
|
-
propertyType_securities
|
|
80
|
+
propertyTenure_securities Security[] @relation("PropertyTenure")
|
|
81
|
+
propertyType_securities Security[] @relation("PropertyType")
|
|
83
82
|
|
|
84
83
|
// MortgageCommitment Relations
|
|
85
|
-
repaymentType_mortgageCommitments
|
|
86
|
-
mortgageType_mortgageCommitments
|
|
84
|
+
repaymentType_mortgageCommitments MortgageCommitment[] @relation("RepaymentType")
|
|
85
|
+
mortgageType_mortgageCommitments MortgageCommitment[] @relation("MortgageType")
|
|
87
86
|
commitmentType_mortgageCommitments MortgageCommitment[] @relation("CommitmentType")
|
|
88
|
-
|
|
87
|
+
|
|
89
88
|
// OtherIncome Relations
|
|
90
89
|
payFrequency1_otherIncomes ApplicantOtherIncome[] @relation("PayFrequency1")
|
|
91
90
|
payFrequency2_otherIncomes ApplicantOtherIncome[] @relation("PayFrequency2")
|
|
@@ -93,49 +92,53 @@ model Lookup {
|
|
|
93
92
|
payFrequency4_otherIncomes ApplicantOtherIncome[] @relation("PayFrequency4")
|
|
94
93
|
|
|
95
94
|
// Income Relations
|
|
96
|
-
accountantsCountry_incomes
|
|
97
|
-
businessCountry_incomes
|
|
98
|
-
businessType_incomes
|
|
95
|
+
accountantsCountry_incomes ApplicantIncome[] @relation("AccountantsCountry")
|
|
96
|
+
businessCountry_incomes ApplicantIncome[] @relation("BusinessCountry")
|
|
97
|
+
businessType_incomes ApplicantIncome[] @relation("BusinessType")
|
|
99
98
|
charteredCertifiedOrOther_incomes ApplicantIncome[] @relation("CharteredCertifiedOrOther")
|
|
100
|
-
registeredCountry_incomes
|
|
99
|
+
registeredCountry_incomes ApplicantIncome[] @relation("RegisteredCountry")
|
|
101
100
|
|
|
102
101
|
// LoanCommitment Relations
|
|
103
102
|
commitmentType_loanCommitments LoanCommitment[] @relation("CommitmentType")
|
|
104
|
-
loanType_loanCommitments
|
|
103
|
+
loanType_loanCommitments LoanCommitment[] @relation("LoanType")
|
|
105
104
|
|
|
106
105
|
// Applicant Relations
|
|
107
|
-
addressCountry_applicants
|
|
106
|
+
addressCountry_applicants Applicant[] @relation("AddressCountry")
|
|
108
107
|
correspondenceAddressCountry_applicants Applicant[] @relation("CorrespondenceAddressCountry")
|
|
109
|
-
countryOfResidence_applicants
|
|
110
|
-
class_applicants
|
|
111
|
-
linkedJurisdictionCountry_applicants
|
|
112
|
-
maritalStatus_applicants
|
|
113
|
-
nationality_applicants
|
|
114
|
-
previous1AddressCountry_applicants
|
|
115
|
-
previous2AddressCountry_applicants
|
|
116
|
-
residentialStatus_applicants
|
|
117
|
-
taxJurisdiction_applicants
|
|
118
|
-
taxPayer_applicants
|
|
119
|
-
ukPassportProfession_applicants
|
|
120
|
-
vulnerabilityTypes_applicants
|
|
108
|
+
countryOfResidence_applicants Applicant[] @relation("CountryOfResidence")
|
|
109
|
+
class_applicants Applicant[] @relation("Class")
|
|
110
|
+
linkedJurisdictionCountry_applicants Applicant[] @relation("LinkedJurisdictionCountry")
|
|
111
|
+
maritalStatus_applicants Applicant[] @relation("MaritalStatus")
|
|
112
|
+
nationality_applicants Applicant[] @relation("Nationality")
|
|
113
|
+
previous1AddressCountry_applicants Applicant[] @relation("Previous1AddressCountry")
|
|
114
|
+
previous2AddressCountry_applicants Applicant[] @relation("Previous2AddressCountry")
|
|
115
|
+
residentialStatus_applicants Applicant[] @relation("ResidentialStatus")
|
|
116
|
+
taxJurisdiction_applicants Applicant[] @relation("TaxJurisdiction")
|
|
117
|
+
taxPayer_applicants Applicant[] @relation("TaxPayer")
|
|
118
|
+
ukPassportProfession_applicants Applicant[] @relation("UkPassportProfession")
|
|
119
|
+
vulnerabilityTypes_applicants Applicant[] @relation("VulnerabilityTypes")
|
|
121
120
|
|
|
122
121
|
// Employment Relations
|
|
123
|
-
addressCountry_employments
|
|
124
|
-
industry_employments
|
|
125
|
-
jobTitle_employments
|
|
122
|
+
addressCountry_employments ApplicantEmployment[] @relation("AddressCountry")
|
|
123
|
+
industry_employments ApplicantEmployment[] @relation("Industry")
|
|
124
|
+
jobTitle_employments ApplicantEmployment[] @relation("JobTitle")
|
|
126
125
|
acceptableIncomeTypes_employments ApplicantEmployment[] @relation("AcceptableIncomeTypes")
|
|
127
126
|
|
|
128
127
|
// CreditCardCommitment Relations
|
|
129
128
|
commitmentType_creditCardCommitments CreditCardCommitment[] @relation("CommitmentType")
|
|
130
|
-
repaymentType_creditCardCommitments
|
|
131
|
-
|
|
132
|
-
creditDataStatus
|
|
133
|
-
incomeSourceEmploymentStatus ApplicantIncomeSource[]
|
|
134
|
-
applicantEmploymentIncome
|
|
135
|
-
applicantExpenditure
|
|
129
|
+
repaymentType_creditCardCommitments CreditCardCommitment[] @relation("CreditCardRepaymentType")
|
|
130
|
+
|
|
131
|
+
creditDataStatus ApplicantCreditData[] @relation("CreditDataStatus")
|
|
132
|
+
incomeSourceEmploymentStatus ApplicantIncomeSource[] @relation("IncomeSourceEmploymentStatus")
|
|
133
|
+
applicantEmploymentIncome ApplicantEmploymentIncome[] @relation("ApplicantEmploymentIncomeType")
|
|
134
|
+
applicantExpenditure ApplicantExpenditure[] @relation("ExpenditureType")
|
|
136
135
|
|
|
136
|
+
// ApprivoSyncJourney Relations
|
|
137
137
|
apprivoSyncJourneys ApprivoSyncJourney[] @relation("ApprivoSyncJourney")
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
// DirectDebit Relations
|
|
140
|
+
selectedPaymentDay ApplicationDirectDebit[] @relation("PaymentDay")
|
|
141
|
+
|
|
140
142
|
@@unique([groupId, value])
|
|
141
|
-
|
|
143
|
+
@@map("lookups")
|
|
144
|
+
}
|