@dynamatix/gb-schemas 2.0.7 → 2.0.9
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/applicants/applicant-additional-income.model.d.ts +1120 -0
- package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -0
- package/dist/applicants/applicant-additional-income.model.js +33 -0
- package/dist/applicants/applicant-commitment-creditCard.model.d.ts +3 -3
- package/dist/applicants/applicant-commitment-creditCard.model.js +1 -1
- package/dist/applicants/applicant-commitment-loan.model.d.ts +3 -3
- package/dist/applicants/applicant-commitment-loan.model.js +1 -1
- package/dist/applicants/applicant-commitment-mortgage.model.d.ts +3 -3
- package/dist/applicants/applicant-commitment-mortgage.model.js +1 -1
- package/dist/applicants/applicant-employment-income.model.d.ts +6 -6
- package/dist/applicants/applicant-employment-income.model.js +1 -1
- package/dist/applicants/applicant-income.model.d.ts +48 -0
- package/dist/applicants/applicant-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-pension-income.model.d.ts +483 -0
- package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -0
- package/dist/applicants/applicant-pension-income.model.js +14 -0
- package/dist/applicants/applicant-property-income.model.d.ts +871 -13
- package/dist/applicants/applicant-property-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-property-income.model.js +7 -5
- package/dist/applicants/applicant-uk-tax-credits.model.d.ts +489 -0
- package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -0
- package/dist/applicants/applicant-uk-tax-credits.model.js +11 -0
- package/dist/applicants/applicant.model.d.ts +94 -6360
- package/dist/applicants/applicant.model.d.ts.map +1 -1
- package/dist/applicants/index.d.ts +4 -0
- package/dist/applicants/index.d.ts.map +1 -1
- package/dist/applications/application-productfeatures.model.d.ts +765 -0
- package/dist/applications/application-productfeatures.model.d.ts.map +1 -0
- package/dist/applications/application-productfeatures.model.js +96 -0
- package/dist/applications/application.model.d.ts +0 -726
- package/dist/applications/application.model.d.ts.map +1 -1
- package/dist/applications/index.d.ts +1 -1
- package/dist/applications/index.d.ts.map +1 -1
- package/dist/entities/applicants/applicant-credit-data.entity.d.ts +19 -0
- package/dist/entities/applicants/applicant-credit-data.entity.d.ts.map +1 -0
- package/dist/entities/applicants/applicant-credit-data.entity.js +5 -0
- package/dist/entities/applicants/applicant-credit-profile.entity.d.ts +14 -0
- package/dist/entities/applicants/applicant-credit-profile.entity.d.ts.map +1 -0
- package/dist/entities/applicants/applicant-credit-profile.entity.js +5 -0
- package/dist/entities/applicants/applicant-employment.entity.d.ts +53 -0
- package/dist/entities/applicants/applicant-employment.entity.d.ts.map +1 -0
- package/dist/entities/applicants/applicant-employment.entity.js +2 -0
- package/dist/entities/applicants/applicant-expenditure.entity.d.ts +13 -0
- package/dist/entities/applicants/applicant-expenditure.entity.d.ts.map +1 -0
- package/dist/entities/applicants/applicant-expenditure.entity.js +2 -0
- package/dist/entities/applicants/applicant-income-source.entity.d.ts +17 -0
- package/dist/entities/applicants/applicant-income-source.entity.d.ts.map +1 -0
- package/dist/entities/applicants/applicant-income-source.entity.js +5 -0
- package/dist/entities/applicants/applicant-income.entity.d.ts +59 -0
- package/dist/entities/applicants/applicant-income.entity.d.ts.map +1 -0
- package/dist/entities/applicants/applicant-income.entity.js +2 -0
- package/dist/entities/applicants/applicant.entity.d.ts +12 -14
- package/dist/entities/applicants/applicant.entity.d.ts.map +1 -1
- package/dist/entities/applicants/index.d.ts +14 -16
- package/dist/entities/applicants/index.d.ts.map +1 -1
- package/dist/entities/applicants/index.js +12 -14
- package/dist/entities/applications/application-credit-profile.entity.d.ts +11 -0
- package/dist/entities/applications/application-credit-profile.entity.d.ts.map +1 -0
- package/dist/entities/applications/application-credit-profile.entity.js +5 -0
- package/dist/entities/applications/index.d.ts +1 -1
- package/dist/entities/applications/index.d.ts.map +1 -1
- package/dist/entities/applications/index.js +1 -1
- package/dist/entities/shared/apprivo-sync-journey.entity.d.ts +7 -4
- package/dist/entities/shared/apprivo-sync-journey.entity.d.ts.map +1 -1
- package/dist/entities/shared/job-run.entity.d.ts +8 -4
- package/dist/entities/shared/job-run.entity.d.ts.map +1 -1
- package/dist/entities/shared/job-run.model.d.ts +11 -0
- package/dist/entities/shared/job-run.model.d.ts.map +1 -0
- package/dist/entities/shared/job-run.model.js +1 -0
- package/dist/entities/shared/job-setting.entity.d.ts +1 -1
- package/dist/entities/shared/job-setting.entity.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/entities/applicants/index.ts +38 -42
- package/entities/applications/application.entity.ts +5 -1
- package/package.json +1 -1
- package/prisma/applicants/applicant.prisma +1 -1
- package/prisma/applications/application-company.prisma +6 -6
- package/prisma/applications/application-document.prisma +23 -23
- package/prisma/applications/application.prisma +80 -88
- package/prisma/applications/broker.prisma +1 -1
- package/prisma/applications/company.prisma +62 -62
- package/prisma/applications/solicitor.prisma +1 -1
- package/prisma/product-catalogues/product.prisma +1 -1
- package/prisma/properties/security.prisma +1 -1
- package/prisma/schema.prisma +173 -180
- package/prisma/shared/lookup.prisma +1 -0
|
@@ -1,59 +1,55 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
Applicant,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
SecuredLoanCommitment,
|
|
14
|
-
UnsecuredLoanCommitment,
|
|
15
|
-
ResidenceCommitment,
|
|
16
|
-
MortgageCommitment,
|
|
3
|
+
ApplicantCreditData,
|
|
4
|
+
ApplicantCreditProfile,
|
|
5
|
+
ApplicantEmployment,
|
|
6
|
+
ApplicantEmploymentIncome,
|
|
7
|
+
ApplicantExpenditure,
|
|
8
|
+
ApplicantIncome,
|
|
9
|
+
ApplicantIncomeSource,
|
|
10
|
+
ApplicantOtherIncome,
|
|
11
|
+
ApplicantPropertyIncome,
|
|
12
|
+
CreditCardCommitment,
|
|
17
13
|
LoanCommitment,
|
|
18
|
-
|
|
14
|
+
MortgageCommitment,
|
|
15
|
+
ResidenceCommitment,
|
|
16
|
+
SecuredLoanCommitment,
|
|
17
|
+
UnsecuredLoanCommitment
|
|
19
18
|
} from '@prisma/client';
|
|
20
19
|
|
|
21
20
|
// Export Prisma types
|
|
22
21
|
export type {
|
|
23
22
|
Applicant,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
SecuredLoanCommitment,
|
|
35
|
-
UnsecuredLoanCommitment,
|
|
36
|
-
ResidenceCommitment,
|
|
37
|
-
MortgageCommitment,
|
|
23
|
+
ApplicantCreditData,
|
|
24
|
+
ApplicantCreditProfile,
|
|
25
|
+
ApplicantEmployment,
|
|
26
|
+
ApplicantEmploymentIncome,
|
|
27
|
+
ApplicantExpenditure,
|
|
28
|
+
ApplicantIncome,
|
|
29
|
+
ApplicantIncomeSource,
|
|
30
|
+
ApplicantOtherIncome,
|
|
31
|
+
ApplicantPropertyIncome,
|
|
32
|
+
CreditCardCommitment,
|
|
38
33
|
LoanCommitment,
|
|
39
|
-
|
|
34
|
+
MortgageCommitment,
|
|
35
|
+
ResidenceCommitment,
|
|
36
|
+
SecuredLoanCommitment,
|
|
37
|
+
UnsecuredLoanCommitment
|
|
40
38
|
};
|
|
41
39
|
|
|
42
40
|
// Export entity classes
|
|
43
41
|
export * from './applicant.entity';
|
|
44
|
-
export * from './
|
|
45
|
-
export * from './unsecured-loan-commitment.entity';
|
|
46
|
-
export * from './property-income.entity';
|
|
47
|
-
export * from './residence-commitment.entity';
|
|
48
|
-
export * from './risk-narrative.entity';
|
|
49
|
-
export * from './mortgage-commitment.entity';
|
|
50
|
-
export * from './other-income.entity';
|
|
51
|
-
export * from './applicant-income-source.entity';
|
|
52
|
-
export * from './applicant-income.entity';
|
|
53
|
-
export * from './loan-commitment.entity';
|
|
42
|
+
export * from './applicant-credit-data.entity';
|
|
54
43
|
export * from './applicant-credit-profile.entity';
|
|
55
|
-
export * from './direct-debit.entity';
|
|
56
44
|
export * from './applicant-employment.entity';
|
|
57
45
|
export * from './applicant-expenditure.entity';
|
|
46
|
+
export * from './applicant-income.entity';
|
|
47
|
+
export * from './applicant-income-source.entity';
|
|
58
48
|
export * from './credit-card-commitment.entity';
|
|
59
|
-
export * from './
|
|
49
|
+
export * from './loan-commitment.entity';
|
|
50
|
+
export * from './mortgage-commitment.entity';
|
|
51
|
+
export * from './other-income.entity';
|
|
52
|
+
export * from './property-income.entity';
|
|
53
|
+
export * from './residence-commitment.entity';
|
|
54
|
+
export * from './secure-loan-commitment.entity';
|
|
55
|
+
export * from './unsecured-loan-commitment.entity';
|
|
@@ -9,6 +9,7 @@ import { ApplicationCompanyEntity } from './application-company.entity';
|
|
|
9
9
|
import { ApplicationRationaleEntity } from './application-rationale.entity';
|
|
10
10
|
import { ApplicantEntity } from '../applicants/applicant.entity';
|
|
11
11
|
import { PropertyEntity } from '../properties/property.entity';
|
|
12
|
+
import { ApplicationCreditProfileEntity } from './application-credit-profile.entity';
|
|
12
13
|
|
|
13
14
|
export class ApplicationEntity {
|
|
14
15
|
id!: string;
|
|
@@ -63,6 +64,7 @@ export class ApplicationEntity {
|
|
|
63
64
|
rationaleId?: string;
|
|
64
65
|
newAuditRecordsCount!: string;
|
|
65
66
|
currentApprivoAuditId?: string;
|
|
67
|
+
applicantIds!: string[];
|
|
66
68
|
propertyIds!: string[];
|
|
67
69
|
createdAt!: Date;
|
|
68
70
|
updatedAt!: Date;
|
|
@@ -78,12 +80,14 @@ export class ApplicationEntity {
|
|
|
78
80
|
solicitor?: SolicitorEntity;
|
|
79
81
|
product?: ProductEntity;
|
|
80
82
|
directDebit?: ApplicationDirectDebitEntity;
|
|
83
|
+
creditProfile?: ApplicationCreditProfileEntity;
|
|
81
84
|
mortgage?: ApplicationMortgageEntity;
|
|
82
85
|
company?: ApplicationCompanyEntity;
|
|
83
86
|
rationale?: ApplicationRationaleEntity;
|
|
84
87
|
applicants?: ApplicantEntity[];
|
|
85
88
|
sourceOfWealth?: LookupEntity[];
|
|
86
89
|
properties?: PropertyEntity[];
|
|
90
|
+
companies?: ApplicationCompanyEntity[];
|
|
87
91
|
|
|
88
92
|
constructor(partial: Partial<ApplicationEntity>) {
|
|
89
93
|
Object.assign(this, partial);
|
|
@@ -91,7 +95,7 @@ export class ApplicationEntity {
|
|
|
91
95
|
|
|
92
96
|
// Virtual properties from Mongoose model
|
|
93
97
|
get noOfApplicants(): number {
|
|
94
|
-
return this.
|
|
98
|
+
return this.applicantIds?.length ?? 0;
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
get applicationTypeName(): string | null {
|
package/package.json
CHANGED
|
@@ -93,7 +93,7 @@ model Applicant {
|
|
|
93
93
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
94
94
|
|
|
95
95
|
// Relations
|
|
96
|
-
application Application @relation(fields: [applicationId], references: [id])
|
|
96
|
+
application Application @relation("ApplicationApplicants", fields: [applicationId], references: [id])
|
|
97
97
|
addressCountry Lookup? @relation("AddressCountry", fields: [addressCountryLid], references: [id])
|
|
98
98
|
correspondenceAddressCountry Lookup? @relation("CorrespondenceAddressCountry", fields: [correspondenceAddressCountryLid], references: [id])
|
|
99
99
|
countryOfResidence Lookup @relation("CountryOfResidence", fields: [countryOfResidenceLid], references: [id])
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
model ApplicationCompany {
|
|
2
|
-
id
|
|
3
|
-
applicationId
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
applicationId String @unique @map("application_id")
|
|
4
4
|
name String
|
|
5
5
|
registrationNumber String? @map("registration_number")
|
|
6
|
-
createdAt
|
|
7
|
-
updatedAt
|
|
6
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
7
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
8
8
|
|
|
9
9
|
// Relations
|
|
10
|
-
application
|
|
10
|
+
application Application @relation("ApplicationCompany", fields: [applicationId], references: [id])
|
|
11
11
|
|
|
12
12
|
@@map("application_companies")
|
|
13
|
-
}
|
|
13
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
model ApplicationDocument {
|
|
2
|
-
id
|
|
3
|
-
applicationId
|
|
4
|
-
documentId
|
|
5
|
-
owningEntityId
|
|
6
|
-
documentTypeLid
|
|
7
|
-
documentTypeId
|
|
8
|
-
fileName
|
|
9
|
-
contentType
|
|
10
|
-
created
|
|
11
|
-
createdBy
|
|
12
|
-
isGenerated
|
|
13
|
-
data
|
|
14
|
-
envelopeId
|
|
15
|
-
signers
|
|
16
|
-
documentTypeDisplayName String?
|
|
17
|
-
documentTypeValue
|
|
18
|
-
documentTypeData
|
|
19
|
-
documentUrl
|
|
20
|
-
createdAt
|
|
21
|
-
updatedAt
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
applicationId String? @map("application_id")
|
|
4
|
+
documentId String @map("document_id")
|
|
5
|
+
owningEntityId String? @map("owning_entity_id")
|
|
6
|
+
documentTypeLid String? @map("document_type_lid")
|
|
7
|
+
documentTypeId String? @map("document_type_id")
|
|
8
|
+
fileName String? @map("file_name")
|
|
9
|
+
contentType String? @map("content_type")
|
|
10
|
+
created String? @map("created")
|
|
11
|
+
createdBy String? @map("created_by")
|
|
12
|
+
isGenerated String? @map("is_generated")
|
|
13
|
+
data String? @map("data")
|
|
14
|
+
envelopeId String? @map("envelope_id")
|
|
15
|
+
signers Json @default("[]") @map("signers")
|
|
16
|
+
documentTypeDisplayName String? @map("document_type_display_name")
|
|
17
|
+
documentTypeValue String? @map("document_type_value")
|
|
18
|
+
documentTypeData Json? @map("document_type_data")
|
|
19
|
+
documentUrl String? @map("document_url")
|
|
20
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
21
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
22
22
|
|
|
23
23
|
// Relations
|
|
24
|
-
application
|
|
25
|
-
documentType
|
|
24
|
+
application Application? @relation(fields: [applicationId], references: [id])
|
|
25
|
+
documentType Lookup? @relation("DocumentType", fields: [documentTypeLid], references: [id])
|
|
26
26
|
|
|
27
27
|
@@map("application_documents")
|
|
28
|
-
}
|
|
28
|
+
}
|
|
@@ -1,99 +1,91 @@
|
|
|
1
1
|
model Application {
|
|
2
|
-
id
|
|
3
|
-
queueId
|
|
4
|
-
assignedToUserId
|
|
5
|
-
applicationId
|
|
6
|
-
isApplicationFeePaid
|
|
7
|
-
applicationNumber
|
|
8
|
-
applicationTypeLid
|
|
9
|
-
bankSolicitor
|
|
10
|
-
brokerId
|
|
11
|
-
caseManager
|
|
12
|
-
caseManagerAccepted
|
|
13
|
-
completedReason
|
|
14
|
-
isIntendToOccupy
|
|
15
|
-
introducer
|
|
16
|
-
isIntroducerSubmission
|
|
17
|
-
isBrokerAssigned
|
|
18
|
-
isFinanceRecommendedToApplicant
|
|
19
|
-
isWorkflowTaskCreated
|
|
20
|
-
lastUpdated
|
|
21
|
-
lendingTypeLid
|
|
22
|
-
networkClubName
|
|
23
|
-
isNetworkClubSubmission
|
|
24
|
-
newReason
|
|
25
|
-
purchaseTypeLid
|
|
26
|
-
rejectedReason
|
|
27
|
-
repaymentTypeLid
|
|
28
|
-
selectedProduct
|
|
29
|
-
sourceOfWealthLids
|
|
30
|
-
sowBusiness
|
|
31
|
-
sowInheritance
|
|
32
|
-
sowOther
|
|
33
|
-
sowProperty
|
|
34
|
-
sowSalary
|
|
35
|
-
statusLid
|
|
36
|
-
submitReason
|
|
37
|
-
submittedDate
|
|
38
|
-
underwriter
|
|
39
|
-
isValuationFeePaid
|
|
40
|
-
withdrawalReason
|
|
41
|
-
withdrawalReasonCode
|
|
42
|
-
productId
|
|
43
|
-
securityId
|
|
44
|
-
solicitorId
|
|
45
|
-
isActive
|
|
46
|
-
isUkResident
|
|
47
|
-
riskRating
|
|
48
|
-
directDebitId
|
|
49
|
-
mortgageId
|
|
50
|
-
companyId
|
|
51
|
-
rationaleId
|
|
52
|
-
newAuditRecordsCount
|
|
53
|
-
currentApprivoAuditId
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
updatedAt DateTime @updatedAt @map("updated_at")
|
|
57
|
-
pageValidFlag Boolean @default(false)
|
|
58
|
-
applicationStatusLid String @map("application_status_lid")
|
|
59
|
-
applicationSubTypeLid String @map("application_sub_type_lid")
|
|
60
|
-
applicationSubTypeOther String? @map("application_sub_type_other")
|
|
61
|
-
applicationSubTypeOtherDetails String? @map("application_sub_type_other_details")
|
|
62
|
-
applicationSubTypeOtherLid String? @map("application_sub_type_other_lid")
|
|
63
|
-
applicationSubTypeOtherLidDetails String? @map("application_sub_type_other_lid_details")
|
|
64
|
-
applicationSubTypeOtherLidOther String? @map("application_sub_type_other_lid_other")
|
|
65
|
-
applicationSubTypeOtherLidOtherDetails String? @map("application_sub_type_other_lid_other_details")
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
queueId String[] @map("queue_id")
|
|
4
|
+
assignedToUserId String? @map("assigned_to_user_id")
|
|
5
|
+
applicationId String @unique @map("application_id")
|
|
6
|
+
isApplicationFeePaid String @map("is_application_fee_paid")
|
|
7
|
+
applicationNumber String @map("application_number")
|
|
8
|
+
applicationTypeLid String @map("application_type_lid")
|
|
9
|
+
bankSolicitor String @default("") @map("bank_solicitor")
|
|
10
|
+
brokerId String? @map("broker_id")
|
|
11
|
+
caseManager String @default("") @map("case_manager")
|
|
12
|
+
caseManagerAccepted String @default("false") @map("case_manager_accepted")
|
|
13
|
+
completedReason String @default("") @map("completed_reason")
|
|
14
|
+
isIntendToOccupy String @map("is_intend_to_occupy")
|
|
15
|
+
introducer String @default("") @map("introducer")
|
|
16
|
+
isIntroducerSubmission String @map("is_introducer_submission")
|
|
17
|
+
isBrokerAssigned String @default("false") @map("is_broker_assigned")
|
|
18
|
+
isFinanceRecommendedToApplicant String @map("is_finance_recommended_to_applicant")
|
|
19
|
+
isWorkflowTaskCreated String @map("is_workflow_task_created")
|
|
20
|
+
lastUpdated String? @map("last_updated")
|
|
21
|
+
lendingTypeLid String @map("lending_type_lid")
|
|
22
|
+
networkClubName String @default("") @map("network_club_name")
|
|
23
|
+
isNetworkClubSubmission String @map("is_network_club_submission")
|
|
24
|
+
newReason String @default("") @map("new_reason")
|
|
25
|
+
purchaseTypeLid String @map("purchase_type_lid")
|
|
26
|
+
rejectedReason String @default("") @map("rejected_reason")
|
|
27
|
+
repaymentTypeLid String @map("repayment_type_lid")
|
|
28
|
+
selectedProduct String? @map("selected_product")
|
|
29
|
+
sourceOfWealthLids String[] @map("source_of_wealth_lids")
|
|
30
|
+
sowBusiness String @default("") @map("sow_business")
|
|
31
|
+
sowInheritance String @default("") @map("sow_inheritance")
|
|
32
|
+
sowOther String @default("") @map("sow_other")
|
|
33
|
+
sowProperty String @default("") @map("sow_property")
|
|
34
|
+
sowSalary String @default("") @map("sow_salary")
|
|
35
|
+
statusLid String @map("status_lid")
|
|
36
|
+
submitReason String @default("") @map("submit_reason")
|
|
37
|
+
submittedDate String? @map("submitted_date")
|
|
38
|
+
underwriter String @default("") @map("underwriter")
|
|
39
|
+
isValuationFeePaid String @map("is_valuation_fee_paid")
|
|
40
|
+
withdrawalReason String @default("") @map("withdrawal_reason")
|
|
41
|
+
withdrawalReasonCode String @default("") @map("withdrawal_reason_code")
|
|
42
|
+
productId String? @map("product_id")
|
|
43
|
+
securityId String? @map("security_id")
|
|
44
|
+
solicitorId String? @map("solicitor_id")
|
|
45
|
+
isActive String @default("false") @map("is_active")
|
|
46
|
+
isUkResident String @default("true") @map("is_uk_resident")
|
|
47
|
+
riskRating String? @map("risk_rating")
|
|
48
|
+
directDebitId String? @map("direct_debit_id")
|
|
49
|
+
mortgageId String? @map("mortgage_id")
|
|
50
|
+
companyId String? @map("company_id")
|
|
51
|
+
rationaleId String? @map("rationale_id")
|
|
52
|
+
newAuditRecordsCount String @default("0") @map("new_audit_records_count")
|
|
53
|
+
currentApprivoAuditId String? @map("current_apprivo_audit_id")
|
|
54
|
+
applicantIds String[] @map("applicant_ids")
|
|
55
|
+
propertyIds String[] @map("property_ids")
|
|
66
56
|
|
|
67
57
|
// Relations
|
|
68
|
-
broker
|
|
69
|
-
security
|
|
70
|
-
solicitor
|
|
71
|
-
product
|
|
72
|
-
directDebit
|
|
58
|
+
broker Broker? @relation("ApplicationBroker", fields: [brokerId], references: [id])
|
|
59
|
+
security Security? @relation("ApplicationSecurity")
|
|
60
|
+
solicitor Solicitor? @relation("ApplicationSolicitor")
|
|
61
|
+
product Product? @relation("ApplicationProduct", fields: [productId], references: [id])
|
|
62
|
+
directDebit ApplicationDirectDebit? @relation("ApplicationDirectDebit")
|
|
73
63
|
creditProfile ApplicationCreditProfile? @relation("ApplicationCreditProfile")
|
|
74
|
-
mortgage
|
|
75
|
-
company
|
|
76
|
-
rationale
|
|
77
|
-
applicants
|
|
78
|
-
properties
|
|
79
|
-
documents
|
|
80
|
-
notes
|
|
81
|
-
audits
|
|
82
|
-
underwriters
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
64
|
+
mortgage ApplicationMortgage? @relation("ApplicationMortgage")
|
|
65
|
+
company ApplicationCompany? @relation("ApplicationCompany")
|
|
66
|
+
rationale ApplicationRationale? @relation("ApplicationRationale")
|
|
67
|
+
applicants Applicant[] @relation("ApplicationApplicants")
|
|
68
|
+
properties Property[] @relation("ApplicationProperties")
|
|
69
|
+
documents ApplicationDocument[]
|
|
70
|
+
notes ApplicationNote[]
|
|
71
|
+
audits ApplicationAudit[]
|
|
72
|
+
underwriters Underwriter[] @relation("ApplicationUnderwriters")
|
|
73
|
+
products ApplicationProduct[] @relation("ApplicationProducts")
|
|
74
|
+
companies Company[] @relation("Company")
|
|
75
|
+
|
|
87
76
|
// Lookup relations
|
|
88
|
-
applicationType
|
|
89
|
-
lendingType
|
|
90
|
-
purchaseType
|
|
91
|
-
repaymentType
|
|
77
|
+
applicationType Lookup @relation("ApplicationType", fields: [applicationTypeLid], references: [id])
|
|
78
|
+
lendingType Lookup @relation("LendingType", fields: [lendingTypeLid], references: [id])
|
|
79
|
+
purchaseType Lookup @relation("PurchaseType", fields: [purchaseTypeLid], references: [id])
|
|
80
|
+
repaymentType Lookup @relation("RepaymentType", fields: [repaymentTypeLid], references: [id])
|
|
81
|
+
status Lookup @relation("Status", fields: [statusLid], references: [id])
|
|
82
|
+
sourceOfWealth Lookup[] @relation("SourceOfWealth")
|
|
92
83
|
|
|
93
|
-
@@map("applications")
|
|
94
84
|
@@index([applicationTypeLid])
|
|
95
85
|
@@index([lendingTypeLid])
|
|
96
86
|
@@index([purchaseTypeLid])
|
|
97
87
|
@@index([statusLid])
|
|
98
88
|
@@index([repaymentTypeLid])
|
|
99
|
-
|
|
89
|
+
@@index([sourceOfWealthLids])
|
|
90
|
+
@@map("applications")
|
|
91
|
+
}
|
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
model Company {
|
|
2
|
-
id
|
|
3
|
-
applicationId
|
|
4
|
-
pageValidFlag
|
|
5
|
-
registeredName
|
|
6
|
-
businessTypeLid
|
|
7
|
-
registeredNumber
|
|
8
|
-
taxJurisdictionLid
|
|
9
|
-
tradingSince
|
|
10
|
-
natureOfBusiness
|
|
11
|
-
yearEnd
|
|
12
|
-
addressPostCode
|
|
13
|
-
addressLine1
|
|
14
|
-
addressLine2
|
|
15
|
-
addressLine3
|
|
16
|
-
addressCity
|
|
17
|
-
addressCountryLid
|
|
18
|
-
applicationTypeLid
|
|
19
|
-
yearEnd1
|
|
20
|
-
turnoverYear1
|
|
21
|
-
netProfitYear1
|
|
22
|
-
yearEnd2
|
|
23
|
-
turnoverYear2
|
|
24
|
-
netProfitYear2
|
|
25
|
-
yearEnd3
|
|
26
|
-
turnoverYear3
|
|
27
|
-
netProfitYear3
|
|
28
|
-
companyCreditDefaults
|
|
29
|
-
companyCountyCourtJudgment
|
|
30
|
-
companySecuredArrears
|
|
31
|
-
companyUnsecuredArrears
|
|
32
|
-
companyBankruptcy
|
|
33
|
-
companyBankruptcyYes
|
|
34
|
-
companyBankruptcyNo
|
|
35
|
-
companyCCJInLastThreeYearYes
|
|
36
|
-
companyCCJInLastThreeYearNo
|
|
37
|
-
companyDefaultsInLastYearYes
|
|
38
|
-
companyDefaultsInLastYearNo
|
|
39
|
-
companyAnyVoluntaryEnforcedPossessionYes Boolean
|
|
40
|
-
companyAnyVoluntaryEnforcedPossessionNo Boolean
|
|
41
|
-
doYouKnowRegisteredNumber
|
|
42
|
-
sicCodes
|
|
43
|
-
epc
|
|
44
|
-
remainingLease
|
|
45
|
-
dateOfIncorporation
|
|
46
|
-
createdAt
|
|
47
|
-
updatedAt
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
applicationId String @map("application_id")
|
|
4
|
+
pageValidFlag Boolean @default(true) @map("page_valid_flag")
|
|
5
|
+
registeredName String @map("registered_name")
|
|
6
|
+
businessTypeLid String @map("business_type_lid")
|
|
7
|
+
registeredNumber Int @map("registered_number")
|
|
8
|
+
taxJurisdictionLid String @map("tax_jurisdiction_lid")
|
|
9
|
+
tradingSince String? @map("trading_since")
|
|
10
|
+
natureOfBusiness String @default("") @map("nature_of_business")
|
|
11
|
+
yearEnd String? @map("year_end")
|
|
12
|
+
addressPostCode String @default("") @map("address_post_code")
|
|
13
|
+
addressLine1 String @map("address_line1")
|
|
14
|
+
addressLine2 String? @map("address_line2")
|
|
15
|
+
addressLine3 String? @map("address_line3")
|
|
16
|
+
addressCity String? @map("address_city")
|
|
17
|
+
addressCountryLid String @map("address_country_lid")
|
|
18
|
+
applicationTypeLid String @map("application_type_lid")
|
|
19
|
+
yearEnd1 Int @map("year_end1")
|
|
20
|
+
turnoverYear1 Decimal @default(0.00) @map("turnover_year1")
|
|
21
|
+
netProfitYear1 Decimal @default(0.00) @map("net_profit_year1")
|
|
22
|
+
yearEnd2 Int @map("year_end2")
|
|
23
|
+
turnoverYear2 Decimal @default(0.00) @map("turnover_year2")
|
|
24
|
+
netProfitYear2 Decimal @default(0.00) @map("net_profit_year2")
|
|
25
|
+
yearEnd3 Int @map("year_end3")
|
|
26
|
+
turnoverYear3 Decimal @default(0.00) @map("turnover_year3")
|
|
27
|
+
netProfitYear3 Decimal @default(0.00) @map("net_profit_year3")
|
|
28
|
+
companyCreditDefaults String @default("") @map("company_credit_defaults")
|
|
29
|
+
companyCountyCourtJudgment String @default("") @map("company_county_court_judgment")
|
|
30
|
+
companySecuredArrears String @default("") @map("company_secured_arrears")
|
|
31
|
+
companyUnsecuredArrears String @default("") @map("company_unsecured_arrears")
|
|
32
|
+
companyBankruptcy String @default("") @map("company_bankruptcy")
|
|
33
|
+
companyBankruptcyYes Boolean @default(false) @map("company_bankruptcy_yes")
|
|
34
|
+
companyBankruptcyNo Boolean @default(true) @map("company_bankruptcy_no")
|
|
35
|
+
companyCCJInLastThreeYearYes Boolean @default(false) @map("company_ccj_in_last_three_year_yes")
|
|
36
|
+
companyCCJInLastThreeYearNo Boolean @default(true) @map("company_ccj_in_last_three_year_no")
|
|
37
|
+
companyDefaultsInLastYearYes Boolean @default(false) @map("company_defaults_in_last_year_yes")
|
|
38
|
+
companyDefaultsInLastYearNo Boolean @default(true) @map("company_defaults_in_last_year_no")
|
|
39
|
+
companyAnyVoluntaryEnforcedPossessionYes Boolean @default(false) @map("company_any_voluntary_enforced_possession_yes")
|
|
40
|
+
companyAnyVoluntaryEnforcedPossessionNo Boolean @default(true) @map("company_any_voluntary_enforced_possession_no")
|
|
41
|
+
doYouKnowRegisteredNumber Boolean @default(true) @map("do_you_know_registered_number")
|
|
42
|
+
sicCodes String[] @map("sic_codes")
|
|
43
|
+
epc String @default("") @map("epc")
|
|
44
|
+
remainingLease String @default("") @map("remaining_lease")
|
|
45
|
+
dateOfIncorporation String? @map("date_of_incorporation")
|
|
46
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
47
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
48
48
|
|
|
49
49
|
// Relations
|
|
50
|
-
application
|
|
51
|
-
businessType
|
|
52
|
-
taxJurisdiction
|
|
53
|
-
addressCountry
|
|
54
|
-
applicationType
|
|
50
|
+
application Application @relation("Company", fields: [applicationId], references: [id])
|
|
51
|
+
businessType Lookup @relation("BusinessType", fields: [businessTypeLid], references: [id])
|
|
52
|
+
taxJurisdiction Lookup @relation("TaxJurisdiction", fields: [taxJurisdictionLid], references: [id])
|
|
53
|
+
addressCountry Lookup @relation("AddressCountry", fields: [addressCountryLid], references: [id])
|
|
54
|
+
applicationType Lookup @relation("ApplicationType", fields: [applicationTypeLid], references: [id])
|
|
55
55
|
applicantShareholdings ApplicantShareholding[]
|
|
56
56
|
|
|
57
57
|
@@map("companies")
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
model ApplicantShareholding {
|
|
61
|
-
id
|
|
62
|
-
companyId
|
|
63
|
-
applicantId
|
|
64
|
-
applicantName
|
|
61
|
+
id String @id @default(uuid())
|
|
62
|
+
companyId String @map("company_id")
|
|
63
|
+
applicantId String @map("applicant_id")
|
|
64
|
+
applicantName String @default("") @map("applicant_name")
|
|
65
65
|
directorShareholderLid String? @map("director_shareholder_lid")
|
|
66
|
-
shareholding
|
|
67
|
-
createdAt
|
|
68
|
-
updatedAt
|
|
66
|
+
shareholding Int? @map("shareholding")
|
|
67
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
68
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
69
69
|
|
|
70
70
|
// Relations
|
|
71
|
-
company
|
|
72
|
-
applicant
|
|
73
|
-
directorShareholder
|
|
71
|
+
company Company @relation(fields: [companyId], references: [id])
|
|
72
|
+
applicant Applicant @relation("ApplicantShareholdings", fields: [applicantId], references: [id])
|
|
73
|
+
directorShareholder Lookup? @relation("DirectorShareholder", fields: [directorShareholderLid], references: [id])
|
|
74
74
|
|
|
75
75
|
@@map("applicant_shareholdings")
|
|
76
|
-
}
|
|
76
|
+
}
|
|
@@ -26,7 +26,7 @@ model Solicitor {
|
|
|
26
26
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
27
27
|
|
|
28
28
|
// Relations
|
|
29
|
-
application Application @relation(fields: [applicationId], references: [id])
|
|
29
|
+
application Application @relation("ApplicationSolicitor", fields: [applicationId], references: [id])
|
|
30
30
|
addressCountry Lookup? @relation("AddressCountry", fields: [addressCountryLid], references: [id])
|
|
31
31
|
|
|
32
32
|
@@map("solicitors")
|
|
@@ -46,7 +46,7 @@ model Security {
|
|
|
46
46
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
47
47
|
|
|
48
48
|
// Relations
|
|
49
|
-
application Application @relation(fields: [applicationId], references: [id])
|
|
49
|
+
application Application @relation("ApplicationSecurity", fields: [applicationId], references: [id])
|
|
50
50
|
propertyAddressCountry Lookup @relation("PropertyAddressCountry", fields: [propertyAddressCountryLid], references: [id])
|
|
51
51
|
propertyTenure Lookup @relation("PropertyTenure", fields: [propertyTenureLid], references: [id])
|
|
52
52
|
propertyType Lookup? @relation("PropertyType", fields: [propertyTypeLid], references: [id])
|