@dynamatix/gb-schemas 0.21.6 → 0.21.8
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/applicants/applicant-commitment.model.js +1 -1
- package/applicants/applicant-credit-data.model.js +1 -1
- package/applicants/applicant-direct-debit.model.js +2 -2
- package/applicants/applicant-employment.model.js +1 -1
- package/applicants/applicant-expenditure.model.js +6 -6
- package/applicants/applicant-income-source.model.js +4 -4
- package/applicants/applicant-income.model.js +13 -13
- package/applicants/applicant-other-income.model.js +8 -8
- package/applicants/applicant-risk-narrative.model.js +1 -1
- package/applicants/applicant.model.js +28 -28
- package/applications/application-audit.model.js +3 -3
- package/applications/application-company-model.js +11 -11
- package/applications/application-credit-profile.model.js +4 -4
- package/applications/application-direct-debit.model.js +2 -2
- package/applications/application-document.model.js +4 -4
- package/applications/application-fieldconfig.model.js +1 -1
- package/applications/application-mortgage.model.js +9 -9
- package/applications/application-note.model.js +3 -3
- package/applications/application-product.model.js +1 -1
- package/applications/application-valuation.model.js +5 -5
- package/applications/application.model.js +13 -13
- package/applications/broker.model.js +1 -1
- package/applications/document.model.js +3 -3
- package/applications/productfeatures.model.js +53 -53
- package/applications/solicitor.model.js +5 -5
- package/package.json +2 -2
- package/product-catalogues/product-catalogue.model.js +3 -3
- package/product-catalogues/product-definitions.model.js +4 -4
- package/properties/property.model.js +31 -31
- package/shared/alert.model.js +1 -1
- package/shared/apprivo-sync-journey.model.js +1 -1
- package/shared/job-setting.model.js +1 -1
- package/users/role-group.model.js +1 -1
- package/users/role.model.js +1 -1
- package/users/user.model.js +2 -2
- package/utils/encryption.middleware.js +2 -2
|
@@ -3,7 +3,7 @@ import mongoose from "mongoose";
|
|
|
3
3
|
|
|
4
4
|
const applicantCommitmentSchema = new mongoose.Schema({
|
|
5
5
|
commitmentId: String,
|
|
6
|
-
doHaveSharedResponsibility:
|
|
6
|
+
doHaveSharedResponsibility: String,
|
|
7
7
|
lenderName: String,
|
|
8
8
|
monthlyPayment: String,
|
|
9
9
|
commitmentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
@@ -7,7 +7,7 @@ const applicantCreditDataSchema = new mongoose.Schema({
|
|
|
7
7
|
securedArrears: { type: String },
|
|
8
8
|
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
9
9
|
unsecuredArrears: { type: String },
|
|
10
|
-
valid: { type:
|
|
10
|
+
valid: { type: String}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export default applicantCreditDataSchema;
|
|
@@ -9,9 +9,9 @@ const applicantDirectDebitSchema = new mongoose.Schema({
|
|
|
9
9
|
city: { type: String },
|
|
10
10
|
contactPostcode: { type: String },
|
|
11
11
|
institution: { type: String },
|
|
12
|
-
isConfirmDeclaration: { type:
|
|
12
|
+
isConfirmDeclaration: { type: String, default: false },
|
|
13
13
|
nameOfAccountHolder: { type: String },
|
|
14
|
-
selectedPaymentDay: { type:
|
|
14
|
+
selectedPaymentDay: { type: String },
|
|
15
15
|
sortCode: { type: String }
|
|
16
16
|
}, { timestamps: true });
|
|
17
17
|
|
|
@@ -24,7 +24,7 @@ const applicantEmploymentSchema = new mongoose.Schema({
|
|
|
24
24
|
employerTelephone: { type: String },
|
|
25
25
|
housingAllowance: { type: String },
|
|
26
26
|
industryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
27
|
-
isUnderTerminationNotice: { type:
|
|
27
|
+
isUnderTerminationNotice: { type: String, default: null },
|
|
28
28
|
jobTitle: { type: String },
|
|
29
29
|
maintenance: { type: String },
|
|
30
30
|
maternityIncome: { type: String },
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
2
|
|
|
3
3
|
const applicantExpenditureSchema = new mongoose.Schema({
|
|
4
|
-
childCareForDependents: { type:
|
|
5
|
-
insurance: { type:
|
|
6
|
-
other: { type:
|
|
7
|
-
totalMonthlyExpenditure: { type:
|
|
8
|
-
transport: { type:
|
|
9
|
-
utilities: { type:
|
|
4
|
+
childCareForDependents: { type: String },
|
|
5
|
+
insurance: { type: String },
|
|
6
|
+
other: { type: String },
|
|
7
|
+
totalMonthlyExpenditure: { type: String },
|
|
8
|
+
transport: { type: String },
|
|
9
|
+
utilities: { type: String }
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export default applicantExpenditureSchema;
|
|
@@ -2,10 +2,10 @@ import mongoose from "mongoose";
|
|
|
2
2
|
|
|
3
3
|
const applicantIncomeSourceSchema = new mongoose.Schema({
|
|
4
4
|
employmentStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
5
|
-
incomeFromEmployment: { type:
|
|
6
|
-
incomeFromPension: { type:
|
|
7
|
-
incomeFromProperty: { type:
|
|
8
|
-
incomeFromSavings: { type:
|
|
5
|
+
incomeFromEmployment: { type: String },
|
|
6
|
+
incomeFromPension: { type: String },
|
|
7
|
+
incomeFromProperty: { type: String },
|
|
8
|
+
incomeFromSavings: { type: String }
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
export default applicantIncomeSourceSchema;
|
|
@@ -22,15 +22,15 @@ const incomeSchema = new mongoose.Schema({
|
|
|
22
22
|
contactName: { type: String, default: '' },
|
|
23
23
|
currentYearEnd: { type: Date, default: null },
|
|
24
24
|
dateEstablished: { type: Date, default: null },
|
|
25
|
-
doYouHaveAccountant: { type:
|
|
26
|
-
isBusinessAddressDifferent: { type:
|
|
25
|
+
doYouHaveAccountant: { type: String, default: false },
|
|
26
|
+
isBusinessAddressDifferent: { type: String, default: false },
|
|
27
27
|
nameOfBusiness: { type: String, default: '' },
|
|
28
28
|
natureOfBusiness: { type: String, default: '' },
|
|
29
|
-
netAssets1: { type:
|
|
30
|
-
netAssets2: { type:
|
|
31
|
-
netAssets3: { type:
|
|
32
|
-
pageValidFlag: { type:
|
|
33
|
-
percentageOfShareholding: { type:
|
|
29
|
+
netAssets1: { type: String, default: 0.0 },
|
|
30
|
+
netAssets2: { type: String, default: 0.0 },
|
|
31
|
+
netAssets3: { type: String, default: 0.0 },
|
|
32
|
+
pageValidFlag: { type: String, default: true },
|
|
33
|
+
percentageOfShareholding: { type: String, default: 100 },
|
|
34
34
|
registeredAddressLine1: { type: String, default: '' },
|
|
35
35
|
registeredAddressLine2: { type: String, default: '' },
|
|
36
36
|
registeredAddressLine3: { type: String, default: '' },
|
|
@@ -39,12 +39,12 @@ const incomeSchema = new mongoose.Schema({
|
|
|
39
39
|
registeredPostCode: { type: String, default: '' },
|
|
40
40
|
registeredTelephone: { type: String, default: '' },
|
|
41
41
|
selfEmployedDate: { type: Date, default: null },
|
|
42
|
-
turnover1: { type:
|
|
43
|
-
turnover2: { type:
|
|
44
|
-
turnover3: { type:
|
|
45
|
-
year1: { type:
|
|
46
|
-
year2: { type:
|
|
47
|
-
year3: { type:
|
|
42
|
+
turnover1: { type: String, default: 0.0 },
|
|
43
|
+
turnover2: { type: String, default: 0.0 },
|
|
44
|
+
turnover3: { type: String, default: 0.0 },
|
|
45
|
+
year1: { type: String, default: 0.0 },
|
|
46
|
+
year2: { type: String, default: 0.0 },
|
|
47
|
+
year3: { type: String, default: 0.0 },
|
|
48
48
|
yearEnd1: { type: String, default: '' },
|
|
49
49
|
yearEnd2: { type: String, default: '' },
|
|
50
50
|
yearEnd3: { type: String, default: '' }
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
2
|
|
|
3
3
|
const applicantOtherIncomeSchema = new mongoose.Schema({
|
|
4
|
-
amount1: { type:
|
|
5
|
-
amount2: { type:
|
|
6
|
-
amount3: { type:
|
|
7
|
-
amount4: { type:
|
|
8
|
-
guaranteed1: { type:
|
|
9
|
-
guaranteed2: { type:
|
|
10
|
-
guaranteed3: { type:
|
|
11
|
-
guaranteed4: { type:
|
|
4
|
+
amount1: { type: String },
|
|
5
|
+
amount2: { type: String },
|
|
6
|
+
amount3: { type: String },
|
|
7
|
+
amount4: { type: String },
|
|
8
|
+
guaranteed1: { type: String },
|
|
9
|
+
guaranteed2: { type: String },
|
|
10
|
+
guaranteed3: { type: String },
|
|
11
|
+
guaranteed4: { type: String },
|
|
12
12
|
maintenance: { type: String },
|
|
13
13
|
otherBenefits: { type: String },
|
|
14
14
|
payFrequency1: { type: String },
|
|
@@ -4,7 +4,7 @@ const applicantRiskNarrativeSchema = new mongoose.Schema({
|
|
|
4
4
|
call2StatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
5
5
|
clientReference: { type: String },
|
|
6
6
|
docVerificationStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
7
|
-
isPoaTaskGenerated: { type:
|
|
7
|
+
isPoaTaskGenerated: { type: String },
|
|
8
8
|
link: { type: String },
|
|
9
9
|
riskLevel: { type: String },
|
|
10
10
|
riskRating: { type: String },
|
|
@@ -28,35 +28,35 @@ const applicantSchema = new mongoose.Schema({
|
|
|
28
28
|
correspondenceAddressPostCode: { type: String, default: null },
|
|
29
29
|
countryOfResidenceLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
30
30
|
dateOfBirth: { type: Date, default: null },
|
|
31
|
-
dependant10Age: { type:
|
|
32
|
-
dependant1Age: { type:
|
|
33
|
-
dependant2Age: { type:
|
|
34
|
-
dependant3Age: { type:
|
|
35
|
-
dependant4Age: { type:
|
|
36
|
-
dependant5Age: { type:
|
|
37
|
-
dependant6Age: { type:
|
|
38
|
-
dependant7Age: { type:
|
|
39
|
-
dependant8Age: { type:
|
|
40
|
-
dependant9Age: { type:
|
|
31
|
+
dependant10Age: { type: String, default: 0 },
|
|
32
|
+
dependant1Age: { type: String, default: 0 },
|
|
33
|
+
dependant2Age: { type: String, default: 0 },
|
|
34
|
+
dependant3Age: { type: String, default: 0 },
|
|
35
|
+
dependant4Age: { type: String, default: 0 },
|
|
36
|
+
dependant5Age: { type: String, default: 0 },
|
|
37
|
+
dependant6Age: { type: String, default: 0 },
|
|
38
|
+
dependant7Age: { type: String, default: 0 },
|
|
39
|
+
dependant8Age: { type: String, default: 0 },
|
|
40
|
+
dependant9Age: { type: String, default: 0 },
|
|
41
41
|
email: { type: String, default: null },
|
|
42
42
|
employmentStatusDetails: { type: String, default: null },
|
|
43
43
|
firstName: { type: String, default: null },
|
|
44
|
-
isFirstTimelandlord: { type:
|
|
44
|
+
isFirstTimelandlord: { type: String, default: false },
|
|
45
45
|
foreignNationalsId: { type: String, default: null },
|
|
46
|
-
gdprEmail: { type:
|
|
47
|
-
gdprPost: { type:
|
|
48
|
-
gdprTelephone: { type:
|
|
49
|
-
gdprTextMessage: { type:
|
|
46
|
+
gdprEmail: { type: String, default: false },
|
|
47
|
+
gdprPost: { type: String, default: false },
|
|
48
|
+
gdprTelephone: { type: String, default: false },
|
|
49
|
+
gdprTextMessage: { type: String, default: false },
|
|
50
50
|
gender: { type: String, default: null },
|
|
51
51
|
hasBrokerGivenConsentForVulnerabilities: { type: String, default: null },
|
|
52
|
-
hasLinkedJurisdiction: { type:
|
|
53
|
-
isCorrespondence: { type:
|
|
54
|
-
isCurrentContract: { type:
|
|
55
|
-
isCustomerVulnerable: { type:
|
|
56
|
-
isExpat: { type:
|
|
57
|
-
isFirstApplicant: { type:
|
|
58
|
-
isUkPassport: { type:
|
|
59
|
-
isUkResident: { type:
|
|
52
|
+
hasLinkedJurisdiction: { type: String, default: false },
|
|
53
|
+
isCorrespondence: { type: String, default: true },
|
|
54
|
+
isCurrentContract: { type: String, default: false },
|
|
55
|
+
isCustomerVulnerable: { type: String, default: false },
|
|
56
|
+
isExpat: { type: String, default: false },
|
|
57
|
+
isFirstApplicant: { type: String, default: false },
|
|
58
|
+
isUkPassport: { type: String, default: false },
|
|
59
|
+
isUkResident: { type: String, default: true },
|
|
60
60
|
lastName: { type: String, default: null },
|
|
61
61
|
linkedJurisdictionCountry: { type: String, default: null },
|
|
62
62
|
linkedJurisdictionDetails: { type: String, default: null },
|
|
@@ -66,8 +66,8 @@ const applicantSchema = new mongoose.Schema({
|
|
|
66
66
|
nationalityLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
67
67
|
netIncome: { type: String },
|
|
68
68
|
niNumber: { type: String, default: null },
|
|
69
|
-
numberOfDependants: { type:
|
|
70
|
-
isOneYearPrior: { type:
|
|
69
|
+
numberOfDependants: { type: String, default: 0 },
|
|
70
|
+
isOneYearPrior: { type: String, default: false },
|
|
71
71
|
phoneNumber: { type: String, default: null },
|
|
72
72
|
previous1AddressCity: { type: String, default: null },
|
|
73
73
|
previous1AddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
@@ -87,13 +87,13 @@ const applicantSchema = new mongoose.Schema({
|
|
|
87
87
|
previous2AddressPropertyOwnedBy: { type: String, default: null },
|
|
88
88
|
relationshipToOthersLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
89
89
|
residentialStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
90
|
-
retirementAge: { type:
|
|
90
|
+
retirementAge: { type: String, default: 0 },
|
|
91
91
|
taxJurisdiction: { type: String, default: null },
|
|
92
92
|
taxPayerLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
93
93
|
timeResidedAtCountryOfResidence: { type: String, default: null },
|
|
94
94
|
title: { type: String, default: null },
|
|
95
|
-
isTwoYearPrior: { type:
|
|
96
|
-
understandEnglish: { type:
|
|
95
|
+
isTwoYearPrior: { type: String, default: false },
|
|
96
|
+
understandEnglish: { type: String, default: true },
|
|
97
97
|
vulnerabilityNotes: { type: String, default: null },
|
|
98
98
|
VulnerabilityTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
99
99
|
creditData: applicantCreditDataSchema,
|
|
@@ -3,11 +3,11 @@ import mongooseEncryption from "../utils/encryption.middleware.js";
|
|
|
3
3
|
|
|
4
4
|
const applicationAuditSchema = new mongoose.Schema({
|
|
5
5
|
auditId: {
|
|
6
|
-
type:
|
|
6
|
+
type: String,
|
|
7
7
|
required: true
|
|
8
8
|
},
|
|
9
9
|
accountId: {
|
|
10
|
-
type:
|
|
10
|
+
type: String,
|
|
11
11
|
required: true
|
|
12
12
|
},
|
|
13
13
|
auditCorrelationId: {
|
|
@@ -19,7 +19,7 @@ const applicationAuditSchema = new mongoose.Schema({
|
|
|
19
19
|
required: true
|
|
20
20
|
},
|
|
21
21
|
changeType: {
|
|
22
|
-
type:
|
|
22
|
+
type: String,
|
|
23
23
|
required: true
|
|
24
24
|
},
|
|
25
25
|
applicationId: {
|
|
@@ -9,28 +9,28 @@ const companySchema = new mongoose.Schema({
|
|
|
9
9
|
addressLine3: { type: String, default: "" },
|
|
10
10
|
addressPostCode: { type: String, default: "" },
|
|
11
11
|
businessType: { type: String, default: "" },
|
|
12
|
-
doYouKnowRegisteredNumber: { type:
|
|
12
|
+
doYouKnowRegisteredNumber: { type: String, default: false }, // e.g., true or false
|
|
13
13
|
natureOfBusiness: { type: String, default: "" },
|
|
14
|
-
netProfitYear1: { type:
|
|
15
|
-
netProfitYear2: { type:
|
|
16
|
-
netProfitYear3: { type:
|
|
14
|
+
netProfitYear1: { type: String, }, // e.g., 50000
|
|
15
|
+
netProfitYear2: { type: String, }, // e.g., 75000
|
|
16
|
+
netProfitYear3: { type: String, }, // e.g., 100000
|
|
17
17
|
registeredName: { type: String, default: "" },
|
|
18
18
|
registeredNumber: { type: String, default: "" },
|
|
19
19
|
taxJurisdiction: { type: String, default: "" },
|
|
20
20
|
tradingSince: { type: Date }, // e.g., "2020-01-01"
|
|
21
|
-
turnoverYear1: { type:
|
|
22
|
-
turnoverYear2: { type:
|
|
23
|
-
turnoverYear3: { type:
|
|
21
|
+
turnoverYear1: { type: String }, // e.g., 100000
|
|
22
|
+
turnoverYear2: { type: String }, // e.g., 150000
|
|
23
|
+
turnoverYear3: { type: String }, // e.g., 200000
|
|
24
24
|
yearEnd: { type: Date }, // e.g., "2023-12-31"
|
|
25
|
-
yearEnd1: { type:
|
|
26
|
-
yearEnd2: { type:
|
|
27
|
-
yearEnd3: { type:
|
|
25
|
+
yearEnd1: { type: String }, // e.g., 2021
|
|
26
|
+
yearEnd2: { type: String }, // e.g., 2022
|
|
27
|
+
yearEnd3: { type: String }, // e.g., 2023
|
|
28
28
|
sicCodes: [{ type: String, default: "" }], // e.g., "12345"
|
|
29
29
|
epc: { type: String, default: "" }, // e.g., "A"
|
|
30
30
|
tenure: { type: String, default: "" }, // e.g., "Leasehold"
|
|
31
31
|
remainingLease: { type: String, default: "" }, // e.g., "85 years"
|
|
32
32
|
dateOfIncorporation: { type: Date }, // e.g., "2010-06-15"
|
|
33
|
-
existingMortgage: {type:
|
|
33
|
+
existingMortgage: {type: String } // e.g., "2"
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
companySchema.plugin(mongooseEncryption);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
2
|
|
|
3
3
|
const creditProfileSchema = new mongoose.Schema({
|
|
4
|
-
companyAnyVoluntaryEnforcedPossessionNo: { type:
|
|
4
|
+
companyAnyVoluntaryEnforcedPossessionNo: { type: String, default: false },
|
|
5
5
|
companyAnyVoluntaryEnforcedPossessionYes: { type: String, default: "" },
|
|
6
|
-
companyBankruptcyNo: { type:
|
|
6
|
+
companyBankruptcyNo: { type: String, default: false },
|
|
7
7
|
companyBankruptcyYes: { type: String, default: "" },
|
|
8
|
-
companyCCJInLastThreeYearNo: { type:
|
|
8
|
+
companyCCJInLastThreeYearNo: { type: String, default: false },
|
|
9
9
|
companyCCJInLastThreeYearYes: { type: String, default: "" },
|
|
10
|
-
companyDefaultsInLastYearNo: { type:
|
|
10
|
+
companyDefaultsInLastYearNo: { type: String, default: false },
|
|
11
11
|
companyDefaultsInLastYearYes: { type: String, default: "" }
|
|
12
12
|
});
|
|
13
13
|
export default creditProfileSchema;
|
|
@@ -9,9 +9,9 @@ const directDebitSchema = new mongoose.Schema({
|
|
|
9
9
|
city: { type: String, default: "" },
|
|
10
10
|
contactPostcode: { type: String, default: "" },
|
|
11
11
|
institution: { type: String, default: "" },
|
|
12
|
-
isConfirmDeclaration: { type:
|
|
12
|
+
isConfirmDeclaration: { type: String, default: false },
|
|
13
13
|
nameOfAccountHolder: { type: String, default: "" },
|
|
14
|
-
selectedPaymentDay: { type:
|
|
14
|
+
selectedPaymentDay: { type: String, default: null },
|
|
15
15
|
sortCode: { type: String, default: "" },
|
|
16
16
|
|
|
17
17
|
});
|
|
@@ -14,17 +14,17 @@ const documentSchema = new mongoose.Schema({
|
|
|
14
14
|
ref: "Lookup",
|
|
15
15
|
required: false,
|
|
16
16
|
},
|
|
17
|
-
documentTypeId: { type:
|
|
17
|
+
documentTypeId: { type: String, required: false },
|
|
18
18
|
fileName: { type: String, required: false },
|
|
19
19
|
contentType: { type: String, required: false },
|
|
20
20
|
created: { type: Date, required: false },
|
|
21
|
-
createdBy: { type:
|
|
22
|
-
isGenerated: { type:
|
|
21
|
+
createdBy: { type: String, required: false },
|
|
22
|
+
isGenerated: { type: String, required: false },
|
|
23
23
|
data: { type: String, required: false },
|
|
24
24
|
envelopeId: { type: String, required: false },
|
|
25
25
|
signers: { type: Array, default: [] },
|
|
26
26
|
documentType: {
|
|
27
|
-
documentTypeId: { type:
|
|
27
|
+
documentTypeId: { type: String, required: false },
|
|
28
28
|
displayName: { type: String, required: false },
|
|
29
29
|
value: { type: String, required: false },
|
|
30
30
|
data: { type: Object, required: false },
|
|
@@ -3,7 +3,7 @@ import mongooseEncryption from "../utils/encryption.middleware.js";
|
|
|
3
3
|
|
|
4
4
|
const fieldConfigSchema = new mongoose.Schema({
|
|
5
5
|
fieldName: { type: String, required: true, unique: true },
|
|
6
|
-
validateProductOnChange: { type:
|
|
6
|
+
validateProductOnChange: { type: String, default: true }
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
|
|
@@ -8,18 +8,18 @@ const mortgageSchema = new mongoose.Schema({
|
|
|
8
8
|
fundRaisedFor: { type: String, default: "" },
|
|
9
9
|
giftDetails: { type: String, default: "" },
|
|
10
10
|
ifOtherDetails: { type: String, default: "" },
|
|
11
|
-
isDistressedSale: { type:
|
|
12
|
-
isGovernmentInitiative: { type:
|
|
13
|
-
isPurchasedAsSale: { type:
|
|
14
|
-
isPurchasedBelowMarketValue: { type:
|
|
15
|
-
isReadyToSell: { type:
|
|
16
|
-
isTheIntentionToLet: { type:
|
|
11
|
+
isDistressedSale: { type: String, default: false },
|
|
12
|
+
isGovernmentInitiative: { type: String, default: false },
|
|
13
|
+
isPurchasedAsSale: { type: String, default: false },
|
|
14
|
+
isPurchasedBelowMarketValue: { type: String, default: false },
|
|
15
|
+
isReadyToSell: { type: String, default: true },
|
|
16
|
+
isTheIntentionToLet: { type: String, default: true },
|
|
17
17
|
leaseTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
18
|
-
loanRequired: { type:
|
|
19
|
-
monthlyRentalIncome: { type:
|
|
18
|
+
loanRequired: { type: String, required: true },
|
|
19
|
+
monthlyRentalIncome: { type: String, required: true },
|
|
20
20
|
propertyValuationDetails: { type: String, default: "" },
|
|
21
21
|
proposedTenants: { type: String },
|
|
22
|
-
purchasePrice: { type:
|
|
22
|
+
purchasePrice: { type: String, required: true },
|
|
23
23
|
repaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
24
24
|
repaymentVehicle: { type: String, default: "" },
|
|
25
25
|
saleMade: { type: String, default: "" },
|
|
@@ -12,7 +12,7 @@ const noteSchema = new mongoose.Schema({
|
|
|
12
12
|
default: null
|
|
13
13
|
},
|
|
14
14
|
createdBy: {
|
|
15
|
-
type:
|
|
15
|
+
type: String,
|
|
16
16
|
default: null
|
|
17
17
|
},
|
|
18
18
|
createdByUserId: {
|
|
@@ -41,7 +41,7 @@ const noteSchema = new mongoose.Schema({
|
|
|
41
41
|
default: ''
|
|
42
42
|
},
|
|
43
43
|
autoCreated: {
|
|
44
|
-
type:
|
|
44
|
+
type: String,
|
|
45
45
|
default: false
|
|
46
46
|
},
|
|
47
47
|
additionalData: {
|
|
@@ -57,7 +57,7 @@ const noteSchema = new mongoose.Schema({
|
|
|
57
57
|
default: ''
|
|
58
58
|
},
|
|
59
59
|
assignedBy: {
|
|
60
|
-
type:
|
|
60
|
+
type: String,
|
|
61
61
|
default: null
|
|
62
62
|
},
|
|
63
63
|
assignedByUserId: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
2
|
|
|
3
3
|
const productSchema = new mongoose.Schema({
|
|
4
|
-
numberOfYearsToRepay: { type:
|
|
4
|
+
numberOfYearsToRepay: { type: String, default: 0 },
|
|
5
5
|
productFeePaymentType: { type: String, default: "" },
|
|
6
6
|
selectedProduct: { type: String, default: "" }
|
|
7
7
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
2
|
|
|
3
3
|
const valuationSchema = new mongoose.Schema({
|
|
4
|
-
amount: { type:
|
|
4
|
+
amount: { type: String },
|
|
5
5
|
epcRating: { type: String, default: "" },
|
|
6
|
-
epcScore: { type:
|
|
7
|
-
estimatedRentalValue: { type:
|
|
6
|
+
epcScore: { type: String },
|
|
7
|
+
estimatedRentalValue: { type: String },
|
|
8
8
|
instructionId: { type: String, default: "" },
|
|
9
9
|
instructionStatus: { type: String, default: "" },
|
|
10
10
|
instructionStatusComment: { type: String, default: "" },
|
|
11
|
-
isManual: { type:
|
|
12
|
-
squareMetres: { type:
|
|
11
|
+
isManual: { type: String, default: false },
|
|
12
|
+
squareMetres: { type: String },
|
|
13
13
|
valuerNotes: { type: String, default: "" },
|
|
14
14
|
version: { type: String, default: "" }
|
|
15
15
|
});
|
|
@@ -13,24 +13,24 @@ const applicationSchema = new mongoose.Schema(
|
|
|
13
13
|
}],
|
|
14
14
|
assignedToUserId: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
|
|
15
15
|
applicationId: { type: String, required: true },
|
|
16
|
-
isApplicationFeePaid: { type:
|
|
16
|
+
isApplicationFeePaid: { type: String, required: true },
|
|
17
17
|
applicationNumber: { type: String, required: true },
|
|
18
18
|
applicationTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
19
19
|
bankSolicitor: { type: String, default: "" },
|
|
20
20
|
brokerId: { type: mongoose.Schema.Types.ObjectId, ref: "Broker", required: true },
|
|
21
21
|
caseManager: { type: String, default: "" },
|
|
22
|
-
caseManagerAccepted: { type:
|
|
22
|
+
caseManagerAccepted: { type: String, default: false },
|
|
23
23
|
completedReason: { type: String, default: "" },
|
|
24
|
-
isIntendToOccupy: { type:
|
|
24
|
+
isIntendToOccupy: { type: String, required: true },
|
|
25
25
|
introducer: { type: String, default: "" },
|
|
26
|
-
isIntroducerSubmission: { type:
|
|
27
|
-
isBrokerAssigned: { type:
|
|
28
|
-
isFinanceRecommendedToApplicant: { type:
|
|
29
|
-
isWorkflowTaskCreated: { type:
|
|
26
|
+
isIntroducerSubmission: { type: String, required: true },
|
|
27
|
+
isBrokerAssigned: { type: String, default: false },
|
|
28
|
+
isFinanceRecommendedToApplicant: { type: String, required: true },
|
|
29
|
+
isWorkflowTaskCreated: { type: String, required: true },
|
|
30
30
|
lastUpdated: { type: Date },
|
|
31
31
|
lendingTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
32
32
|
networkClubName: { type: String, default: "" },
|
|
33
|
-
isNetworkClubSubmission: { type:
|
|
33
|
+
isNetworkClubSubmission: { type: String, required: true },
|
|
34
34
|
newReason: { type: String, default: "" },
|
|
35
35
|
purchaseTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
36
36
|
rejectedReason: { type: String, default: "" },
|
|
@@ -46,7 +46,7 @@ const applicationSchema = new mongoose.Schema(
|
|
|
46
46
|
submitReason: { type: String, default: "" },
|
|
47
47
|
submittedDate: { type: Date },
|
|
48
48
|
underwriter: { type: String, default: "" },
|
|
49
|
-
isValuationFeePaid: { type:
|
|
49
|
+
isValuationFeePaid: { type: String, required: true },
|
|
50
50
|
withdrawalReason: { type: String, default: "" },
|
|
51
51
|
withdrawalReasonCode: { type: String, default: "" },
|
|
52
52
|
productId: { type: mongoose.Schema.Types.ObjectId, ref: "Product", required: false },
|
|
@@ -58,16 +58,16 @@ const applicationSchema = new mongoose.Schema(
|
|
|
58
58
|
],
|
|
59
59
|
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
60
60
|
submittedDate: { type: Date },
|
|
61
|
-
isValuationFeePaid: { type:
|
|
62
|
-
isActive: { type:
|
|
63
|
-
isUkResident: { type:
|
|
61
|
+
isValuationFeePaid: { type: String, required: true },
|
|
62
|
+
isActive: { type: String, default: false },
|
|
63
|
+
isUkResident: { type: String, default: true },
|
|
64
64
|
riskRating: { type: String },
|
|
65
65
|
directDebit: directDebitSchema,
|
|
66
66
|
creditProfile: creditProfileSchema,
|
|
67
67
|
mortgage: mortgageSchema,
|
|
68
68
|
companyId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationCompany" },
|
|
69
69
|
rationaleId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationRationale" },
|
|
70
|
-
newAuditRecordsCount: { type:
|
|
70
|
+
newAuditRecordsCount: { type: String, default: 0 } // Ensure it is a Number
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
timestamps: true,
|
|
@@ -2,7 +2,7 @@ import mongoose from "mongoose";
|
|
|
2
2
|
import mongooseEncryption from "../utils/encryption.middleware.js";
|
|
3
3
|
|
|
4
4
|
const brokerSchema = new mongoose.Schema({
|
|
5
|
-
brokerId: { type:
|
|
5
|
+
brokerId: { type: String },
|
|
6
6
|
landlinePhone: { type: String },
|
|
7
7
|
mobileTelephone: { type: String },
|
|
8
8
|
addressPostCode: { type: String },
|
|
@@ -18,13 +18,13 @@ const documentSchema = new mongoose.Schema({
|
|
|
18
18
|
fileName: { type: String, required: false },
|
|
19
19
|
contentType: { type: String, required: false },
|
|
20
20
|
created: { type: Date, required: false },
|
|
21
|
-
createdBy: { type:
|
|
22
|
-
isGenerated: { type:
|
|
21
|
+
createdBy: { type: String, required: false },
|
|
22
|
+
isGenerated: { type: String, required: false },
|
|
23
23
|
data: { type: String, required: false },
|
|
24
24
|
envelopeId: { type: String, required: false },
|
|
25
25
|
signers: { type: Array, default: [] },
|
|
26
26
|
documentType: {
|
|
27
|
-
documentTypeId: { type:
|
|
27
|
+
documentTypeId: { type: String, required: false },
|
|
28
28
|
displayName: { type: String, required: false },
|
|
29
29
|
value: { type: String, required: false },
|
|
30
30
|
data: { type: Object, required: false },
|
|
@@ -4,87 +4,87 @@ import mongooseEncryption from "../utils/encryption.middleware.js";
|
|
|
4
4
|
const feeSchema = new mongoose.Schema({
|
|
5
5
|
feeType: { type: String, required: true },
|
|
6
6
|
description: { type: String, required: true },
|
|
7
|
-
feeAmount: { type:
|
|
8
|
-
rate: { type:
|
|
9
|
-
addedToLoan: { type:
|
|
10
|
-
allowOverride: { type:
|
|
7
|
+
feeAmount: { type: String, required: true },
|
|
8
|
+
rate: { type: String, default: 0 },
|
|
9
|
+
addedToLoan: { type: String, default: false },
|
|
10
|
+
allowOverride: { type: String, default: false },
|
|
11
11
|
additionalData: { type: mongoose.Schema.Types.Mixed, default: null }
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
const cashflowPeriodSchema = new mongoose.Schema({
|
|
15
|
-
from: { type:
|
|
16
|
-
to: { type:
|
|
17
|
-
instalmentAmount: { type:
|
|
18
|
-
instalmentInterest: { type:
|
|
19
|
-
instalmentCapitalRepaid: { type:
|
|
20
|
-
otherCosts: { type:
|
|
21
|
-
outstandingCapital: { type:
|
|
15
|
+
from: { type: String, default: null },
|
|
16
|
+
to: { type: String, default: null },
|
|
17
|
+
instalmentAmount: { type: String, default: null },
|
|
18
|
+
instalmentInterest: { type: String, default: null },
|
|
19
|
+
instalmentCapitalRepaid: { type: String, default: null },
|
|
20
|
+
otherCosts: { type: String, default: 0 },
|
|
21
|
+
outstandingCapital: { type: String, default: null }
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
const calculationsSchema = new mongoose.Schema({
|
|
25
|
-
ltv: { type:
|
|
26
|
-
rentalCoverageRatioRate: { type:
|
|
27
|
-
bankContributionRate: { type:
|
|
28
|
-
bankInitialShareRate: { type:
|
|
29
|
-
totalAmountPayable: { type:
|
|
30
|
-
fixedMonthlyPayment: { type:
|
|
31
|
-
fixedMonthlyCapital: { type:
|
|
32
|
-
fixedMonthlyInterest: { type:
|
|
33
|
-
variableMonthlyPayment: { type:
|
|
34
|
-
summaryTotal: { type:
|
|
35
|
-
reimbursementPerPound: { type:
|
|
36
|
-
stressedPayment: { type:
|
|
37
|
-
stressedPaymentRate: { type:
|
|
38
|
-
rentalCoverage: { type:
|
|
39
|
-
rentalCoverageWithoutTopUp: { type:
|
|
25
|
+
ltv: { type: String, default: null },
|
|
26
|
+
rentalCoverageRatioRate: { type: String, default: null },
|
|
27
|
+
bankContributionRate: { type: String, default: null },
|
|
28
|
+
bankInitialShareRate: { type: String, default: null },
|
|
29
|
+
totalAmountPayable: { type: String, default: null },
|
|
30
|
+
fixedMonthlyPayment: { type: String, default: null },
|
|
31
|
+
fixedMonthlyCapital: { type: String, default: null },
|
|
32
|
+
fixedMonthlyInterest: { type: String, default: null },
|
|
33
|
+
variableMonthlyPayment: { type: String, default: null },
|
|
34
|
+
summaryTotal: { type: String, default: null },
|
|
35
|
+
reimbursementPerPound: { type: String, default: null },
|
|
36
|
+
stressedPayment: { type: String, default: null },
|
|
37
|
+
stressedPaymentRate: { type: String, default: null },
|
|
38
|
+
rentalCoverage: { type: String, default: null },
|
|
39
|
+
rentalCoverageWithoutTopUp: { type: String, default: null }
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
const productFeaturesSchema = new mongoose.Schema({
|
|
43
43
|
name: { type: String, required: true },
|
|
44
|
-
clientAdvance: { type:
|
|
45
|
-
ltv: { type:
|
|
46
|
-
repayment: { type:
|
|
47
|
-
variableRepayment: { type:
|
|
48
|
-
reversionRateWithoutBaseRate: { type:
|
|
49
|
-
totalReversionRate: { type:
|
|
50
|
-
initialRate: { type:
|
|
51
|
-
fixedTerm: { type:
|
|
44
|
+
clientAdvance: { type: String, required: true },
|
|
45
|
+
ltv: { type: String, required: true },
|
|
46
|
+
repayment: { type: String, required: true },
|
|
47
|
+
variableRepayment: { type: String, required: true },
|
|
48
|
+
reversionRateWithoutBaseRate: { type: String, default: null },
|
|
49
|
+
totalReversionRate: { type: String, default: null },
|
|
50
|
+
initialRate: { type: String, required: true },
|
|
51
|
+
fixedTerm: { type: String, required: true },
|
|
52
52
|
fixedTermEndDate: { type: Date, default: null },
|
|
53
|
-
baseRate: { type:
|
|
54
|
-
productRate: { type:
|
|
55
|
-
apr: { type:
|
|
56
|
-
rentalCoverage: { type:
|
|
53
|
+
baseRate: { type: String, default: null },
|
|
54
|
+
productRate: { type: String, default: null },
|
|
55
|
+
apr: { type: String, default: null },
|
|
56
|
+
rentalCoverage: { type: String, default: null },
|
|
57
57
|
repaymentType: { type: String, default: null },
|
|
58
58
|
applicationCategory: { type: String, default: null },
|
|
59
59
|
securityType: { type: String, default: null },
|
|
60
60
|
erc: { type: String, default: null },
|
|
61
61
|
loanType: { type: String, default: null },
|
|
62
62
|
maxLtvLimit: { type: String, default: null },
|
|
63
|
-
reimbursement: { type:
|
|
64
|
-
reimbursementPerPound: { type:
|
|
65
|
-
stressedApr: { type:
|
|
66
|
-
stressedRate: { type:
|
|
67
|
-
stressedRepayment: { type:
|
|
63
|
+
reimbursement: { type: String, default: null },
|
|
64
|
+
reimbursementPerPound: { type: String, default: null },
|
|
65
|
+
stressedApr: { type: String, default: null },
|
|
66
|
+
stressedRate: { type: String, default: null },
|
|
67
|
+
stressedRepayment: { type: String, default: null },
|
|
68
68
|
liborFloorRate: { type: String, default: null },
|
|
69
|
-
totalTermInMonths: { type:
|
|
69
|
+
totalTermInMonths: { type: String, default: null },
|
|
70
70
|
chargeType: { type: String, default: '' },
|
|
71
71
|
productCategory: { type: String, default: '' },
|
|
72
72
|
ercCode: { type: String, default: '' },
|
|
73
|
-
variableTerm: { type:
|
|
74
|
-
totalFeePayable: { type:
|
|
73
|
+
variableTerm: { type: String, default: null },
|
|
74
|
+
totalFeePayable: { type: String, default: null },
|
|
75
75
|
dipIssueDate: { type: Date, default: null },
|
|
76
76
|
estimatedCompletionDate: { type: Date, default: null },
|
|
77
77
|
dipExpiryDate: { type: Date, default: null },
|
|
78
78
|
fixedRepaymentUntillDate: { type: Date, default: null },
|
|
79
79
|
rentalReviewDate: { type: Date, default: null },
|
|
80
|
-
totalReimbursementWithFee: { type:
|
|
81
|
-
finalRentPayment: { type:
|
|
82
|
-
clientDeposit: { type:
|
|
83
|
-
firstRentPayment: { type:
|
|
80
|
+
totalReimbursementWithFee: { type: String, default: null },
|
|
81
|
+
finalRentPayment: { type: String, default: null },
|
|
82
|
+
clientDeposit: { type: String, default: null },
|
|
83
|
+
firstRentPayment: { type: String, default: null },
|
|
84
84
|
fees: [feeSchema],
|
|
85
85
|
ercFeatures: { type: mongoose.Schema.Types.Mixed, default: null },
|
|
86
86
|
cashflowPeriods: {
|
|
87
|
-
totalNoOfPayments: { type:
|
|
87
|
+
totalNoOfPayments: { type: String, default: null },
|
|
88
88
|
fixed: cashflowPeriodSchema,
|
|
89
89
|
variable: cashflowPeriodSchema,
|
|
90
90
|
total: cashflowPeriodSchema
|
|
@@ -92,8 +92,8 @@ const productFeaturesSchema = new mongoose.Schema({
|
|
|
92
92
|
icr: { type: String, default: null },
|
|
93
93
|
ufssProductCode: { type: String, default: null },
|
|
94
94
|
ufssInterestRateCode: { type: String, default: null },
|
|
95
|
-
stressedPayment: { type:
|
|
96
|
-
stressedPaymentRate: { type:
|
|
95
|
+
stressedPayment: { type: String, default: null },
|
|
96
|
+
stressedPaymentRate: { type: String, default: null },
|
|
97
97
|
calculations: calculationsSchema
|
|
98
98
|
});
|
|
99
99
|
|
|
@@ -4,11 +4,11 @@ import mongooseEncryption from "../utils/encryption.middleware.js";
|
|
|
4
4
|
const Schema = mongoose.Schema;
|
|
5
5
|
|
|
6
6
|
const solicitorSchema = new Schema({
|
|
7
|
-
dualRep: { type:
|
|
8
|
-
isSraApprovedManagers: { type:
|
|
9
|
-
pageValidFlag: { type:
|
|
7
|
+
dualRep: { type: String, default: false },
|
|
8
|
+
isSraApprovedManagers: { type: String, default: true },
|
|
9
|
+
pageValidFlag: { type: String, default: true },
|
|
10
10
|
solicitorsList: { type: String},
|
|
11
|
-
useExistingSolicitor: { type:
|
|
11
|
+
useExistingSolicitor: { type: String, default: true },
|
|
12
12
|
accountNumber: { type: String},
|
|
13
13
|
addressCity: { type: String},
|
|
14
14
|
addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
@@ -23,7 +23,7 @@ const solicitorSchema = new Schema({
|
|
|
23
23
|
contactPostcode: { type: String, },
|
|
24
24
|
email: { type: String },
|
|
25
25
|
institution: { type: String },
|
|
26
|
-
isActive: { type:
|
|
26
|
+
isActive: { type: String, default: true },
|
|
27
27
|
nameOfAccountHolder: { type: String },
|
|
28
28
|
nameOfFirm: { type: String},
|
|
29
29
|
signatory: { type: String},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamatix/gb-schemas",
|
|
3
|
-
"version": "0.21.
|
|
4
|
-
"description": "All the schemas for gatehouse bank back-end
|
|
3
|
+
"version": "0.21.8",
|
|
4
|
+
"description": "All the schemas for gatehouse bank back-end",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -8,10 +8,10 @@ const productCatalogueSchema = new mongoose.Schema({
|
|
|
8
8
|
applyFrom: { type: Date, required: true },
|
|
9
9
|
applyUntil: { type: Date, required: true },
|
|
10
10
|
submitUntil: { type: Date, required: true },
|
|
11
|
-
status: { type:
|
|
12
|
-
lockedForEdit: { type:
|
|
11
|
+
status: { type: String, required: true },
|
|
12
|
+
lockedForEdit: { type: String, required: true },
|
|
13
13
|
baseRateName: { type: String },
|
|
14
|
-
baseRate: { type:
|
|
14
|
+
baseRate: { type: String },
|
|
15
15
|
mapperName: { type: String }
|
|
16
16
|
}, {
|
|
17
17
|
timestamps: true
|
|
@@ -7,19 +7,19 @@ const ruleSchema = new mongoose.Schema({
|
|
|
7
7
|
name: { type: String, required: true },
|
|
8
8
|
description: { type: String },
|
|
9
9
|
scope: { type: String },
|
|
10
|
-
mandatory: { type:
|
|
10
|
+
mandatory: { type: String, required: true },
|
|
11
11
|
overrideRuleType: { type: String },
|
|
12
12
|
overrideRuleMessage: { type: String },
|
|
13
13
|
inheritedFrom: { type: String },
|
|
14
|
-
anyPass: { type:
|
|
15
|
-
preCashflow: { type:
|
|
14
|
+
anyPass: { type: String, required: true },
|
|
15
|
+
preCashflow: { type: String, required: true }
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
const productDefinitionsSchema = new mongoose.Schema({
|
|
19
19
|
productDefinitionId: { type: String, required: true },
|
|
20
20
|
productCatalogueId: { ref: "ProductCatalogue", type: mongoose.Schema.Types.ObjectId, required: true },
|
|
21
21
|
name: { type: String, required: true },
|
|
22
|
-
atLeastOnePass: { type:
|
|
22
|
+
atLeastOnePass: { type: String, required: true },
|
|
23
23
|
elements: { type: [mongoose.Schema.Types.Mixed], default: [] },
|
|
24
24
|
rules: { type: [ruleSchema], default: [] } // Embedded array of RuleSchema
|
|
25
25
|
}, {
|
|
@@ -4,23 +4,23 @@ import mongooseEncryption from "../utils/encryption.middleware.js";
|
|
|
4
4
|
const dataStreetSchema = new mongoose.Schema({
|
|
5
5
|
floorArea: { type: String, default: '' },
|
|
6
6
|
propertyType: { type: String, default: '' },
|
|
7
|
-
noOfBedrooms: { type:
|
|
8
|
-
noOfBathrooms: { type:
|
|
7
|
+
noOfBedrooms: { type: String, default: 0 },
|
|
8
|
+
noOfBathrooms: { type: String, default: 0 },
|
|
9
9
|
lats: { type: String, },
|
|
10
10
|
longs: { type: String, },
|
|
11
11
|
lmkKey: { type: String, default: '' },
|
|
12
|
-
matchConfidence: { type:
|
|
12
|
+
matchConfidence: { type: String, default: 0 },
|
|
13
13
|
transactions:[{
|
|
14
14
|
transactionDate: String,
|
|
15
15
|
epc: String,
|
|
16
16
|
price: String,
|
|
17
|
-
isNewBuild:
|
|
17
|
+
isNewBuild: String,
|
|
18
18
|
}],
|
|
19
19
|
nearByListings: [{
|
|
20
20
|
listedDate: String,
|
|
21
|
-
price:
|
|
22
|
-
noOfBedrooms:
|
|
23
|
-
noOfBathrooms:
|
|
21
|
+
price: String,
|
|
22
|
+
noOfBedrooms: String,
|
|
23
|
+
noOfBathrooms: String,
|
|
24
24
|
internalArea: String,
|
|
25
25
|
distance: String,
|
|
26
26
|
address: String,
|
|
@@ -28,9 +28,9 @@ const dataStreetSchema = new mongoose.Schema({
|
|
|
28
28
|
}],
|
|
29
29
|
nearByCompletedTransactions:[{
|
|
30
30
|
transactionDate: String,
|
|
31
|
-
price:
|
|
32
|
-
noOfBedrooms:
|
|
33
|
-
noOfBathrooms:
|
|
31
|
+
price: String,
|
|
32
|
+
noOfBedrooms: String,
|
|
33
|
+
noOfBathrooms: String,
|
|
34
34
|
internalArea: String,
|
|
35
35
|
distance: String,
|
|
36
36
|
address: String,
|
|
@@ -52,30 +52,30 @@ const dataStreetSchema = new mongoose.Schema({
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
const propertySchema = new mongoose.Schema({
|
|
55
|
-
haveAnyBuyToLetProperties: { type:
|
|
56
|
-
isPropertyInEnglandOrWales: { type:
|
|
55
|
+
haveAnyBuyToLetProperties: { type: String, required: true },
|
|
56
|
+
isPropertyInEnglandOrWales: { type: String, required: true },
|
|
57
57
|
price: { type: String, default: '' },
|
|
58
|
-
noOfBuyToLetProperties: { type:
|
|
58
|
+
noOfBuyToLetProperties: { type: String },
|
|
59
59
|
totalMonthlyRentalIncome: { type: String, default: '' },
|
|
60
60
|
totalMonthlyRepayment: { type: String, default: '' },
|
|
61
61
|
totalOutstandingBalance: { type: String, default: '' },
|
|
62
|
-
areAllBedRoomsOver10sqm: { type:
|
|
63
|
-
isBrickTileConstruction: { type:
|
|
62
|
+
areAllBedRoomsOver10sqm: { type: String, required: true },
|
|
63
|
+
isBrickTileConstruction: { type: String, required: true },
|
|
64
64
|
constructionDetails: { type: String, default: '' },
|
|
65
|
-
isExLAExclusion: { type:
|
|
66
|
-
isFlatLift: { type:
|
|
67
|
-
flatNumberOfBedrooms: { type:
|
|
68
|
-
isGreenEPC: { type:
|
|
65
|
+
isExLAExclusion: { type: String, required: true },
|
|
66
|
+
isFlatLift: { type: String, required: true },
|
|
67
|
+
flatNumberOfBedrooms: { type: String},
|
|
68
|
+
isGreenEPC: { type: String, required: true },
|
|
69
69
|
isGroundRent: { type: String, default: '' },
|
|
70
|
-
isHouseLicensed: { type:
|
|
71
|
-
houseNumberOfFloors: { type:
|
|
72
|
-
houseNumberOfKitchens: { type:
|
|
73
|
-
houseNumberOfLivingRooms: { type:
|
|
74
|
-
houseNumberOfBathrooms: { type:
|
|
75
|
-
houseNumberOfTenancies: { type:
|
|
76
|
-
hasHousePlanningPermission: { type:
|
|
77
|
-
isGarage: { type:
|
|
78
|
-
isNewBuild: { type:
|
|
70
|
+
isHouseLicensed: { type: String, required: true },
|
|
71
|
+
houseNumberOfFloors: { type: String },
|
|
72
|
+
houseNumberOfKitchens: { type: String },
|
|
73
|
+
houseNumberOfLivingRooms: { type: String },
|
|
74
|
+
houseNumberOfBathrooms: { type: String },
|
|
75
|
+
houseNumberOfTenancies: { type: String },
|
|
76
|
+
hasHousePlanningPermission: { type: String, required: true },
|
|
77
|
+
isGarage: { type: String, required: true },
|
|
78
|
+
isNewBuild: { type: String, required: true },
|
|
79
79
|
propertyAddressCity: { type: String, required: true },
|
|
80
80
|
propertyAddressCountry: { type: String, required: true },
|
|
81
81
|
propertyAddressLine1: { type: String, required: true },
|
|
@@ -84,15 +84,15 @@ const propertySchema = new mongoose.Schema({
|
|
|
84
84
|
propertyAddressPostCode: { type: String, required: true },
|
|
85
85
|
propertyTenureLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
86
86
|
propertyTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
87
|
-
propertyYearBuilt: { type:
|
|
88
|
-
receiptOfAnyDiscount: { type:
|
|
87
|
+
propertyYearBuilt: { type: String },
|
|
88
|
+
receiptOfAnyDiscount: { type: String, },
|
|
89
89
|
receiptOfDiscountDetails: { type: String, default: '' },
|
|
90
90
|
sectorExperience: { type: String, required: true },
|
|
91
91
|
serviceCharge: { type: String, default: '' },
|
|
92
92
|
unexpiredRemainingLease: { type: String, default: '' },
|
|
93
93
|
yearLeaseExpires: { type: String, default: '' },
|
|
94
94
|
energyEfficiencyRating: { type: String},
|
|
95
|
-
energyEfficiencyRatingValue: { type:
|
|
95
|
+
energyEfficiencyRatingValue: { type: String },
|
|
96
96
|
dataStreetSchema: dataStreetSchema,
|
|
97
97
|
}, {
|
|
98
98
|
toJSON: { virtuals: true },
|
package/shared/alert.model.js
CHANGED
|
@@ -20,7 +20,7 @@ const alertSchema = new mongoose.Schema({
|
|
|
20
20
|
type: mongoose.Schema.Types.ObjectId,
|
|
21
21
|
ref: "Lookup"
|
|
22
22
|
},
|
|
23
|
-
isActive: { type:
|
|
23
|
+
isActive: { type: String, default: true },
|
|
24
24
|
}, { timestamps: true });
|
|
25
25
|
|
|
26
26
|
alertSchema.plugin(mongooseEncryption);
|
|
@@ -9,7 +9,7 @@ const ApprivoSyncJourneySchema = new mongoose.Schema({
|
|
|
9
9
|
required: true
|
|
10
10
|
},
|
|
11
11
|
error: { type: String, default: null },
|
|
12
|
-
isFirstPull: { type:
|
|
12
|
+
isFirstPull: { type: String, required: true },
|
|
13
13
|
jobRunId: { type: mongoose.Schema.Types.ObjectId, ref: "Job_Run"},
|
|
14
14
|
startTime: {type: Date, default: null},
|
|
15
15
|
endTime: {type: Date, default: null},
|
|
@@ -2,7 +2,7 @@ import mongoose from "mongoose";
|
|
|
2
2
|
|
|
3
3
|
const jobSettingSchema = new mongoose.Schema({
|
|
4
4
|
name: { type: String, required: true },
|
|
5
|
-
isActive: { type:
|
|
5
|
+
isActive: { type: String, default: true },
|
|
6
6
|
frequency: {
|
|
7
7
|
type: String, default: '2 hours'
|
|
8
8
|
},
|
|
@@ -2,7 +2,7 @@ import mongoose from "mongoose";
|
|
|
2
2
|
import mongooseEncryption from "../utils/encryption.middleware.js";
|
|
3
3
|
|
|
4
4
|
const RoleGroupSchema = new mongoose.Schema({
|
|
5
|
-
groupId: { type:
|
|
5
|
+
groupId: { type: String, required: true },
|
|
6
6
|
name: { type: String, required: true },
|
|
7
7
|
description: { type: String },
|
|
8
8
|
roles: [{
|
package/users/role.model.js
CHANGED
|
@@ -2,7 +2,7 @@ import mongoose from "mongoose";
|
|
|
2
2
|
import mongooseEncryption from "../utils/encryption.middleware.js";
|
|
3
3
|
|
|
4
4
|
const RoleSchema = new mongoose.Schema({
|
|
5
|
-
roleId: { type:
|
|
5
|
+
roleId: { type: String, required: true },
|
|
6
6
|
name: { type: String, required: true },
|
|
7
7
|
description: { type: String },
|
|
8
8
|
permissions: [{
|
package/users/user.model.js
CHANGED
|
@@ -7,12 +7,12 @@ const ClaimSchema = new mongoose.Schema({
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
const userSchema = new mongoose.Schema({
|
|
10
|
-
accountId: { type:
|
|
10
|
+
accountId: { type: String, required: true },
|
|
11
11
|
email: { type: String, required: true },
|
|
12
12
|
fullName: { type: String, required: true },
|
|
13
13
|
password: { type: String, required: true },
|
|
14
14
|
organisationId: { type: mongoose.Schema.Types.Mixed },
|
|
15
|
-
status: { type:
|
|
15
|
+
status: { type: String, required: true },
|
|
16
16
|
groups: [{
|
|
17
17
|
type: mongoose.Schema.Types.ObjectId,
|
|
18
18
|
ref: 'RoleGroup'
|
|
@@ -39,10 +39,10 @@ export default function mongooseEncryption(schema, options) {
|
|
|
39
39
|
|
|
40
40
|
// Decrypt after bulkWrite operations
|
|
41
41
|
schema.post("bulkWrite", function (result) {
|
|
42
|
-
result.result.
|
|
42
|
+
result.result.insertedIds.forEach(doc => {
|
|
43
43
|
doc.set(decryptObject(doc.toObject(), collectionName)); // Decrypt document fields
|
|
44
44
|
});
|
|
45
|
-
result.result.
|
|
45
|
+
result.result.upserted.forEach(doc => {
|
|
46
46
|
doc.set(decryptObject(doc.toObject(), collectionName)); // Decrypt document fields
|
|
47
47
|
});
|
|
48
48
|
});
|