@dynamatix/gb-schemas 1.2.111 → 1.2.113
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-credit-data.model.js +11 -11
- package/dist/applicants/applicant-credit-profile.model.js +20 -20
- package/dist/applicants/applicant-direct-debit.model.js +17 -17
- package/dist/applicants/applicant-employment.model.js +48 -48
- package/dist/applicants/applicant-expenditure.model.d.ts +0 -18
- package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -1
- package/dist/applicants/applicant-expenditure.model.js +69 -69
- package/dist/applicants/applicant-income.model.js +78 -78
- package/dist/applicants/applicant-risk-narrative.model.js +13 -13
- package/dist/applicants/applicant-self-employed-income.model.d.ts +20 -20
- package/dist/applicants/applicant-self-employed-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-self-employed-income.model.js +5 -5
- package/dist/applicants/applicant-sole-trader-income.model.d.ts +6 -6
- package/dist/applicants/applicant-sole-trader-income.model.js +1 -1
- package/dist/applicants/applicant.model.d.ts +4 -0
- package/dist/applicants/applicant.model.d.ts.map +1 -1
- package/dist/applicants/applicant.model.js +222 -222
- package/dist/applicants/index.js +18 -18
- package/dist/applications/application-audit.model.js +42 -42
- package/dist/applications/application-checklist-Item.model.js +45 -45
- package/dist/applications/application-company-model.js +120 -120
- package/dist/applications/application-credit-profile.model.js +12 -12
- package/dist/applications/application-direct-debit.model.js +92 -92
- package/dist/applications/application-document.model.js +35 -35
- package/dist/applications/application-fieldconfig.model.js +7 -7
- package/dist/applications/application-illustration-model.js +6 -6
- package/dist/applications/application-legal.model.js +7 -7
- package/dist/applications/application-mortgage.model.js +268 -268
- package/dist/applications/application-note.model.js +78 -78
- package/dist/applications/application-offer.model.js +6 -6
- package/dist/applications/application-onboarding.model.js +9 -9
- package/dist/applications/application-product.model.js +67 -67
- package/dist/applications/application-rationale.model.js +38 -38
- package/dist/applications/application-risk-narrative.model.js +12 -12
- package/dist/applications/application-valuation.model.js +15 -15
- package/dist/applications/application.model.js +153 -153
- package/dist/applications/broker.model.js +21 -21
- package/dist/applications/document.model.js +35 -35
- package/dist/applications/index.js +20 -20
- package/dist/applications/solicitor.model.js +114 -114
- package/dist/index.js +7 -7
- package/dist/product-catalogues/index.js +3 -3
- package/dist/product-catalogues/product-catalogue.model.js +18 -18
- package/dist/product-catalogues/product-definitions.model.js +26 -26
- package/dist/product-catalogues/product-variant.model.js +12 -12
- package/dist/properties/index.js +2 -2
- package/dist/properties/property.model.js +144 -144
- package/dist/shared/alert.model.js +24 -24
- package/dist/shared/apprivo-sync-journey.model.js +17 -17
- package/dist/shared/checklist.model.js +30 -30
- package/dist/shared/document-type-model.js +10 -10
- package/dist/shared/index.js +12 -12
- package/dist/shared/job-run.model.js +14 -14
- package/dist/shared/job-setting.model.js +11 -11
- package/dist/shared/lookup-group.model.js +16 -16
- package/dist/shared/lookup.model.js +20 -20
- package/dist/shared/system-parameter.model.js +32 -32
- package/dist/shared/task-document.model.js +23 -23
- package/dist/shared/task.model.js +15 -15
- package/dist/underwriter/index.js +1 -1
- package/dist/underwriter/underwriter.model.js +17 -17
- package/dist/users/auth-log.model.js +21 -21
- package/dist/users/index.js +6 -6
- package/dist/users/permission.model.js +10 -10
- package/dist/users/role-group.model.js +14 -14
- package/dist/users/role.model.js +13 -13
- package/dist/users/tasks.model.js +15 -15
- package/dist/users/user.model.js +30 -30
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const applicantCreditDataSchema = new mongoose.Schema({
|
|
3
|
-
bankruptcy: { type: String, required: true },
|
|
4
|
-
countyCourtJudgment: { type: String, required: true },
|
|
5
|
-
creditDefaults: { type: String },
|
|
6
|
-
securedArrears: { type: String, required: true },
|
|
7
|
-
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null, required: true },
|
|
8
|
-
unsecuredArrears: { type: String, required: true },
|
|
9
|
-
valid: { type: String, required: true },
|
|
10
|
-
});
|
|
11
|
-
export default applicantCreditDataSchema;
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
const applicantCreditDataSchema = new mongoose.Schema({
|
|
3
|
+
bankruptcy: { type: String, required: true },
|
|
4
|
+
countyCourtJudgment: { type: String, required: true },
|
|
5
|
+
creditDefaults: { type: String },
|
|
6
|
+
securedArrears: { type: String, required: true },
|
|
7
|
+
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null, required: true },
|
|
8
|
+
unsecuredArrears: { type: String, required: true },
|
|
9
|
+
valid: { type: String, required: true },
|
|
10
|
+
});
|
|
11
|
+
export default applicantCreditDataSchema;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const creditProfileSchema = new mongoose.Schema({
|
|
3
|
-
anyVoluntaryEnforcedPossessionNo: {
|
|
4
|
-
type: String,
|
|
5
|
-
required: true
|
|
6
|
-
},
|
|
7
|
-
bankruptcyNo: {
|
|
8
|
-
type: String,
|
|
9
|
-
required: true
|
|
10
|
-
},
|
|
11
|
-
ccjInLastThreeYearNo: {
|
|
12
|
-
type: String,
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
15
|
-
defaultsInLastYearNo: {
|
|
16
|
-
type: String,
|
|
17
|
-
required: true
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
export default creditProfileSchema;
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
const creditProfileSchema = new mongoose.Schema({
|
|
3
|
+
anyVoluntaryEnforcedPossessionNo: {
|
|
4
|
+
type: String,
|
|
5
|
+
required: true
|
|
6
|
+
},
|
|
7
|
+
bankruptcyNo: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
ccjInLastThreeYearNo: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
defaultsInLastYearNo: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export default creditProfileSchema;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import mongoose from 'mongoose';
|
|
2
|
-
const applicantDirectDebitSchema = new mongoose.Schema({
|
|
3
|
-
applicationId: { type: mongoose.Schema.Types.ObjectId, ref: 'Application' },
|
|
4
|
-
accountNumber: { type: String },
|
|
5
|
-
addressLine1: { type: String },
|
|
6
|
-
addressLine2: { type: String },
|
|
7
|
-
Applicants: { type: String },
|
|
8
|
-
branch: { type: String },
|
|
9
|
-
city: { type: String },
|
|
10
|
-
contactPostcode: { type: String },
|
|
11
|
-
institution: { type: String },
|
|
12
|
-
isConfirmDeclaration: { type: String, default: false },
|
|
13
|
-
nameOfAccountHolder: { type: String },
|
|
14
|
-
selectedPaymentDay: { type: String },
|
|
15
|
-
sortCode: { type: String }
|
|
16
|
-
}, { timestamps: true });
|
|
17
|
-
export default applicantDirectDebitSchema;
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
const applicantDirectDebitSchema = new mongoose.Schema({
|
|
3
|
+
applicationId: { type: mongoose.Schema.Types.ObjectId, ref: 'Application' },
|
|
4
|
+
accountNumber: { type: String },
|
|
5
|
+
addressLine1: { type: String },
|
|
6
|
+
addressLine2: { type: String },
|
|
7
|
+
Applicants: { type: String },
|
|
8
|
+
branch: { type: String },
|
|
9
|
+
city: { type: String },
|
|
10
|
+
contactPostcode: { type: String },
|
|
11
|
+
institution: { type: String },
|
|
12
|
+
isConfirmDeclaration: { type: String, default: false },
|
|
13
|
+
nameOfAccountHolder: { type: String },
|
|
14
|
+
selectedPaymentDay: { type: String },
|
|
15
|
+
sortCode: { type: String }
|
|
16
|
+
}, { timestamps: true });
|
|
17
|
+
export default applicantDirectDebitSchema;
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
import { Pound } from "../value-objects/pound";
|
|
3
|
-
const applicantEmploymentSchema = new mongoose.Schema({
|
|
4
|
-
applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
|
|
5
|
-
acceptableIncomeLids: [{ type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }],
|
|
6
|
-
addressCity: { type: String, default: null },
|
|
7
|
-
addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
8
|
-
addressLine1: { type: String, required: true },
|
|
9
|
-
addressLine2: { type: String, default: null },
|
|
10
|
-
addressLine3: { type: String, default: null },
|
|
11
|
-
addressPostCode: { type: String, required: true },
|
|
12
|
-
averageBonusPreviousTwoYears: { type: Pound, default: 0.00 },
|
|
13
|
-
basicGrossIncome: { type: Pound, default: 0.00 },
|
|
14
|
-
contractRemaining: { type: String },
|
|
15
|
-
dateJoined: { type: String, required: true },
|
|
16
|
-
disabilityLiving: { type: Pound, default: 0.00 },
|
|
17
|
-
employerName: { type: String, required: true },
|
|
18
|
-
employerTelephone: { type: String, default: null },
|
|
19
|
-
housingAllowance: { type: Pound, default: 0.00 },
|
|
20
|
-
industryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
21
|
-
isUnderTerminationNotice: { type: Boolean, default: false },
|
|
22
|
-
jobTitleLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
23
|
-
maintenance: { type: Pound, default: 0.00 },
|
|
24
|
-
maternityIncome: { type: Pound, default: 0.00 },
|
|
25
|
-
natureOfBusiness: { type: String, required: true },
|
|
26
|
-
pensionIncome: { type: Pound, default: 0.00 },
|
|
27
|
-
previousAddressCity: { type: String, default: null },
|
|
28
|
-
previousAddressCountry: { type: String, required: true },
|
|
29
|
-
previousAddressLine1: { type: String, required: true },
|
|
30
|
-
previousAddressLine2: { type: String, default: null },
|
|
31
|
-
previousAddressLine3: { type: String, default: null },
|
|
32
|
-
previousAddressPostCode: { type: String, required: true },
|
|
33
|
-
previousBasicGrossIncome: { type: Pound, default: 0.00, required: true },
|
|
34
|
-
previousDateJoined: { type: String, required: true },
|
|
35
|
-
previousDateLeft: { type: String, required: true },
|
|
36
|
-
previousEmployerName: { type: String, required: true },
|
|
37
|
-
previousEmployerTelephone: { type: String, default: null },
|
|
38
|
-
previousJobTitle: { type: String, required: true },
|
|
39
|
-
previousNatureOfBusiness: { type: String, required: true },
|
|
40
|
-
referenceContact: { type: String, default: null },
|
|
41
|
-
referenceContactEmail: { type: String, required: true },
|
|
42
|
-
underTerminationNoticeNote: { type: String, default: null }
|
|
43
|
-
}, {
|
|
44
|
-
toJSON: { getters: true },
|
|
45
|
-
toObject: { getters: true }
|
|
46
|
-
});
|
|
47
|
-
const ApplicantEmployment = mongoose.model("Applicant_Employment_Information", applicantEmploymentSchema);
|
|
48
|
-
export default ApplicantEmployment;
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { Pound } from "../value-objects/pound";
|
|
3
|
+
const applicantEmploymentSchema = new mongoose.Schema({
|
|
4
|
+
applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
|
|
5
|
+
acceptableIncomeLids: [{ type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }],
|
|
6
|
+
addressCity: { type: String, default: null },
|
|
7
|
+
addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
8
|
+
addressLine1: { type: String, required: true },
|
|
9
|
+
addressLine2: { type: String, default: null },
|
|
10
|
+
addressLine3: { type: String, default: null },
|
|
11
|
+
addressPostCode: { type: String, required: true },
|
|
12
|
+
averageBonusPreviousTwoYears: { type: Pound, default: 0.00 },
|
|
13
|
+
basicGrossIncome: { type: Pound, default: 0.00 },
|
|
14
|
+
contractRemaining: { type: String },
|
|
15
|
+
dateJoined: { type: String, required: true },
|
|
16
|
+
disabilityLiving: { type: Pound, default: 0.00 },
|
|
17
|
+
employerName: { type: String, required: true },
|
|
18
|
+
employerTelephone: { type: String, default: null },
|
|
19
|
+
housingAllowance: { type: Pound, default: 0.00 },
|
|
20
|
+
industryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
21
|
+
isUnderTerminationNotice: { type: Boolean, default: false },
|
|
22
|
+
jobTitleLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
23
|
+
maintenance: { type: Pound, default: 0.00 },
|
|
24
|
+
maternityIncome: { type: Pound, default: 0.00 },
|
|
25
|
+
natureOfBusiness: { type: String, required: true },
|
|
26
|
+
pensionIncome: { type: Pound, default: 0.00 },
|
|
27
|
+
previousAddressCity: { type: String, default: null },
|
|
28
|
+
previousAddressCountry: { type: String, required: true },
|
|
29
|
+
previousAddressLine1: { type: String, required: true },
|
|
30
|
+
previousAddressLine2: { type: String, default: null },
|
|
31
|
+
previousAddressLine3: { type: String, default: null },
|
|
32
|
+
previousAddressPostCode: { type: String, required: true },
|
|
33
|
+
previousBasicGrossIncome: { type: Pound, default: 0.00, required: true },
|
|
34
|
+
previousDateJoined: { type: String, required: true },
|
|
35
|
+
previousDateLeft: { type: String, required: true },
|
|
36
|
+
previousEmployerName: { type: String, required: true },
|
|
37
|
+
previousEmployerTelephone: { type: String, default: null },
|
|
38
|
+
previousJobTitle: { type: String, required: true },
|
|
39
|
+
previousNatureOfBusiness: { type: String, required: true },
|
|
40
|
+
referenceContact: { type: String, default: null },
|
|
41
|
+
referenceContactEmail: { type: String, required: true },
|
|
42
|
+
underTerminationNoticeNote: { type: String, default: null }
|
|
43
|
+
}, {
|
|
44
|
+
toJSON: { getters: true },
|
|
45
|
+
toObject: { getters: true }
|
|
46
|
+
});
|
|
47
|
+
const ApplicantEmployment = mongoose.model("Applicant_Employment_Information", applicantEmploymentSchema);
|
|
48
|
+
export default ApplicantEmployment;
|
|
@@ -7,9 +7,6 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
|
|
|
7
7
|
applicantId: mongoose.Types.ObjectId;
|
|
8
8
|
isFixed: boolean;
|
|
9
9
|
expenditureTypeLid: mongoose.Types.ObjectId;
|
|
10
|
-
proposedFinanceAmount: number;
|
|
11
|
-
topupAmount: number;
|
|
12
|
-
creditCommitments: number;
|
|
13
10
|
declared?: Pound | null | undefined;
|
|
14
11
|
ons?: Pound | null | undefined;
|
|
15
12
|
actual?: Pound | null | undefined;
|
|
@@ -21,9 +18,6 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
|
|
|
21
18
|
applicantId: mongoose.Types.ObjectId;
|
|
22
19
|
isFixed: boolean;
|
|
23
20
|
expenditureTypeLid: mongoose.Types.ObjectId;
|
|
24
|
-
proposedFinanceAmount: number;
|
|
25
|
-
topupAmount: number;
|
|
26
|
-
creditCommitments: number;
|
|
27
21
|
declared?: Pound | null | undefined;
|
|
28
22
|
ons?: Pound | null | undefined;
|
|
29
23
|
actual?: Pound | null | undefined;
|
|
@@ -35,9 +29,6 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
|
|
|
35
29
|
applicantId: mongoose.Types.ObjectId;
|
|
36
30
|
isFixed: boolean;
|
|
37
31
|
expenditureTypeLid: mongoose.Types.ObjectId;
|
|
38
|
-
proposedFinanceAmount: number;
|
|
39
|
-
topupAmount: number;
|
|
40
|
-
creditCommitments: number;
|
|
41
32
|
declared?: Pound | null | undefined;
|
|
42
33
|
ons?: Pound | null | undefined;
|
|
43
34
|
actual?: Pound | null | undefined;
|
|
@@ -61,9 +52,6 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
|
|
|
61
52
|
applicantId: mongoose.Types.ObjectId;
|
|
62
53
|
isFixed: boolean;
|
|
63
54
|
expenditureTypeLid: mongoose.Types.ObjectId;
|
|
64
|
-
proposedFinanceAmount: number;
|
|
65
|
-
topupAmount: number;
|
|
66
|
-
creditCommitments: number;
|
|
67
55
|
declared?: Pound | null | undefined;
|
|
68
56
|
ons?: Pound | null | undefined;
|
|
69
57
|
actual?: Pound | null | undefined;
|
|
@@ -75,9 +63,6 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
|
|
|
75
63
|
applicantId: mongoose.Types.ObjectId;
|
|
76
64
|
isFixed: boolean;
|
|
77
65
|
expenditureTypeLid: mongoose.Types.ObjectId;
|
|
78
|
-
proposedFinanceAmount: number;
|
|
79
|
-
topupAmount: number;
|
|
80
|
-
creditCommitments: number;
|
|
81
66
|
declared?: Pound | null | undefined;
|
|
82
67
|
ons?: Pound | null | undefined;
|
|
83
68
|
actual?: Pound | null | undefined;
|
|
@@ -89,9 +74,6 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
|
|
|
89
74
|
applicantId: mongoose.Types.ObjectId;
|
|
90
75
|
isFixed: boolean;
|
|
91
76
|
expenditureTypeLid: mongoose.Types.ObjectId;
|
|
92
|
-
proposedFinanceAmount: number;
|
|
93
|
-
topupAmount: number;
|
|
94
|
-
creditCommitments: number;
|
|
95
77
|
declared?: Pound | null | undefined;
|
|
96
78
|
ons?: Pound | null | undefined;
|
|
97
79
|
actual?: Pound | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-expenditure.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-expenditure.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-expenditure.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-expenditure.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAmE/C,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuE,CAAC;AACvG,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
import { Pound } from "../value-objects/pound";
|
|
3
|
-
const applicantExpenditureSchema = new mongoose.Schema({
|
|
4
|
-
applicantId: {
|
|
5
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
-
ref: "Applicant",
|
|
7
|
-
required: true,
|
|
8
|
-
description: "Reference to the applicant this expenditure record belongs to.",
|
|
9
|
-
},
|
|
10
|
-
isFixed: {
|
|
11
|
-
type: Boolean,
|
|
12
|
-
default: false,
|
|
13
|
-
description: "True if all mandatory fields have been completed, otherwise false.",
|
|
14
|
-
},
|
|
15
|
-
expenditureTypeLid: {
|
|
16
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
17
|
-
ref: "Lookup",
|
|
18
|
-
default: null,
|
|
19
|
-
description: "Essential expenditure lookup",
|
|
20
|
-
},
|
|
21
|
-
declared: {
|
|
22
|
-
type: Pound,
|
|
23
|
-
description: "Declared monthly expenditure amount provided by the applicant.",
|
|
24
|
-
},
|
|
25
|
-
ons: {
|
|
26
|
-
type: Pound,
|
|
27
|
-
description: "Office for National Statistics (ONS) benchmark monthly expenditure.",
|
|
28
|
-
},
|
|
29
|
-
actual: {
|
|
30
|
-
type: Pound,
|
|
31
|
-
description: "Actual monthly expenditure verified based on applicant's evidence.",
|
|
32
|
-
},
|
|
33
|
-
rationale: {
|
|
34
|
-
type: String,
|
|
35
|
-
description: "Rationalized monthly expenditure used for affordability assessment.",
|
|
36
|
-
},
|
|
37
|
-
proposedFinanceAmount: {
|
|
38
|
-
type: Number,
|
|
39
|
-
default: 0,
|
|
40
|
-
description: "Proposed finance amount for fixed expenditures, defaults to 0.",
|
|
41
|
-
},
|
|
42
|
-
topupAmount: {
|
|
43
|
-
type: Number,
|
|
44
|
-
default: 0,
|
|
45
|
-
description: "Top-up amount for fixed expenditures, defaults to 0.",
|
|
46
|
-
},
|
|
47
|
-
creditCommitments: {
|
|
48
|
-
type: Number,
|
|
49
|
-
default: 0,
|
|
50
|
-
description: "Total credit commitments amount, defaults to 0.",
|
|
51
|
-
},
|
|
52
|
-
}, {
|
|
53
|
-
timestamps: true,
|
|
54
|
-
toJSON: { virtuals: true },
|
|
55
|
-
toObject: { virtuals: true },
|
|
56
|
-
});
|
|
57
|
-
// Virtual property for essentialExpenditure
|
|
58
|
-
const virtualEssentialExpenditure = applicantExpenditureSchema.virtual("ExpenditureType", {
|
|
59
|
-
ref: "Lookup",
|
|
60
|
-
localField: "expenditureTypeLid",
|
|
61
|
-
foreignField: "_id",
|
|
62
|
-
justOne: true,
|
|
63
|
-
options: {
|
|
64
|
-
select: "label",
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
virtualEssentialExpenditure.description = "Populated lookup value for essential expenditure.";
|
|
68
|
-
const ApplicantExpenditureModel = mongoose.model("Applicant_Expenditure", applicantExpenditureSchema);
|
|
69
|
-
export default ApplicantExpenditureModel;
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { Pound } from "../value-objects/pound";
|
|
3
|
+
const applicantExpenditureSchema = new mongoose.Schema({
|
|
4
|
+
applicantId: {
|
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
+
ref: "Applicant",
|
|
7
|
+
required: true,
|
|
8
|
+
description: "Reference to the applicant this expenditure record belongs to.",
|
|
9
|
+
},
|
|
10
|
+
isFixed: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
description: "True if all mandatory fields have been completed, otherwise false.",
|
|
14
|
+
},
|
|
15
|
+
expenditureTypeLid: {
|
|
16
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
17
|
+
ref: "Lookup",
|
|
18
|
+
default: null,
|
|
19
|
+
description: "Essential expenditure lookup",
|
|
20
|
+
},
|
|
21
|
+
declared: {
|
|
22
|
+
type: Pound,
|
|
23
|
+
description: "Declared monthly expenditure amount provided by the applicant.",
|
|
24
|
+
},
|
|
25
|
+
ons: {
|
|
26
|
+
type: Pound,
|
|
27
|
+
description: "Office for National Statistics (ONS) benchmark monthly expenditure.",
|
|
28
|
+
},
|
|
29
|
+
actual: {
|
|
30
|
+
type: Pound,
|
|
31
|
+
description: "Actual monthly expenditure verified based on applicant's evidence.",
|
|
32
|
+
},
|
|
33
|
+
rationale: {
|
|
34
|
+
type: String,
|
|
35
|
+
description: "Rationalized monthly expenditure used for affordability assessment.",
|
|
36
|
+
},
|
|
37
|
+
proposedFinanceAmount: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 0,
|
|
40
|
+
description: "Proposed finance amount for fixed expenditures, defaults to 0.",
|
|
41
|
+
},
|
|
42
|
+
topupAmount: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 0,
|
|
45
|
+
description: "Top-up amount for fixed expenditures, defaults to 0.",
|
|
46
|
+
},
|
|
47
|
+
creditCommitments: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: 0,
|
|
50
|
+
description: "Total credit commitments amount, defaults to 0.",
|
|
51
|
+
},
|
|
52
|
+
}, {
|
|
53
|
+
timestamps: true,
|
|
54
|
+
toJSON: { virtuals: true },
|
|
55
|
+
toObject: { virtuals: true },
|
|
56
|
+
});
|
|
57
|
+
// Virtual property for essentialExpenditure
|
|
58
|
+
const virtualEssentialExpenditure = applicantExpenditureSchema.virtual("ExpenditureType", {
|
|
59
|
+
ref: "Lookup",
|
|
60
|
+
localField: "expenditureTypeLid",
|
|
61
|
+
foreignField: "_id",
|
|
62
|
+
justOne: true,
|
|
63
|
+
options: {
|
|
64
|
+
select: "label",
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
virtualEssentialExpenditure.description = "Populated lookup value for essential expenditure.";
|
|
68
|
+
const ApplicantExpenditureModel = mongoose.model("Applicant_Expenditure", applicantExpenditureSchema);
|
|
69
|
+
export default ApplicantExpenditureModel;
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
import { Pound } from "../value-objects/pound";
|
|
3
|
-
const incomeSchema = new mongoose.Schema({
|
|
4
|
-
applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
|
|
5
|
-
accountantsAddressLine1: { type: String, required: true },
|
|
6
|
-
accountantsAddressLine2: { type: String, required: true },
|
|
7
|
-
accountantsAddressLine3: { type: String, required: true },
|
|
8
|
-
accountantsCity: { type: String, default: '' },
|
|
9
|
-
accountantsCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
10
|
-
accountantsEmail: { type: String, required: true },
|
|
11
|
-
accountantsPostCode: { type: String, required: true },
|
|
12
|
-
accountantsPractice: { type: String, required: true },
|
|
13
|
-
accountantsTelephoneNumber: { type: String, required: true },
|
|
14
|
-
businessAddressLine1: { type: String, required: true },
|
|
15
|
-
businessAddressLine2: { type: String, required: true },
|
|
16
|
-
businessAddressLine3: { type: String, required: true },
|
|
17
|
-
businessCity: { type: String, default: '' },
|
|
18
|
-
businessCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
19
|
-
businessPostCode: { type: String, required: true },
|
|
20
|
-
businessTelephoneNumber: { type: String, required: true },
|
|
21
|
-
businessTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
22
|
-
charteredCertifiedOrOtherLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
23
|
-
contactName: { type: String, required: true },
|
|
24
|
-
currentYearEnd: { type: String, required: true },
|
|
25
|
-
dateEstablished: { type: String, required: true },
|
|
26
|
-
doYouHaveAccountant: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
required: true,
|
|
29
|
-
},
|
|
30
|
-
isBusinessAddressDifferent: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
required: true,
|
|
33
|
-
},
|
|
34
|
-
nameOfBusiness: { type: String, required: true },
|
|
35
|
-
natureOfBusiness: { type: String, required: true },
|
|
36
|
-
netAssets1: { type: Pound, default: 0.00 },
|
|
37
|
-
netAssets2: { type: Pound, default: 0.00 },
|
|
38
|
-
netAssets3: { type: Pound, default: 0.00 },
|
|
39
|
-
pageValidFlag: { type: String, default: true },
|
|
40
|
-
percentageOfShareholding: { type: Number, required: true, min: 0, max: 100 },
|
|
41
|
-
registeredAddressLine1: { type: String, required: true },
|
|
42
|
-
registeredAddressLine2: { type: String, required: true },
|
|
43
|
-
registeredAddressLine3: { type: String, required: true },
|
|
44
|
-
registeredCity: { type: String, default: '' },
|
|
45
|
-
registeredCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
46
|
-
registeredPostCode: { type: String, required: true },
|
|
47
|
-
registeredTelephone: { type: String, required: true },
|
|
48
|
-
selfEmployedDate: { type: String, required: true },
|
|
49
|
-
totalEmploymentGrossIncome: { type: Pound, default: 0.00 },
|
|
50
|
-
totalEmploymentNetIncome: { type: Pound, default: 0.00 },
|
|
51
|
-
isEmploymentIncomeConfirmed: { type: Boolean, default: false },
|
|
52
|
-
employmentIncomeRationale: { type: String, default: null },
|
|
53
|
-
isPensionIncomeConfirmed: { type: Boolean, default: false },
|
|
54
|
-
pensionIncomeRationale: { type: String, default: null },
|
|
55
|
-
totalAdditionalGrossIncome: { type: Pound, default: 0.00 },
|
|
56
|
-
totalAdditionalNetIncome: { type: Pound, default: 0.00 },
|
|
57
|
-
isAdditionalIncomeConfirmed: { type: Boolean, default: false },
|
|
58
|
-
additionalIncomeRationale: { type: String, default: null },
|
|
59
|
-
isUKTaxCreditsIncomeConfirmed: { type: Boolean, default: false },
|
|
60
|
-
ukTaxCreditsIncomeRationale: { type: String, default: null },
|
|
61
|
-
totalPropertyGrossIncome: { type: Pound, default: 0.00 },
|
|
62
|
-
totalPropertyNetIncome: { type: Pound, default: 0.00 },
|
|
63
|
-
isPropertyIncomeConfirmed: { type: Boolean, default: false },
|
|
64
|
-
propertyIncomeRationale: { type: String, default: null },
|
|
65
|
-
selfEmployedIncomeRationale: { type: String, default: null },
|
|
66
|
-
isSelfEmployedIncomeConfirmed: { type: Boolean, default: false },
|
|
67
|
-
totalSelfEmployedGrossIncome: { type: Pound, default: 0.00 },
|
|
68
|
-
totalSelfEmployedNetIncome: { type: Pound, default: 0.00 },
|
|
69
|
-
soleTraderIncomeRationale: { type: String, default: null },
|
|
70
|
-
soleTraderIncomeConfirmed: { type: Boolean, default: false },
|
|
71
|
-
soleTraderGrossIncome: { type: Pound, default: 0.00 },
|
|
72
|
-
soleTraderNetIncome: { type: Pound, default: 0.00 },
|
|
73
|
-
}, {
|
|
74
|
-
toJSON: { getters: true },
|
|
75
|
-
toObject: { getters: true }
|
|
76
|
-
});
|
|
77
|
-
const ApplicantIncomeModel = mongoose.model("Applicant_Income", incomeSchema);
|
|
78
|
-
export default ApplicantIncomeModel;
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { Pound } from "../value-objects/pound";
|
|
3
|
+
const incomeSchema = new mongoose.Schema({
|
|
4
|
+
applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
|
|
5
|
+
accountantsAddressLine1: { type: String, required: true },
|
|
6
|
+
accountantsAddressLine2: { type: String, required: true },
|
|
7
|
+
accountantsAddressLine3: { type: String, required: true },
|
|
8
|
+
accountantsCity: { type: String, default: '' },
|
|
9
|
+
accountantsCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
10
|
+
accountantsEmail: { type: String, required: true },
|
|
11
|
+
accountantsPostCode: { type: String, required: true },
|
|
12
|
+
accountantsPractice: { type: String, required: true },
|
|
13
|
+
accountantsTelephoneNumber: { type: String, required: true },
|
|
14
|
+
businessAddressLine1: { type: String, required: true },
|
|
15
|
+
businessAddressLine2: { type: String, required: true },
|
|
16
|
+
businessAddressLine3: { type: String, required: true },
|
|
17
|
+
businessCity: { type: String, default: '' },
|
|
18
|
+
businessCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
19
|
+
businessPostCode: { type: String, required: true },
|
|
20
|
+
businessTelephoneNumber: { type: String, required: true },
|
|
21
|
+
businessTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
22
|
+
charteredCertifiedOrOtherLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
23
|
+
contactName: { type: String, required: true },
|
|
24
|
+
currentYearEnd: { type: String, required: true },
|
|
25
|
+
dateEstablished: { type: String, required: true },
|
|
26
|
+
doYouHaveAccountant: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
isBusinessAddressDifferent: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
nameOfBusiness: { type: String, required: true },
|
|
35
|
+
natureOfBusiness: { type: String, required: true },
|
|
36
|
+
netAssets1: { type: Pound, default: 0.00 },
|
|
37
|
+
netAssets2: { type: Pound, default: 0.00 },
|
|
38
|
+
netAssets3: { type: Pound, default: 0.00 },
|
|
39
|
+
pageValidFlag: { type: String, default: true },
|
|
40
|
+
percentageOfShareholding: { type: Number, required: true, min: 0, max: 100 },
|
|
41
|
+
registeredAddressLine1: { type: String, required: true },
|
|
42
|
+
registeredAddressLine2: { type: String, required: true },
|
|
43
|
+
registeredAddressLine3: { type: String, required: true },
|
|
44
|
+
registeredCity: { type: String, default: '' },
|
|
45
|
+
registeredCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
46
|
+
registeredPostCode: { type: String, required: true },
|
|
47
|
+
registeredTelephone: { type: String, required: true },
|
|
48
|
+
selfEmployedDate: { type: String, required: true },
|
|
49
|
+
totalEmploymentGrossIncome: { type: Pound, default: 0.00 },
|
|
50
|
+
totalEmploymentNetIncome: { type: Pound, default: 0.00 },
|
|
51
|
+
isEmploymentIncomeConfirmed: { type: Boolean, default: false },
|
|
52
|
+
employmentIncomeRationale: { type: String, default: null },
|
|
53
|
+
isPensionIncomeConfirmed: { type: Boolean, default: false },
|
|
54
|
+
pensionIncomeRationale: { type: String, default: null },
|
|
55
|
+
totalAdditionalGrossIncome: { type: Pound, default: 0.00 },
|
|
56
|
+
totalAdditionalNetIncome: { type: Pound, default: 0.00 },
|
|
57
|
+
isAdditionalIncomeConfirmed: { type: Boolean, default: false },
|
|
58
|
+
additionalIncomeRationale: { type: String, default: null },
|
|
59
|
+
isUKTaxCreditsIncomeConfirmed: { type: Boolean, default: false },
|
|
60
|
+
ukTaxCreditsIncomeRationale: { type: String, default: null },
|
|
61
|
+
totalPropertyGrossIncome: { type: Pound, default: 0.00 },
|
|
62
|
+
totalPropertyNetIncome: { type: Pound, default: 0.00 },
|
|
63
|
+
isPropertyIncomeConfirmed: { type: Boolean, default: false },
|
|
64
|
+
propertyIncomeRationale: { type: String, default: null },
|
|
65
|
+
selfEmployedIncomeRationale: { type: String, default: null },
|
|
66
|
+
isSelfEmployedIncomeConfirmed: { type: Boolean, default: false },
|
|
67
|
+
totalSelfEmployedGrossIncome: { type: Pound, default: 0.00 },
|
|
68
|
+
totalSelfEmployedNetIncome: { type: Pound, default: 0.00 },
|
|
69
|
+
soleTraderIncomeRationale: { type: String, default: null },
|
|
70
|
+
soleTraderIncomeConfirmed: { type: Boolean, default: false },
|
|
71
|
+
soleTraderGrossIncome: { type: Pound, default: 0.00 },
|
|
72
|
+
soleTraderNetIncome: { type: Pound, default: 0.00 },
|
|
73
|
+
}, {
|
|
74
|
+
toJSON: { getters: true },
|
|
75
|
+
toObject: { getters: true }
|
|
76
|
+
});
|
|
77
|
+
const ApplicantIncomeModel = mongoose.model("Applicant_Income", incomeSchema);
|
|
78
|
+
export default ApplicantIncomeModel;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import mongoose from 'mongoose';
|
|
2
|
-
const applicantRiskNarrativeSchema = new mongoose.Schema({
|
|
3
|
-
call2StatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
4
|
-
clientReference: { type: String },
|
|
5
|
-
docVerificationStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
6
|
-
isPoaTaskGenerated: { type: String },
|
|
7
|
-
link: { type: String },
|
|
8
|
-
riskLevel: { type: String },
|
|
9
|
-
riskRating: { type: String },
|
|
10
|
-
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
11
|
-
verificationLinkSentOn: { type: String }
|
|
12
|
-
});
|
|
13
|
-
export default applicantRiskNarrativeSchema;
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
const applicantRiskNarrativeSchema = new mongoose.Schema({
|
|
3
|
+
call2StatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
4
|
+
clientReference: { type: String },
|
|
5
|
+
docVerificationStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
6
|
+
isPoaTaskGenerated: { type: String },
|
|
7
|
+
link: { type: String },
|
|
8
|
+
riskLevel: { type: String },
|
|
9
|
+
riskRating: { type: String },
|
|
10
|
+
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
11
|
+
verificationLinkSentOn: { type: String }
|
|
12
|
+
});
|
|
13
|
+
export default applicantRiskNarrativeSchema;
|