@dynamatix/gb-schemas 2.0.0 → 2.0.1
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-rationale.entity.ts +1 -1
- package/entities/applications/company.entity.ts +1 -2
- package/entities/applications/solicitor.entity.ts +1 -1
- package/entities/properties/property.entity.ts +1 -1
- package/package.json +1 -1
- package/prisma/applicants/applicant.prisma +10 -5
- package/prisma/applicants/credit-card-commitment.prisma +1 -1
- package/prisma/applicants/credit-data.prisma +1 -1
- package/prisma/applicants/credit-profile.prisma +1 -1
- package/prisma/applicants/direct-debit.prisma +2 -1
- package/prisma/applicants/income-source.prisma +1 -1
- package/prisma/applicants/income.prisma +3 -2
- package/prisma/applicants/loan-commitment.prisma +2 -1
- package/prisma/applicants/mortgage-commitment.prisma +7 -6
- package/prisma/applicants/property-income.prisma +17 -14
- package/prisma/applicants/residence-commitment.prisma +7 -6
- package/prisma/applicants/secured-loan-commitment.prisma +1 -1
- package/prisma/applicants/unsecured-loan-commitment.prisma +1 -1
- package/prisma/applications/application-company.prisma +7 -5
- package/prisma/applications/application-direct-debit.prisma +7 -5
- package/prisma/applications/application-mortgage.prisma +1 -1
- package/prisma/applications/application-product.prisma +1 -1
- package/prisma/applications/application-rationale.prisma +1 -1
- package/prisma/applications/application.prisma +28 -12
- package/prisma/applications/broker.prisma +4 -0
- package/prisma/applications/company.prisma +7 -7
- package/prisma/broker.entity.ts +8 -0
- package/prisma/lookup.entity.ts +9 -0
- package/prisma/migrations/{20250430085825_initial_migration → 20250430124915_initial_migration}/migration.sql +69 -42
- package/prisma/properties/property.prisma +1 -1
- package/prisma/schema.prisma +215 -198
- package/prisma/shared/alert.prisma +1 -1
- package/prisma/shared/lookup.prisma +4 -0
- package/prisma/underwriter/underwriter.prisma +2 -2
- package/prisma/users/user.prisma +2 -2
package/prisma/schema.prisma
CHANGED
|
@@ -22,7 +22,7 @@ model Alert {
|
|
|
22
22
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
23
23
|
|
|
24
24
|
// Relations
|
|
25
|
-
user User @relation(fields: [userId], references: [id])
|
|
25
|
+
user User @relation("UserAlerts", fields: [userId], references: [id])
|
|
26
26
|
|
|
27
27
|
@@map("alerts")
|
|
28
28
|
}
|
|
@@ -242,8 +242,9 @@ model Lookup {
|
|
|
242
242
|
// CreditCardCommitment Relations
|
|
243
243
|
commitmentType_creditCardCommitments CreditCardCommitment[] @relation("CommitmentType")
|
|
244
244
|
repaymentType_creditCardCommitments CreditCardCommitment[] @relation("CreditCardRepaymentType")
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
|
|
246
|
+
creditDataStatus CreditData[] @relation("CreditDataStatus")
|
|
247
|
+
incomeSourceEmploymentStatus IncomeSource[] @relation("IncomeSourceEmploymentStatus")
|
|
247
248
|
|
|
248
249
|
@@unique([groupId, value])
|
|
249
250
|
@@map("lookups")
|
|
@@ -353,8 +354,8 @@ model User {
|
|
|
353
354
|
updatedSystemParameters SystemParameter[] @relation("UpdatedByUser")
|
|
354
355
|
createdNotes ApplicationNote[] @relation("CreatedByUser")
|
|
355
356
|
assignedNotes ApplicationNote[] @relation("AssignedByUser")
|
|
356
|
-
alerts Alert[]
|
|
357
|
-
underwriters Underwriter[]
|
|
357
|
+
alerts Alert[] @relation("UserAlerts")
|
|
358
|
+
underwriters Underwriter[] @relation("UserUnderwriters")
|
|
358
359
|
|
|
359
360
|
@@map("users")
|
|
360
361
|
}
|
|
@@ -563,43 +564,38 @@ model Applicant {
|
|
|
563
564
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
564
565
|
|
|
565
566
|
// Relations
|
|
566
|
-
application Application
|
|
567
|
-
addressCountry Lookup?
|
|
568
|
-
correspondenceAddressCountry Lookup?
|
|
569
|
-
countryOfResidence Lookup
|
|
570
|
-
class Lookup?
|
|
571
|
-
linkedJurisdictionCountry Lookup?
|
|
572
|
-
maritalStatus Lookup
|
|
573
|
-
nationality Lookup
|
|
574
|
-
previous1AddressCountry Lookup?
|
|
575
|
-
previous2AddressCountry Lookup?
|
|
576
|
-
residentialStatus Lookup?
|
|
577
|
-
taxJurisdiction Lookup
|
|
578
|
-
taxPayer Lookup
|
|
579
|
-
ukPassportProfession Lookup?
|
|
580
|
-
vulnerabilityTypes Lookup[]
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
MortgageCommitment MortgageCommitment[]
|
|
599
|
-
ResidenceCommitment ResidenceCommitment[]
|
|
600
|
-
SecuredLoanCommitment SecuredLoanCommitment[]
|
|
601
|
-
UnsecuredLoanCommitment UnsecuredLoanCommitment[]
|
|
602
|
-
ApplicantShareholding ApplicantShareholding[]
|
|
567
|
+
application Application @relation(fields: [applicationId], references: [id])
|
|
568
|
+
addressCountry Lookup? @relation("AddressCountry", fields: [addressCountryLid], references: [id])
|
|
569
|
+
correspondenceAddressCountry Lookup? @relation("CorrespondenceAddressCountry", fields: [correspondenceAddressCountryLid], references: [id])
|
|
570
|
+
countryOfResidence Lookup @relation("CountryOfResidence", fields: [countryOfResidenceLid], references: [id])
|
|
571
|
+
class Lookup? @relation("Class", fields: [classLid], references: [id])
|
|
572
|
+
linkedJurisdictionCountry Lookup? @relation("LinkedJurisdictionCountry", fields: [linkedJurisdictionCountryLid], references: [id])
|
|
573
|
+
maritalStatus Lookup @relation("MaritalStatus", fields: [maritalStatusLid], references: [id])
|
|
574
|
+
nationality Lookup @relation("Nationality", fields: [nationalityLid], references: [id])
|
|
575
|
+
previous1AddressCountry Lookup? @relation("Previous1AddressCountry", fields: [previous1AddressCountryLid], references: [id])
|
|
576
|
+
previous2AddressCountry Lookup? @relation("Previous2AddressCountry", fields: [previous2AddressCountryLid], references: [id])
|
|
577
|
+
residentialStatus Lookup? @relation("ResidentialStatus", fields: [residentialStatusLid], references: [id])
|
|
578
|
+
taxJurisdiction Lookup @relation("TaxJurisdiction", fields: [taxJurisdictionLid], references: [id])
|
|
579
|
+
taxPayer Lookup @relation("TaxPayer", fields: [taxPayerLid], references: [id])
|
|
580
|
+
ukPassportProfession Lookup? @relation("UkPassportProfession", fields: [ukPassportProfessionLid], references: [id])
|
|
581
|
+
vulnerabilityTypes Lookup[] @relation("VulnerabilityTypes")
|
|
582
|
+
creditData CreditData?
|
|
583
|
+
riskNarrative RiskNarrative?
|
|
584
|
+
otherIncome OtherIncome?
|
|
585
|
+
incomeSource IncomeSource?
|
|
586
|
+
expenditure Expenditure?
|
|
587
|
+
employment Employment?
|
|
588
|
+
directDebit DirectDebit?
|
|
589
|
+
creditProfile CreditProfile? @relation("ApplicantCreditProfile", fields: [id], references: [id], map: "applicant_credit_profile_fkey")
|
|
590
|
+
propertyIncome PropertyIncome? @relation("ApplicantPropertyIncome", fields: [id], references: [id], map: "applicant_property_income_fkey")
|
|
591
|
+
income Income? @relation("ApplicantIncome", fields: [id], references: [id], map: "applicant_income_fkey")
|
|
592
|
+
creditCardCommitments CreditCardCommitment[] @relation("ApplicantCreditCardCommitments")
|
|
593
|
+
loanCommitments LoanCommitment[] @relation("ApplicantLoanCommitments")
|
|
594
|
+
mortgageCommitments MortgageCommitment[] @relation("ApplicantMortgageCommitments")
|
|
595
|
+
residenceCommitments ResidenceCommitment[] @relation("ApplicantResidenceCommitments")
|
|
596
|
+
securedLoanCommitments SecuredLoanCommitment[] @relation("ApplicantSecuredLoanCommitments")
|
|
597
|
+
unsecuredLoanCommitments UnsecuredLoanCommitment[] @relation("ApplicantUnsecuredLoanCommitments")
|
|
598
|
+
shareholdings ApplicantShareholding[] @relation("ApplicantShareholdings")
|
|
603
599
|
|
|
604
600
|
@@map("applicants")
|
|
605
601
|
}
|
|
@@ -620,7 +616,7 @@ model CreditCardCommitment {
|
|
|
620
616
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
621
617
|
|
|
622
618
|
// Relations
|
|
623
|
-
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
619
|
+
applicant Applicant @relation("ApplicantCreditCardCommitments", fields: [applicantId], references: [id])
|
|
624
620
|
commitmentType Lookup? @relation("CommitmentType", fields: [commitmentTypeLid], references: [id])
|
|
625
621
|
repaymentType Lookup @relation("CreditCardRepaymentType", fields: [creditCardRepaymentTypeLid], references: [id])
|
|
626
622
|
|
|
@@ -643,7 +639,7 @@ model CreditData {
|
|
|
643
639
|
|
|
644
640
|
// Relations
|
|
645
641
|
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
646
|
-
status Lookup @relation(fields: [statusLid], references: [id])
|
|
642
|
+
status Lookup @relation("CreditDataStatus", fields: [statusLid], references: [id])
|
|
647
643
|
|
|
648
644
|
@@map("applicant_credit_data")
|
|
649
645
|
}
|
|
@@ -659,7 +655,7 @@ model CreditProfile {
|
|
|
659
655
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
660
656
|
|
|
661
657
|
// Relations
|
|
662
|
-
applicants Applicant[]
|
|
658
|
+
applicants Applicant[] @relation("ApplicantCreditProfile")
|
|
663
659
|
|
|
664
660
|
@@map("applicant_credit_profiles")
|
|
665
661
|
}
|
|
@@ -680,13 +676,14 @@ model DirectDebit {
|
|
|
680
676
|
nameOfAccountHolder String?
|
|
681
677
|
selectedPaymentDay String?
|
|
682
678
|
sortCode String?
|
|
679
|
+
telephone String?
|
|
683
680
|
applicantId String @unique @map("applicant_id")
|
|
684
681
|
createdAt DateTime @default(now()) @map("created_at")
|
|
685
682
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
686
683
|
|
|
687
684
|
// Relations
|
|
688
685
|
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
689
|
-
application Application @relation(fields: [applicationId], references: [id])
|
|
686
|
+
application Application @relation("ApplicationDirectDebits", fields: [applicationId], references: [id])
|
|
690
687
|
|
|
691
688
|
@@map("applicant_direct_debit")
|
|
692
689
|
}
|
|
@@ -794,7 +791,7 @@ model IncomeSource {
|
|
|
794
791
|
|
|
795
792
|
// Relations
|
|
796
793
|
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
797
|
-
employmentStatus Lookup? @relation(fields: [employmentStatusLid], references: [id])
|
|
794
|
+
employmentStatus Lookup? @relation("IncomeSourceEmploymentStatus", fields: [employmentStatusLid], references: [id])
|
|
798
795
|
|
|
799
796
|
@@map("applicant_income_source")
|
|
800
797
|
}
|
|
@@ -830,7 +827,7 @@ model Income {
|
|
|
830
827
|
netAssets1 Decimal @default(0.00) @map("net_assets1")
|
|
831
828
|
netAssets2 Decimal @default(0.00) @map("net_assets2")
|
|
832
829
|
netAssets3 Decimal @default(0.00) @map("net_assets3")
|
|
833
|
-
pageValidFlag Boolean @default(
|
|
830
|
+
pageValidFlag Boolean @default(false) @map("page_valid_flag")
|
|
834
831
|
percentageOfShareholding Int @map("percentage_of_shareholding")
|
|
835
832
|
registeredAddressLine1 String @map("registered_address_line1")
|
|
836
833
|
registeredAddressLine2 String @map("registered_address_line2")
|
|
@@ -858,9 +855,9 @@ model Income {
|
|
|
858
855
|
businessType Lookup @relation("BusinessType", fields: [businessTypeLid], references: [id])
|
|
859
856
|
charteredCertifiedOrOther Lookup @relation("CharteredCertifiedOrOther", fields: [charteredCertifiedOrOtherLid], references: [id])
|
|
860
857
|
registeredCountry Lookup @relation("RegisteredCountry", fields: [registeredCountryLid], references: [id])
|
|
861
|
-
Applicant
|
|
858
|
+
applicants Applicant[] @relation("ApplicantIncome")
|
|
862
859
|
|
|
863
|
-
@@map("
|
|
860
|
+
@@map("applicant_income")
|
|
864
861
|
}
|
|
865
862
|
|
|
866
863
|
// From prisma/applicants/loan-commitment.prisma
|
|
@@ -879,11 +876,12 @@ model LoanCommitment {
|
|
|
879
876
|
startDate String @map("start_date")
|
|
880
877
|
outstandingBalance Decimal @map("outstanding_balance")
|
|
881
878
|
monthlyPayment Decimal @map("monthly_payment")
|
|
879
|
+
jointNames Boolean @map("joint_names")
|
|
882
880
|
createdAt DateTime @default(now()) @map("created_at")
|
|
883
881
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
884
882
|
|
|
885
883
|
// Relations
|
|
886
|
-
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
884
|
+
applicant Applicant @relation("ApplicantLoanCommitments", fields: [applicantId], references: [id])
|
|
887
885
|
commitmentType Lookup? @relation("CommitmentType", fields: [commitmentTypeLid], references: [id])
|
|
888
886
|
loanType Lookup @relation("LoanType", fields: [loanTypeLid], references: [id])
|
|
889
887
|
|
|
@@ -894,16 +892,16 @@ model LoanCommitment {
|
|
|
894
892
|
model MortgageCommitment {
|
|
895
893
|
id String @id @default(uuid())
|
|
896
894
|
applicantId String @map("applicant_id")
|
|
897
|
-
lenderName String
|
|
898
|
-
propertyValue Decimal
|
|
895
|
+
lenderName String @map("lender_name")
|
|
896
|
+
propertyValue Decimal @map("property_value")
|
|
899
897
|
repaymentTypeLid String @map("repayment_type_lid")
|
|
900
898
|
mortgageTypeLid String? @map("mortgage_type_lid")
|
|
901
899
|
fixedTerm String
|
|
902
900
|
originalLoanAmount Decimal
|
|
903
|
-
outstandingBalance Decimal
|
|
901
|
+
outstandingBalance Decimal @map("outstanding_balance")
|
|
904
902
|
startDate String
|
|
905
|
-
monthlyPayment Decimal
|
|
906
|
-
commitmentId String
|
|
903
|
+
monthlyPayment Decimal @map("monthly_payment")
|
|
904
|
+
commitmentId String @map("commitment_id")
|
|
907
905
|
commitmentTypeLid String? @map("commitment_type_lid")
|
|
908
906
|
furtherAdvances Boolean
|
|
909
907
|
furtherAdvanceDetails String
|
|
@@ -913,11 +911,12 @@ model MortgageCommitment {
|
|
|
913
911
|
accountInArrearsDetails String
|
|
914
912
|
doHaveSharedResponsibility Boolean
|
|
915
913
|
sharedMortgage String
|
|
914
|
+
jointNames Boolean @map("joint_names")
|
|
916
915
|
createdAt DateTime @default(now()) @map("created_at")
|
|
917
916
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
918
917
|
|
|
919
918
|
// Relations
|
|
920
|
-
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
919
|
+
applicant Applicant @relation("ApplicantMortgageCommitments", fields: [applicantId], references: [id])
|
|
921
920
|
repaymentType Lookup @relation("RepaymentType", fields: [repaymentTypeLid], references: [id])
|
|
922
921
|
mortgageType Lookup? @relation("MortgageType", fields: [mortgageTypeLid], references: [id])
|
|
923
922
|
commitmentType Lookup? @relation("CommitmentType", fields: [commitmentTypeLid], references: [id])
|
|
@@ -974,22 +973,24 @@ model OtherIncome {
|
|
|
974
973
|
|
|
975
974
|
// From prisma/applicants/property-income.prisma
|
|
976
975
|
model PropertyIncome {
|
|
977
|
-
id String
|
|
978
|
-
pageValidFlag Boolean
|
|
979
|
-
yearEnd1
|
|
980
|
-
rentalIncome1 Decimal
|
|
981
|
-
netProfit1 Decimal
|
|
982
|
-
yearEnd2
|
|
983
|
-
rentalIncome2 Decimal
|
|
984
|
-
netProfit2 Decimal
|
|
985
|
-
yearEnd3
|
|
986
|
-
rentalIncome3 Decimal
|
|
987
|
-
netProfit3 Decimal
|
|
988
|
-
createdAt DateTime
|
|
989
|
-
updatedAt DateTime
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
976
|
+
id String @id @default(uuid())
|
|
977
|
+
pageValidFlag Boolean @default(false) @map("page_valid_flag")
|
|
978
|
+
yearEnd1 String @map("year_end_1")
|
|
979
|
+
rentalIncome1 Decimal @map("rental_income_1")
|
|
980
|
+
netProfit1 Decimal @map("net_profit_1")
|
|
981
|
+
yearEnd2 String @map("year_end_2")
|
|
982
|
+
rentalIncome2 Decimal @map("rental_income_2")
|
|
983
|
+
netProfit2 Decimal @map("net_profit_2")
|
|
984
|
+
yearEnd3 String @map("year_end_3")
|
|
985
|
+
rentalIncome3 Decimal @map("rental_income_3")
|
|
986
|
+
netProfit3 Decimal @map("net_profit_3")
|
|
987
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
988
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
989
|
+
|
|
990
|
+
// Relations
|
|
991
|
+
applicants Applicant[] @relation("ApplicantPropertyIncome")
|
|
992
|
+
|
|
993
|
+
@@map("applicant_property_income")
|
|
993
994
|
}
|
|
994
995
|
|
|
995
996
|
// From prisma/applicants/residence-commitment.prisma
|
|
@@ -998,20 +999,20 @@ model ResidenceCommitment {
|
|
|
998
999
|
applicantId String @map("applicant_id")
|
|
999
1000
|
pageValidFlag Boolean @default(false)
|
|
1000
1001
|
financeTypeHppLid String? @map("finance_type_hpp_lid")
|
|
1001
|
-
lenderName String
|
|
1002
|
-
propertyValue Decimal
|
|
1002
|
+
lenderName String @map("lender_name")
|
|
1003
|
+
propertyValue Decimal @map("property_value")
|
|
1003
1004
|
hppRepaymentTypeLid String @map("hpp_repayment_type_lid")
|
|
1004
1005
|
mortgageTypeLid String? @map("mortgage_type_lid")
|
|
1005
1006
|
fixedTerm String
|
|
1006
|
-
commitmentId String
|
|
1007
|
+
commitmentId String @map("commitment_id")
|
|
1007
1008
|
originalLoanAmount Decimal
|
|
1008
|
-
outstandingBalance Decimal
|
|
1009
|
+
outstandingBalance Decimal @map("outstanding_balance")
|
|
1009
1010
|
startDate String
|
|
1010
1011
|
mortgageRate Float
|
|
1011
1012
|
remainingTermMonth Int
|
|
1012
1013
|
financeHomeTypeLid String @map("finance_home_type_lid")
|
|
1013
1014
|
chargeTypeLid String @map("charge_type_lid")
|
|
1014
|
-
monthlyPayment Decimal
|
|
1015
|
+
monthlyPayment Decimal @map("monthly_payment")
|
|
1015
1016
|
furtherAdvances Boolean
|
|
1016
1017
|
furtherAdvanceDetails String
|
|
1017
1018
|
accountUptoDate Boolean
|
|
@@ -1020,11 +1021,12 @@ model ResidenceCommitment {
|
|
|
1020
1021
|
accountInArrearsDetails String
|
|
1021
1022
|
doHaveSharedResponsibility Boolean
|
|
1022
1023
|
sharedMortgage String
|
|
1024
|
+
jointNames Boolean @map("joint_names")
|
|
1023
1025
|
createdAt DateTime @default(now()) @map("created_at")
|
|
1024
1026
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1025
1027
|
|
|
1026
1028
|
// Relations
|
|
1027
|
-
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
1029
|
+
applicant Applicant @relation("ApplicantResidenceCommitments", fields: [applicantId], references: [id])
|
|
1028
1030
|
financeTypeHpp Lookup? @relation("FinanceTypeHpp", fields: [financeTypeHppLid], references: [id])
|
|
1029
1031
|
hppRepaymentType Lookup @relation("HppRepaymentType", fields: [hppRepaymentTypeLid], references: [id])
|
|
1030
1032
|
mortgageType Lookup? @relation("MortgageType", fields: [mortgageTypeLid], references: [id])
|
|
@@ -1077,7 +1079,7 @@ model SecuredLoanCommitment {
|
|
|
1077
1079
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1078
1080
|
|
|
1079
1081
|
// Relations
|
|
1080
|
-
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
1082
|
+
applicant Applicant @relation("ApplicantSecuredLoanCommitments", fields: [applicantId], references: [id])
|
|
1081
1083
|
|
|
1082
1084
|
@@map("applicant_secured_loan_commitments")
|
|
1083
1085
|
}
|
|
@@ -1099,7 +1101,7 @@ model UnsecuredLoanCommitment {
|
|
|
1099
1101
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1100
1102
|
|
|
1101
1103
|
// Relations
|
|
1102
|
-
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
1104
|
+
applicant Applicant @relation("ApplicantUnsecuredLoanCommitments", fields: [applicantId], references: [id])
|
|
1103
1105
|
|
|
1104
1106
|
@@map("applicant_unsecured_loan_commitments")
|
|
1105
1107
|
}
|
|
@@ -1127,26 +1129,30 @@ model ApplicationAudit {
|
|
|
1127
1129
|
|
|
1128
1130
|
// From prisma/applications/application-company.prisma
|
|
1129
1131
|
model ApplicationCompany {
|
|
1130
|
-
id String
|
|
1131
|
-
applicationId String
|
|
1132
|
+
id String @id @default(uuid())
|
|
1133
|
+
applicationId String @unique @map("application_id")
|
|
1132
1134
|
name String
|
|
1133
|
-
registrationNumber String?
|
|
1134
|
-
createdAt DateTime
|
|
1135
|
-
updatedAt DateTime
|
|
1136
|
-
|
|
1135
|
+
registrationNumber String? @map("registration_number")
|
|
1136
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
1137
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1138
|
+
|
|
1139
|
+
// Relations
|
|
1140
|
+
application Application @relation("ApplicationCompany", fields: [applicationId], references: [id])
|
|
1137
1141
|
|
|
1138
1142
|
@@map("application_companies")
|
|
1139
1143
|
}
|
|
1140
1144
|
|
|
1141
1145
|
// From prisma/applications/application-direct-debit.prisma
|
|
1142
1146
|
model ApplicationDirectDebit {
|
|
1143
|
-
id String
|
|
1144
|
-
applicationId String
|
|
1145
|
-
accountNumber String
|
|
1146
|
-
sortCode String
|
|
1147
|
-
createdAt DateTime
|
|
1148
|
-
updatedAt DateTime
|
|
1149
|
-
|
|
1147
|
+
id String @id @default(uuid())
|
|
1148
|
+
applicationId String @unique @map("application_id")
|
|
1149
|
+
accountNumber String @map("account_number")
|
|
1150
|
+
sortCode String @map("sort_code")
|
|
1151
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
1152
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1153
|
+
|
|
1154
|
+
// Relations
|
|
1155
|
+
application Application @relation("ApplicationDirectDebit", fields: [applicationId], references: [id])
|
|
1150
1156
|
|
|
1151
1157
|
@@map("application_direct_debits")
|
|
1152
1158
|
}
|
|
@@ -1251,7 +1257,7 @@ model ApplicationMortgage {
|
|
|
1251
1257
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1252
1258
|
|
|
1253
1259
|
// Relations
|
|
1254
|
-
application Application @relation(fields: [applicationId], references: [id])
|
|
1260
|
+
application Application @relation("ApplicationMortgage", fields: [applicationId], references: [id])
|
|
1255
1261
|
repaymentType Lookup @relation("RepaymentType", fields: [repaymentTypeLid], references: [id])
|
|
1256
1262
|
exitStrategy Lookup @relation("ExitStrategy", fields: [exitStrategyLid], references: [id])
|
|
1257
1263
|
sourceOfFunds Lookup @relation("SourceOfFunds", fields: [sourceOfFundsLid], references: [id])
|
|
@@ -1347,7 +1353,7 @@ model ApplicationProduct {
|
|
|
1347
1353
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1348
1354
|
|
|
1349
1355
|
// Relations
|
|
1350
|
-
application Application @relation(fields: [applicationId], references: [id])
|
|
1356
|
+
application Application @relation("ApplicationProducts", fields: [applicationId], references: [id])
|
|
1351
1357
|
lendingType Lookup? @relation("LendingType", fields: [lendingTypeLid], references: [id])
|
|
1352
1358
|
repaymentType Lookup? @relation("RepaymentType", fields: [repaymentTypeLid], references: [id])
|
|
1353
1359
|
isFinanceRecommendedToApplicant Lookup? @relation("FinanceRecommended", fields: [isFinanceRecommendedToApplicantLid], references: [id])
|
|
@@ -1398,7 +1404,7 @@ model ApplicationRationale {
|
|
|
1398
1404
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1399
1405
|
|
|
1400
1406
|
// Relations
|
|
1401
|
-
application Application @relation(fields: [applicationId], references: [id])
|
|
1407
|
+
application Application @relation("ApplicationRationale", fields: [applicationId], references: [id])
|
|
1402
1408
|
affordabilityStatus Lookup? @relation("AffordabilityStatus", fields: [affordabilityStatusLid], references: [id])
|
|
1403
1409
|
applicantsStatus Lookup? @relation("ApplicantsStatus", fields: [applicantsStatusLid], references: [id])
|
|
1404
1410
|
creditConductStatus Lookup? @relation("CreditConductStatus", fields: [creditConductStatusLid], references: [id])
|
|
@@ -1453,87 +1459,96 @@ model ApplicationValuation {
|
|
|
1453
1459
|
|
|
1454
1460
|
// From prisma/applications/application.prisma
|
|
1455
1461
|
model Application {
|
|
1456
|
-
id
|
|
1457
|
-
queueId
|
|
1458
|
-
assignedToUserId
|
|
1459
|
-
applicationId
|
|
1460
|
-
isApplicationFeePaid
|
|
1461
|
-
applicationNumber
|
|
1462
|
-
applicationTypeLid
|
|
1463
|
-
bankSolicitor
|
|
1464
|
-
brokerId
|
|
1465
|
-
caseManager
|
|
1466
|
-
caseManagerAccepted
|
|
1467
|
-
completedReason
|
|
1468
|
-
isIntendToOccupy
|
|
1469
|
-
introducer
|
|
1470
|
-
isIntroducerSubmission
|
|
1471
|
-
isBrokerAssigned
|
|
1472
|
-
isFinanceRecommendedToApplicant
|
|
1473
|
-
isWorkflowTaskCreated
|
|
1474
|
-
lastUpdated
|
|
1475
|
-
lendingTypeLid
|
|
1476
|
-
networkClubName
|
|
1477
|
-
isNetworkClubSubmission
|
|
1478
|
-
newReason
|
|
1479
|
-
purchaseTypeLid
|
|
1480
|
-
rejectedReason
|
|
1481
|
-
repaymentTypeLid
|
|
1482
|
-
selectedProduct
|
|
1483
|
-
sourceOfWealthLids
|
|
1484
|
-
sowBusiness
|
|
1485
|
-
sowInheritance
|
|
1486
|
-
sowOther
|
|
1487
|
-
sowProperty
|
|
1488
|
-
sowSalary
|
|
1489
|
-
statusLid
|
|
1490
|
-
submitReason
|
|
1491
|
-
submittedDate
|
|
1492
|
-
underwriter
|
|
1493
|
-
isValuationFeePaid
|
|
1494
|
-
withdrawalReason
|
|
1495
|
-
withdrawalReasonCode
|
|
1496
|
-
productId
|
|
1497
|
-
securityId
|
|
1498
|
-
solicitorId
|
|
1499
|
-
isActive
|
|
1500
|
-
isUkResident
|
|
1501
|
-
riskRating
|
|
1502
|
-
directDebitId
|
|
1503
|
-
mortgageId
|
|
1504
|
-
companyId
|
|
1505
|
-
rationaleId
|
|
1506
|
-
newAuditRecordsCount
|
|
1507
|
-
currentApprivoAuditId
|
|
1508
|
-
propertyIds
|
|
1509
|
-
createdAt
|
|
1510
|
-
updatedAt
|
|
1462
|
+
id String @id @default(uuid())
|
|
1463
|
+
queueId String[] @map("queue_id")
|
|
1464
|
+
assignedToUserId String? @map("assigned_to_user_id")
|
|
1465
|
+
applicationId String @unique @map("application_id")
|
|
1466
|
+
isApplicationFeePaid String @map("is_application_fee_paid")
|
|
1467
|
+
applicationNumber String @map("application_number")
|
|
1468
|
+
applicationTypeLid String @map("application_type_lid")
|
|
1469
|
+
bankSolicitor String @default("") @map("bank_solicitor")
|
|
1470
|
+
brokerId String @map("broker_id")
|
|
1471
|
+
caseManager String @default("") @map("case_manager")
|
|
1472
|
+
caseManagerAccepted String @default("false") @map("case_manager_accepted")
|
|
1473
|
+
completedReason String @default("") @map("completed_reason")
|
|
1474
|
+
isIntendToOccupy String @map("is_intend_to_occupy")
|
|
1475
|
+
introducer String @default("") @map("introducer")
|
|
1476
|
+
isIntroducerSubmission String @map("is_introducer_submission")
|
|
1477
|
+
isBrokerAssigned String @default("false") @map("is_broker_assigned")
|
|
1478
|
+
isFinanceRecommendedToApplicant String @map("is_finance_recommended_to_applicant")
|
|
1479
|
+
isWorkflowTaskCreated String @map("is_workflow_task_created")
|
|
1480
|
+
lastUpdated String? @map("last_updated")
|
|
1481
|
+
lendingTypeLid String @map("lending_type_lid")
|
|
1482
|
+
networkClubName String @default("") @map("network_club_name")
|
|
1483
|
+
isNetworkClubSubmission String @map("is_network_club_submission")
|
|
1484
|
+
newReason String @default("") @map("new_reason")
|
|
1485
|
+
purchaseTypeLid String @map("purchase_type_lid")
|
|
1486
|
+
rejectedReason String @default("") @map("rejected_reason")
|
|
1487
|
+
repaymentTypeLid String @map("repayment_type_lid")
|
|
1488
|
+
selectedProduct String? @map("selected_product")
|
|
1489
|
+
sourceOfWealthLids String[] @map("source_of_wealth_lids")
|
|
1490
|
+
sowBusiness String @default("") @map("sow_business")
|
|
1491
|
+
sowInheritance String @default("") @map("sow_inheritance")
|
|
1492
|
+
sowOther String @default("") @map("sow_other")
|
|
1493
|
+
sowProperty String @default("") @map("sow_property")
|
|
1494
|
+
sowSalary String @default("") @map("sow_salary")
|
|
1495
|
+
statusLid String @map("status_lid")
|
|
1496
|
+
submitReason String @default("") @map("submit_reason")
|
|
1497
|
+
submittedDate String? @map("submitted_date")
|
|
1498
|
+
underwriter String @default("") @map("underwriter")
|
|
1499
|
+
isValuationFeePaid String @map("is_valuation_fee_paid")
|
|
1500
|
+
withdrawalReason String @default("") @map("withdrawal_reason")
|
|
1501
|
+
withdrawalReasonCode String @default("") @map("withdrawal_reason_code")
|
|
1502
|
+
productId String? @map("product_id")
|
|
1503
|
+
securityId String @unique @map("security_id")
|
|
1504
|
+
solicitorId String @unique @map("solicitor_id")
|
|
1505
|
+
isActive String @default("false") @map("is_active")
|
|
1506
|
+
isUkResident String @default("true") @map("is_uk_resident")
|
|
1507
|
+
riskRating String? @map("risk_rating")
|
|
1508
|
+
directDebitId String? @unique @map("direct_debit_id")
|
|
1509
|
+
mortgageId String? @unique @map("mortgage_id")
|
|
1510
|
+
companyId String? @unique @map("company_id")
|
|
1511
|
+
rationaleId String? @unique @map("rationale_id")
|
|
1512
|
+
newAuditRecordsCount String @default("0") @map("new_audit_records_count")
|
|
1513
|
+
currentApprivoAuditId String? @map("current_apprivo_audit_id")
|
|
1514
|
+
propertyIds String[] @map("property_ids")
|
|
1515
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
1516
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1517
|
+
pageValidFlag Boolean @default(false)
|
|
1518
|
+
applicationStatusLid String @map("application_status_lid")
|
|
1519
|
+
applicationSubTypeLid String @map("application_sub_type_lid")
|
|
1520
|
+
applicationSubTypeOther String? @map("application_sub_type_other")
|
|
1521
|
+
applicationSubTypeOtherDetails String? @map("application_sub_type_other_details")
|
|
1522
|
+
applicationSubTypeOtherLid String? @map("application_sub_type_other_lid")
|
|
1523
|
+
applicationSubTypeOtherLidDetails String? @map("application_sub_type_other_lid_details")
|
|
1524
|
+
applicationSubTypeOtherLidOther String? @map("application_sub_type_other_lid_other")
|
|
1525
|
+
applicationSubTypeOtherLidOtherDetails String? @map("application_sub_type_other_lid_other_details")
|
|
1511
1526
|
|
|
1512
1527
|
// Relations
|
|
1513
|
-
broker
|
|
1514
|
-
security
|
|
1515
|
-
solicitor
|
|
1516
|
-
product
|
|
1517
|
-
directDebit
|
|
1518
|
-
mortgage
|
|
1519
|
-
company
|
|
1520
|
-
rationale
|
|
1521
|
-
applicants
|
|
1522
|
-
properties
|
|
1528
|
+
broker Broker @relation("BrokerApplications", fields: [brokerId], references: [id])
|
|
1529
|
+
security Security?
|
|
1530
|
+
solicitor Solicitor?
|
|
1531
|
+
product Product? @relation(fields: [productId], references: [id])
|
|
1532
|
+
directDebit ApplicationDirectDebit? @relation("ApplicationDirectDebit")
|
|
1533
|
+
mortgage ApplicationMortgage? @relation("ApplicationMortgage")
|
|
1534
|
+
company ApplicationCompany? @relation("ApplicationCompany")
|
|
1535
|
+
rationale ApplicationRationale? @relation("ApplicationRationale")
|
|
1536
|
+
applicants Applicant[]
|
|
1537
|
+
properties Property[] @relation("ApplicationProperties")
|
|
1538
|
+
documents ApplicationDocument[]
|
|
1539
|
+
notes ApplicationNote[]
|
|
1540
|
+
audits ApplicationAudit[]
|
|
1541
|
+
underwriters Underwriter[] @relation("ApplicationUnderwriters")
|
|
1542
|
+
status Lookup @relation("Status", fields: [statusLid], references: [id])
|
|
1543
|
+
directDebits DirectDebit[] @relation("ApplicationDirectDebits")
|
|
1544
|
+
products ApplicationProduct[] @relation("ApplicationProducts")
|
|
1545
|
+
companies Company[] @relation("ApplicationCompany")
|
|
1523
1546
|
|
|
1524
1547
|
// Lookup relations
|
|
1525
|
-
applicationType
|
|
1526
|
-
lendingType
|
|
1527
|
-
purchaseType
|
|
1528
|
-
repaymentType
|
|
1529
|
-
status Lookup @relation("Status", fields: [statusLid], references: [id])
|
|
1530
|
-
DirectDebit DirectDebit[]
|
|
1531
|
-
ApplicationAudit ApplicationAudit[]
|
|
1532
|
-
ApplicationDocument ApplicationDocument[]
|
|
1533
|
-
ApplicationNote ApplicationNote[]
|
|
1534
|
-
ApplicationProduct ApplicationProduct[]
|
|
1535
|
-
Company Company[]
|
|
1536
|
-
Underwriter Underwriter[]
|
|
1548
|
+
applicationType Lookup @relation("ApplicationType", fields: [applicationTypeLid], references: [id])
|
|
1549
|
+
lendingType Lookup @relation("LendingType", fields: [lendingTypeLid], references: [id])
|
|
1550
|
+
purchaseType Lookup @relation("PurchaseType", fields: [purchaseTypeLid], references: [id])
|
|
1551
|
+
repaymentType Lookup @relation("RepaymentType", fields: [repaymentTypeLid], references: [id])
|
|
1537
1552
|
|
|
1538
1553
|
@@index([applicationTypeLid])
|
|
1539
1554
|
@@index([lendingTypeLid])
|
|
@@ -1545,26 +1560,28 @@ model Application {
|
|
|
1545
1560
|
|
|
1546
1561
|
// From prisma/applications/broker.prisma
|
|
1547
1562
|
model Broker {
|
|
1548
|
-
id String
|
|
1549
|
-
brokerId String?
|
|
1550
|
-
landlinePhone String?
|
|
1551
|
-
mobileTelephone String?
|
|
1552
|
-
addressPostCode String?
|
|
1553
|
-
addressLine1 String?
|
|
1554
|
-
addressLine2 String?
|
|
1555
|
-
addressLine3 String?
|
|
1556
|
-
addressCity String?
|
|
1557
|
-
addressCountry String?
|
|
1558
|
-
tradingName String?
|
|
1559
|
-
fcaNumber String?
|
|
1560
|
-
brokerType String?
|
|
1561
|
-
email String?
|
|
1562
|
-
network String?
|
|
1563
|
-
firstName String?
|
|
1564
|
-
lastName String?
|
|
1565
|
-
createdAt DateTime
|
|
1566
|
-
updatedAt DateTime
|
|
1567
|
-
|
|
1563
|
+
id String @id @default(uuid())
|
|
1564
|
+
brokerId String? @map("broker_id")
|
|
1565
|
+
landlinePhone String? @map("landline_phone")
|
|
1566
|
+
mobileTelephone String? @map("mobile_telephone")
|
|
1567
|
+
addressPostCode String? @map("address_post_code")
|
|
1568
|
+
addressLine1 String? @map("address_line1")
|
|
1569
|
+
addressLine2 String? @map("address_line2")
|
|
1570
|
+
addressLine3 String? @map("address_line3")
|
|
1571
|
+
addressCity String? @map("address_city")
|
|
1572
|
+
addressCountry String? @map("address_country")
|
|
1573
|
+
tradingName String? @map("trading_name")
|
|
1574
|
+
fcaNumber String? @map("fca_number")
|
|
1575
|
+
brokerType String? @map("broker_type")
|
|
1576
|
+
email String? @map("email")
|
|
1577
|
+
network String? @map("network")
|
|
1578
|
+
firstName String? @map("first_name")
|
|
1579
|
+
lastName String? @map("last_name")
|
|
1580
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
1581
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1582
|
+
|
|
1583
|
+
// Relations
|
|
1584
|
+
applications Application[] @relation("BrokerApplications")
|
|
1568
1585
|
|
|
1569
1586
|
@@map("brokers")
|
|
1570
1587
|
}
|
|
@@ -1668,7 +1685,7 @@ model Company {
|
|
|
1668
1685
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1669
1686
|
|
|
1670
1687
|
// Relations
|
|
1671
|
-
application Application @relation(fields: [applicationId], references: [id])
|
|
1688
|
+
application Application @relation("ApplicationCompany", fields: [applicationId], references: [id])
|
|
1672
1689
|
businessType Lookup @relation("BusinessType", fields: [businessTypeLid], references: [id])
|
|
1673
1690
|
taxJurisdiction Lookup @relation("TaxJurisdiction", fields: [taxJurisdictionLid], references: [id])
|
|
1674
1691
|
addressCountry Lookup @relation("AddressCountry", fields: [addressCountryLid], references: [id])
|
|
@@ -1690,7 +1707,7 @@ model ApplicantShareholding {
|
|
|
1690
1707
|
|
|
1691
1708
|
// Relations
|
|
1692
1709
|
company Company @relation(fields: [companyId], references: [id])
|
|
1693
|
-
applicant Applicant @relation(fields: [applicantId], references: [id])
|
|
1710
|
+
applicant Applicant @relation("ApplicantShareholdings", fields: [applicantId], references: [id])
|
|
1694
1711
|
directorShareholder Lookup? @relation("DirectorShareholder", fields: [directorShareholderLid], references: [id])
|
|
1695
1712
|
|
|
1696
1713
|
@@map("applicant_shareholdings")
|
|
@@ -1918,8 +1935,8 @@ model Underwriter {
|
|
|
1918
1935
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1919
1936
|
|
|
1920
1937
|
// Relations
|
|
1921
|
-
application Application @relation(fields: [applicationId], references: [id])
|
|
1922
|
-
underwriter User @relation(fields: [underwriterId], references: [id])
|
|
1938
|
+
application Application @relation("ApplicationUnderwriters", fields: [applicationId], references: [id])
|
|
1939
|
+
underwriter User @relation("UserUnderwriters", fields: [underwriterId], references: [id])
|
|
1923
1940
|
|
|
1924
1941
|
@@map("underwriters")
|
|
1925
1942
|
}
|