@dynamatix/gb-schemas 1.2.7 → 1.2.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-commitment.model.d.ts +6 -6
- package/dist/applicants/applicant.model.d.ts +36 -36
- package/dist/applications/application-mortgage.model.d.ts +1105 -154
- package/dist/applications/application-mortgage.model.d.ts.map +1 -1
- package/dist/applications/application-mortgage.model.js +131 -27
- package/dist/applications/application.model.d.ts +24 -24
- package/dist/applications/application.model.js +2 -2
- package/dist/applications/productfeatures.model.d.ts +6 -6
- package/dist/properties/index.d.ts +1 -1
- package/dist/properties/index.d.ts.map +1 -1
- package/dist/properties/index.js +1 -1
- package/dist/properties/property.model.d.ts +1089 -259
- package/dist/properties/property.model.d.ts.map +1 -1
- package/dist/properties/property.model.js +102 -111
- package/dist/properties/security.model.d.ts +279 -0
- package/dist/properties/security.model.d.ts.map +1 -0
- package/dist/properties/security.model.js +149 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.model.d.ts","sourceRoot":"","sources":["../../properties/property.model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"property.model.d.ts","sourceRoot":"","sources":["../../properties/property.model.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAoH/C,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6C,CAAC;AACjE,eAAe,aAAa,CAAC"}
|
|
@@ -1,122 +1,113 @@
|
|
|
1
|
-
import mongoose from
|
|
2
|
-
import { Pound } from
|
|
3
|
-
const dataStreetSchema = new mongoose.Schema({
|
|
4
|
-
floorArea: { type: String, default: '' },
|
|
5
|
-
propertyType: { type: String, default: '' },
|
|
6
|
-
noOfBedrooms: { type: String, default: 0 },
|
|
7
|
-
noOfBathrooms: { type: String, default: 0 },
|
|
8
|
-
lats: { type: String, },
|
|
9
|
-
longs: { type: String, },
|
|
10
|
-
lmkKey: { type: String, default: '' },
|
|
11
|
-
matchConfidence: { type: String, default: 0 },
|
|
12
|
-
transactions: [{
|
|
13
|
-
transactionDate: String,
|
|
14
|
-
epc: String,
|
|
15
|
-
price: String,
|
|
16
|
-
isNewBuild: String,
|
|
17
|
-
}],
|
|
18
|
-
nearByListings: [{
|
|
19
|
-
listedDate: String,
|
|
20
|
-
price: String,
|
|
21
|
-
noOfBedrooms: String,
|
|
22
|
-
noOfBathrooms: String,
|
|
23
|
-
internalArea: String,
|
|
24
|
-
distance: String,
|
|
25
|
-
address: String,
|
|
26
|
-
propertyType: String
|
|
27
|
-
}],
|
|
28
|
-
nearByCompletedTransactions: [{
|
|
29
|
-
transactionDate: String,
|
|
30
|
-
price: String,
|
|
31
|
-
noOfBedrooms: String,
|
|
32
|
-
noOfBathrooms: String,
|
|
33
|
-
internalArea: String,
|
|
34
|
-
distance: String,
|
|
35
|
-
address: String,
|
|
36
|
-
}],
|
|
37
|
-
risk: {
|
|
38
|
-
conservationArea: String,
|
|
39
|
-
listedBuildingsOnPlot: String,
|
|
40
|
-
nearByListedBuildings: [{
|
|
41
|
-
name: String,
|
|
42
|
-
listedDate: String,
|
|
43
|
-
grade: String,
|
|
44
|
-
disatanceInMetres: String
|
|
45
|
-
}],
|
|
46
|
-
floodRisk: {
|
|
47
|
-
riverAndSeaRisk: String,
|
|
48
|
-
surfaceWaterRisk: String,
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import { Pound } from '../value-objects/pound';
|
|
52
3
|
const propertySchema = new mongoose.Schema({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
4
|
+
propertyId: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true,
|
|
7
|
+
unique: true,
|
|
8
|
+
description: "Unique identifier for the property"
|
|
9
|
+
},
|
|
10
|
+
addressLine1: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
maxLength: 35,
|
|
14
|
+
description: "First line of the property address"
|
|
15
|
+
},
|
|
16
|
+
addressLine2: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: false,
|
|
19
|
+
maxLength: 35,
|
|
20
|
+
description: "Second line of the property address"
|
|
21
|
+
},
|
|
22
|
+
addressLine3: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false,
|
|
25
|
+
maxLength: 35,
|
|
26
|
+
description: "Third line of the property address"
|
|
27
|
+
},
|
|
28
|
+
associatedLoanParties: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: false,
|
|
31
|
+
description: "Checkbox to allow selection of the applicants on the application, including the company if applicable"
|
|
32
|
+
},
|
|
33
|
+
city: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: false,
|
|
36
|
+
maxLength: 30,
|
|
37
|
+
description: "City where the property is located"
|
|
38
|
+
},
|
|
39
|
+
countryLid: {
|
|
40
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
41
|
+
ref: 'Lookup',
|
|
42
|
+
required: true,
|
|
43
|
+
description: "Country where the property is located",
|
|
44
|
+
},
|
|
45
|
+
lender: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true,
|
|
48
|
+
maxLength: 35,
|
|
49
|
+
description: "Lender providing the loan for the property"
|
|
50
|
+
},
|
|
51
|
+
marketValue: {
|
|
52
|
+
type: Pound,
|
|
53
|
+
required: true,
|
|
54
|
+
default: '£0.00',
|
|
55
|
+
description: "The market value of the property",
|
|
56
|
+
},
|
|
57
|
+
monthlyRent: {
|
|
69
58
|
type: Pound,
|
|
70
59
|
required: true,
|
|
71
|
-
default: '£0.00'
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
houseNumberOfKitchens: { type: Number, required: true }, // form
|
|
76
|
-
houseNumberOfLivingRooms: { type: Number, required: true }, // form
|
|
77
|
-
houseNumberOfBathrooms: { type: Number, required: true }, // form
|
|
78
|
-
houseNumberOfTenancies: { type: Number, required: true }, // form
|
|
79
|
-
hasHousePlanningPermission: { type: Boolean, required: true },
|
|
80
|
-
isGarage: { type: Boolean }, // form
|
|
81
|
-
isNewBuild: { type: Boolean, required: true }, // form
|
|
82
|
-
propertyAddressCity: { type: String, default: '', maxlength: 30 }, // form
|
|
83
|
-
propertyAddressCountry: { type: String, required: true }, // form
|
|
84
|
-
propertyAddressLine1: { type: String, required: true, maxlength: 35 }, // form
|
|
85
|
-
propertyAddressLine2: { type: String, default: '', maxlength: 35 }, // form
|
|
86
|
-
propertyAddressLine3: { type: String, default: '', maxlength: 35 }, // form
|
|
87
|
-
propertyAddressPostCode: { type: String, required: true, maxlength: 50 }, // form
|
|
88
|
-
propertyTenureLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }, // form
|
|
89
|
-
propertyTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" }, // form
|
|
90
|
-
propertyYearBuilt: { type: Number, required: true, maxlength: 4 }, // form
|
|
91
|
-
receiptOfAnyDiscount: { type: Boolean, required: true }, // form
|
|
92
|
-
receiptOfDiscountDetails: { type: String, required: true, default: '', maxlength: 100 }, // form
|
|
93
|
-
sectorExperience: { type: String, required: true }, // form
|
|
94
|
-
serviceCharge: {
|
|
60
|
+
default: '£0.00',
|
|
61
|
+
description: "The monthly rent value of the property"
|
|
62
|
+
},
|
|
63
|
+
monthlyRepayment: {
|
|
95
64
|
type: Pound,
|
|
96
65
|
required: true,
|
|
97
|
-
default: '£0.00'
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
66
|
+
default: '£0.00',
|
|
67
|
+
description: "The monthly repayment value for the property"
|
|
68
|
+
},
|
|
69
|
+
originalLoanBalance: {
|
|
70
|
+
type: Pound,
|
|
71
|
+
required: true,
|
|
72
|
+
default: '£0.00',
|
|
73
|
+
description: "The original loan balance for the property"
|
|
74
|
+
},
|
|
75
|
+
outstandingBalance: {
|
|
76
|
+
type: Pound,
|
|
77
|
+
required: true,
|
|
78
|
+
default: '£0.00',
|
|
79
|
+
description: "The remaining outstanding balance of the property loan"
|
|
80
|
+
},
|
|
81
|
+
otherOwnershipParties: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: false,
|
|
84
|
+
maxLength: 500,
|
|
85
|
+
description: "Other parties that own the property"
|
|
86
|
+
},
|
|
87
|
+
postcode: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: true,
|
|
90
|
+
maxLength: 50,
|
|
91
|
+
description: "The postcode for the property"
|
|
92
|
+
},
|
|
93
|
+
remainingTerm: {
|
|
94
|
+
type: Number,
|
|
95
|
+
required: true,
|
|
96
|
+
max: 4,
|
|
97
|
+
description: "The remaining term of the loan in years"
|
|
98
|
+
},
|
|
104
99
|
}, {
|
|
100
|
+
timestamps: true,
|
|
105
101
|
toJSON: { virtuals: true },
|
|
106
102
|
toObject: { virtuals: true }
|
|
107
103
|
});
|
|
108
|
-
//
|
|
109
|
-
propertySchema.virtual('
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
115
|
-
// virtual property 'type'
|
|
116
|
-
propertySchema.virtual('type').get(function () {
|
|
117
|
-
return this.propertyTypeLid && this.propertyTypeLid instanceof mongoose.Types.ObjectId
|
|
118
|
-
? null
|
|
119
|
-
: this.propertyTypeLid?.name || null;
|
|
104
|
+
// Virtual property for countryLid (reference to Lookup collection)
|
|
105
|
+
const virtualCountry = propertySchema.virtual('country', {
|
|
106
|
+
ref: 'Lookup',
|
|
107
|
+
localField: 'countryLid',
|
|
108
|
+
foreignField: '_id',
|
|
109
|
+
justOne: true,
|
|
120
110
|
});
|
|
121
|
-
|
|
111
|
+
virtualCountry.description = 'Populated lookup value for country';
|
|
112
|
+
const PropertyModel = mongoose.model('Property', propertySchema);
|
|
122
113
|
export default PropertyModel;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
declare const SecurityModel: mongoose.Model<{
|
|
3
|
+
pageValidFlag: any;
|
|
4
|
+
haveAnyBuyToLetProperties: any;
|
|
5
|
+
isPropertyInEnglandOrWales: any;
|
|
6
|
+
noOfBuyToLetProperties: any;
|
|
7
|
+
totalMonthlyRentalIncome: any;
|
|
8
|
+
totalMonthlyRepayment: any;
|
|
9
|
+
totalOutstandingBalance: any;
|
|
10
|
+
areAllBedRoomsOver10sqm: any;
|
|
11
|
+
isBrickTileConstruction: any;
|
|
12
|
+
constructionDetails: any;
|
|
13
|
+
isExLAExclusion: any;
|
|
14
|
+
isFlatLift: any;
|
|
15
|
+
flatNumberOfBedrooms: any;
|
|
16
|
+
isGreenEPC: any;
|
|
17
|
+
isGroundRent: any;
|
|
18
|
+
isHouseLicensed: any;
|
|
19
|
+
houseNumberOfFloors: any;
|
|
20
|
+
houseNumberOfKitchens: any;
|
|
21
|
+
houseNumberOfLivingRooms: any;
|
|
22
|
+
houseNumberOfBathrooms: any;
|
|
23
|
+
houseNumberOfTenancies: any;
|
|
24
|
+
hasHousePlanningPermission: any;
|
|
25
|
+
isGarage: any;
|
|
26
|
+
isNewBuild: any;
|
|
27
|
+
propertyAddressCity: any;
|
|
28
|
+
propertyAddressCountryLid: any;
|
|
29
|
+
propertyAddressLine1: any;
|
|
30
|
+
propertyAddressLine2: any;
|
|
31
|
+
propertyAddressLine3: any;
|
|
32
|
+
propertyAddressPostCode: any;
|
|
33
|
+
propertyTenureLid: any;
|
|
34
|
+
propertyTypeLid: any;
|
|
35
|
+
propertyYearBuilt: any;
|
|
36
|
+
receiptOfAnyDiscount: any;
|
|
37
|
+
receiptOfDiscountDetails: any;
|
|
38
|
+
sectorExperience: any;
|
|
39
|
+
serviceCharge: any;
|
|
40
|
+
unexpiredRemainingLease: any;
|
|
41
|
+
yearLeaseExpires: any;
|
|
42
|
+
energyEfficiencyRating: any;
|
|
43
|
+
energyEfficiencyRatingValue: any;
|
|
44
|
+
dataStreetSchema: any;
|
|
45
|
+
}, {}, {}, {}, mongoose.Document<unknown, {}, {
|
|
46
|
+
pageValidFlag: any;
|
|
47
|
+
haveAnyBuyToLetProperties: any;
|
|
48
|
+
isPropertyInEnglandOrWales: any;
|
|
49
|
+
noOfBuyToLetProperties: any;
|
|
50
|
+
totalMonthlyRentalIncome: any;
|
|
51
|
+
totalMonthlyRepayment: any;
|
|
52
|
+
totalOutstandingBalance: any;
|
|
53
|
+
areAllBedRoomsOver10sqm: any;
|
|
54
|
+
isBrickTileConstruction: any;
|
|
55
|
+
constructionDetails: any;
|
|
56
|
+
isExLAExclusion: any;
|
|
57
|
+
isFlatLift: any;
|
|
58
|
+
flatNumberOfBedrooms: any;
|
|
59
|
+
isGreenEPC: any;
|
|
60
|
+
isGroundRent: any;
|
|
61
|
+
isHouseLicensed: any;
|
|
62
|
+
houseNumberOfFloors: any;
|
|
63
|
+
houseNumberOfKitchens: any;
|
|
64
|
+
houseNumberOfLivingRooms: any;
|
|
65
|
+
houseNumberOfBathrooms: any;
|
|
66
|
+
houseNumberOfTenancies: any;
|
|
67
|
+
hasHousePlanningPermission: any;
|
|
68
|
+
isGarage: any;
|
|
69
|
+
isNewBuild: any;
|
|
70
|
+
propertyAddressCity: any;
|
|
71
|
+
propertyAddressCountryLid: any;
|
|
72
|
+
propertyAddressLine1: any;
|
|
73
|
+
propertyAddressLine2: any;
|
|
74
|
+
propertyAddressLine3: any;
|
|
75
|
+
propertyAddressPostCode: any;
|
|
76
|
+
propertyTenureLid: any;
|
|
77
|
+
propertyTypeLid: any;
|
|
78
|
+
propertyYearBuilt: any;
|
|
79
|
+
receiptOfAnyDiscount: any;
|
|
80
|
+
receiptOfDiscountDetails: any;
|
|
81
|
+
sectorExperience: any;
|
|
82
|
+
serviceCharge: any;
|
|
83
|
+
unexpiredRemainingLease: any;
|
|
84
|
+
yearLeaseExpires: any;
|
|
85
|
+
energyEfficiencyRating: any;
|
|
86
|
+
energyEfficiencyRatingValue: any;
|
|
87
|
+
dataStreetSchema: any;
|
|
88
|
+
}> & {
|
|
89
|
+
pageValidFlag: any;
|
|
90
|
+
haveAnyBuyToLetProperties: any;
|
|
91
|
+
isPropertyInEnglandOrWales: any;
|
|
92
|
+
noOfBuyToLetProperties: any;
|
|
93
|
+
totalMonthlyRentalIncome: any;
|
|
94
|
+
totalMonthlyRepayment: any;
|
|
95
|
+
totalOutstandingBalance: any;
|
|
96
|
+
areAllBedRoomsOver10sqm: any;
|
|
97
|
+
isBrickTileConstruction: any;
|
|
98
|
+
constructionDetails: any;
|
|
99
|
+
isExLAExclusion: any;
|
|
100
|
+
isFlatLift: any;
|
|
101
|
+
flatNumberOfBedrooms: any;
|
|
102
|
+
isGreenEPC: any;
|
|
103
|
+
isGroundRent: any;
|
|
104
|
+
isHouseLicensed: any;
|
|
105
|
+
houseNumberOfFloors: any;
|
|
106
|
+
houseNumberOfKitchens: any;
|
|
107
|
+
houseNumberOfLivingRooms: any;
|
|
108
|
+
houseNumberOfBathrooms: any;
|
|
109
|
+
houseNumberOfTenancies: any;
|
|
110
|
+
hasHousePlanningPermission: any;
|
|
111
|
+
isGarage: any;
|
|
112
|
+
isNewBuild: any;
|
|
113
|
+
propertyAddressCity: any;
|
|
114
|
+
propertyAddressCountryLid: any;
|
|
115
|
+
propertyAddressLine1: any;
|
|
116
|
+
propertyAddressLine2: any;
|
|
117
|
+
propertyAddressLine3: any;
|
|
118
|
+
propertyAddressPostCode: any;
|
|
119
|
+
propertyTenureLid: any;
|
|
120
|
+
propertyTypeLid: any;
|
|
121
|
+
propertyYearBuilt: any;
|
|
122
|
+
receiptOfAnyDiscount: any;
|
|
123
|
+
receiptOfDiscountDetails: any;
|
|
124
|
+
sectorExperience: any;
|
|
125
|
+
serviceCharge: any;
|
|
126
|
+
unexpiredRemainingLease: any;
|
|
127
|
+
yearLeaseExpires: any;
|
|
128
|
+
energyEfficiencyRating: any;
|
|
129
|
+
energyEfficiencyRatingValue: any;
|
|
130
|
+
dataStreetSchema: any;
|
|
131
|
+
} & {
|
|
132
|
+
_id: mongoose.Types.ObjectId;
|
|
133
|
+
} & {
|
|
134
|
+
__v: number;
|
|
135
|
+
}, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
136
|
+
toJSON: {
|
|
137
|
+
getters: true;
|
|
138
|
+
virtuals: true;
|
|
139
|
+
};
|
|
140
|
+
toObject: {
|
|
141
|
+
getters: true;
|
|
142
|
+
virtuals: true;
|
|
143
|
+
};
|
|
144
|
+
}, {
|
|
145
|
+
pageValidFlag: any;
|
|
146
|
+
haveAnyBuyToLetProperties: any;
|
|
147
|
+
isPropertyInEnglandOrWales: any;
|
|
148
|
+
noOfBuyToLetProperties: any;
|
|
149
|
+
totalMonthlyRentalIncome: any;
|
|
150
|
+
totalMonthlyRepayment: any;
|
|
151
|
+
totalOutstandingBalance: any;
|
|
152
|
+
areAllBedRoomsOver10sqm: any;
|
|
153
|
+
isBrickTileConstruction: any;
|
|
154
|
+
constructionDetails: any;
|
|
155
|
+
isExLAExclusion: any;
|
|
156
|
+
isFlatLift: any;
|
|
157
|
+
flatNumberOfBedrooms: any;
|
|
158
|
+
isGreenEPC: any;
|
|
159
|
+
isGroundRent: any;
|
|
160
|
+
isHouseLicensed: any;
|
|
161
|
+
houseNumberOfFloors: any;
|
|
162
|
+
houseNumberOfKitchens: any;
|
|
163
|
+
houseNumberOfLivingRooms: any;
|
|
164
|
+
houseNumberOfBathrooms: any;
|
|
165
|
+
houseNumberOfTenancies: any;
|
|
166
|
+
hasHousePlanningPermission: any;
|
|
167
|
+
isGarage: any;
|
|
168
|
+
isNewBuild: any;
|
|
169
|
+
propertyAddressCity: any;
|
|
170
|
+
propertyAddressCountryLid: any;
|
|
171
|
+
propertyAddressLine1: any;
|
|
172
|
+
propertyAddressLine2: any;
|
|
173
|
+
propertyAddressLine3: any;
|
|
174
|
+
propertyAddressPostCode: any;
|
|
175
|
+
propertyTenureLid: any;
|
|
176
|
+
propertyTypeLid: any;
|
|
177
|
+
propertyYearBuilt: any;
|
|
178
|
+
receiptOfAnyDiscount: any;
|
|
179
|
+
receiptOfDiscountDetails: any;
|
|
180
|
+
sectorExperience: any;
|
|
181
|
+
serviceCharge: any;
|
|
182
|
+
unexpiredRemainingLease: any;
|
|
183
|
+
yearLeaseExpires: any;
|
|
184
|
+
energyEfficiencyRating: any;
|
|
185
|
+
energyEfficiencyRatingValue: any;
|
|
186
|
+
dataStreetSchema: any;
|
|
187
|
+
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
188
|
+
pageValidFlag: any;
|
|
189
|
+
haveAnyBuyToLetProperties: any;
|
|
190
|
+
isPropertyInEnglandOrWales: any;
|
|
191
|
+
noOfBuyToLetProperties: any;
|
|
192
|
+
totalMonthlyRentalIncome: any;
|
|
193
|
+
totalMonthlyRepayment: any;
|
|
194
|
+
totalOutstandingBalance: any;
|
|
195
|
+
areAllBedRoomsOver10sqm: any;
|
|
196
|
+
isBrickTileConstruction: any;
|
|
197
|
+
constructionDetails: any;
|
|
198
|
+
isExLAExclusion: any;
|
|
199
|
+
isFlatLift: any;
|
|
200
|
+
flatNumberOfBedrooms: any;
|
|
201
|
+
isGreenEPC: any;
|
|
202
|
+
isGroundRent: any;
|
|
203
|
+
isHouseLicensed: any;
|
|
204
|
+
houseNumberOfFloors: any;
|
|
205
|
+
houseNumberOfKitchens: any;
|
|
206
|
+
houseNumberOfLivingRooms: any;
|
|
207
|
+
houseNumberOfBathrooms: any;
|
|
208
|
+
houseNumberOfTenancies: any;
|
|
209
|
+
hasHousePlanningPermission: any;
|
|
210
|
+
isGarage: any;
|
|
211
|
+
isNewBuild: any;
|
|
212
|
+
propertyAddressCity: any;
|
|
213
|
+
propertyAddressCountryLid: any;
|
|
214
|
+
propertyAddressLine1: any;
|
|
215
|
+
propertyAddressLine2: any;
|
|
216
|
+
propertyAddressLine3: any;
|
|
217
|
+
propertyAddressPostCode: any;
|
|
218
|
+
propertyTenureLid: any;
|
|
219
|
+
propertyTypeLid: any;
|
|
220
|
+
propertyYearBuilt: any;
|
|
221
|
+
receiptOfAnyDiscount: any;
|
|
222
|
+
receiptOfDiscountDetails: any;
|
|
223
|
+
sectorExperience: any;
|
|
224
|
+
serviceCharge: any;
|
|
225
|
+
unexpiredRemainingLease: any;
|
|
226
|
+
yearLeaseExpires: any;
|
|
227
|
+
energyEfficiencyRating: any;
|
|
228
|
+
energyEfficiencyRatingValue: any;
|
|
229
|
+
dataStreetSchema: any;
|
|
230
|
+
}>> & mongoose.FlatRecord<{
|
|
231
|
+
pageValidFlag: any;
|
|
232
|
+
haveAnyBuyToLetProperties: any;
|
|
233
|
+
isPropertyInEnglandOrWales: any;
|
|
234
|
+
noOfBuyToLetProperties: any;
|
|
235
|
+
totalMonthlyRentalIncome: any;
|
|
236
|
+
totalMonthlyRepayment: any;
|
|
237
|
+
totalOutstandingBalance: any;
|
|
238
|
+
areAllBedRoomsOver10sqm: any;
|
|
239
|
+
isBrickTileConstruction: any;
|
|
240
|
+
constructionDetails: any;
|
|
241
|
+
isExLAExclusion: any;
|
|
242
|
+
isFlatLift: any;
|
|
243
|
+
flatNumberOfBedrooms: any;
|
|
244
|
+
isGreenEPC: any;
|
|
245
|
+
isGroundRent: any;
|
|
246
|
+
isHouseLicensed: any;
|
|
247
|
+
houseNumberOfFloors: any;
|
|
248
|
+
houseNumberOfKitchens: any;
|
|
249
|
+
houseNumberOfLivingRooms: any;
|
|
250
|
+
houseNumberOfBathrooms: any;
|
|
251
|
+
houseNumberOfTenancies: any;
|
|
252
|
+
hasHousePlanningPermission: any;
|
|
253
|
+
isGarage: any;
|
|
254
|
+
isNewBuild: any;
|
|
255
|
+
propertyAddressCity: any;
|
|
256
|
+
propertyAddressCountryLid: any;
|
|
257
|
+
propertyAddressLine1: any;
|
|
258
|
+
propertyAddressLine2: any;
|
|
259
|
+
propertyAddressLine3: any;
|
|
260
|
+
propertyAddressPostCode: any;
|
|
261
|
+
propertyTenureLid: any;
|
|
262
|
+
propertyTypeLid: any;
|
|
263
|
+
propertyYearBuilt: any;
|
|
264
|
+
receiptOfAnyDiscount: any;
|
|
265
|
+
receiptOfDiscountDetails: any;
|
|
266
|
+
sectorExperience: any;
|
|
267
|
+
serviceCharge: any;
|
|
268
|
+
unexpiredRemainingLease: any;
|
|
269
|
+
yearLeaseExpires: any;
|
|
270
|
+
energyEfficiencyRating: any;
|
|
271
|
+
energyEfficiencyRatingValue: any;
|
|
272
|
+
dataStreetSchema: any;
|
|
273
|
+
}> & {
|
|
274
|
+
_id: mongoose.Types.ObjectId;
|
|
275
|
+
} & {
|
|
276
|
+
__v: number;
|
|
277
|
+
}>>;
|
|
278
|
+
export default SecurityModel;
|
|
279
|
+
//# sourceMappingURL=security.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.model.d.ts","sourceRoot":"","sources":["../../properties/security.model.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAwJhC,QAAA,MAAM,aAAa;mBAhGV,GAAG;+BAGH,GAAG;gCAGH,GAAG;4BAEgD,GAAG;8BACmB,GAAG;2BACN,GAAG;6BACD,GAAG;6BAG3E,GAAG;6BAGH,GAAG;yBAC8D,GAAG;qBAGpE,GAAG;gBAGH,GAAG;0BAC8D,GAAG;gBAGpE,GAAG;kBAKH,GAAG;qBAGH,GAAG;yBAC6D,GAAG;2BACD,GAAG;8BACA,GAAG;4BACL,GAAG;4BACH,GAAG;gCAGtE,GAAG;cAGH,GAAG;gBAGH,GAAG;yBAC6D,GAAG;+BAC8B,GAAG;0BACnB,GAAG;0BACnB,GAAG;0BACH,GAAG;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;gCAGH,GAAG;4BAEgD,GAAG;8BACmB,GAAG;2BACN,GAAG;6BACD,GAAG;6BAG3E,GAAG;6BAGH,GAAG;yBAC8D,GAAG;qBAGpE,GAAG;gBAGH,GAAG;0BAC8D,GAAG;gBAGpE,GAAG;kBAKH,GAAG;qBAGH,GAAG;yBAC6D,GAAG;2BACD,GAAG;8BACA,GAAG;4BACL,GAAG;4BACH,GAAG;gCAGtE,GAAG;cAGH,GAAG;gBAGH,GAAG;yBAC6D,GAAG;+BAC8B,GAAG;0BACnB,GAAG;0BACnB,GAAG;0BACH,GAAG;6BACgB,GAAG;uBACE,GAAG;qBACrB,GAAG;uBACD,GAAG;0BAG5E,GAAG;8BACmF,GAAG;sBAC3B,GAAG;mBAKjE,GAAG;6BAC4E,GAAG;sBACrB,GAAG;4BACzB,GAAG;iCACE,GAAG;sBACd,GAAG;;;;;GAsBmB,CAAC;AACjE,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// security.model.ts
|
|
2
|
+
import mongoose from "mongoose";
|
|
3
|
+
import { Pound } from "../value-objects/pound";
|
|
4
|
+
const dataStreetSchema = new mongoose.Schema({
|
|
5
|
+
floorArea: { type: String, default: '' },
|
|
6
|
+
propertyType: { type: String, default: '' },
|
|
7
|
+
noOfBedrooms: { type: String, default: 0 },
|
|
8
|
+
noOfBathrooms: { type: String, default: 0 },
|
|
9
|
+
lats: { type: String, },
|
|
10
|
+
longs: { type: String, },
|
|
11
|
+
lmkKey: { type: String, default: '' },
|
|
12
|
+
matchConfidence: { type: String, default: 0 },
|
|
13
|
+
transactions: [{
|
|
14
|
+
transactionDate: String,
|
|
15
|
+
epc: String,
|
|
16
|
+
price: String,
|
|
17
|
+
isNewBuild: String,
|
|
18
|
+
}],
|
|
19
|
+
nearByListings: [{
|
|
20
|
+
listedDate: String,
|
|
21
|
+
price: String,
|
|
22
|
+
noOfBedrooms: String,
|
|
23
|
+
noOfBathrooms: String,
|
|
24
|
+
internalArea: String,
|
|
25
|
+
distance: String,
|
|
26
|
+
address: String,
|
|
27
|
+
propertyType: String
|
|
28
|
+
}],
|
|
29
|
+
nearByCompletedTransactions: [{
|
|
30
|
+
transactionDate: String,
|
|
31
|
+
price: String,
|
|
32
|
+
noOfBedrooms: String,
|
|
33
|
+
noOfBathrooms: String,
|
|
34
|
+
internalArea: String,
|
|
35
|
+
distance: String,
|
|
36
|
+
address: String,
|
|
37
|
+
}],
|
|
38
|
+
risk: {
|
|
39
|
+
conservationArea: String,
|
|
40
|
+
listedBuildingsOnPlot: String,
|
|
41
|
+
nearByListedBuildings: [{
|
|
42
|
+
name: String,
|
|
43
|
+
listedDate: String,
|
|
44
|
+
grade: String,
|
|
45
|
+
disatanceInMetres: String
|
|
46
|
+
}],
|
|
47
|
+
floodRisk: {
|
|
48
|
+
riverAndSeaRisk: String,
|
|
49
|
+
surfaceWaterRisk: String,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const securitySchema = new mongoose.Schema({
|
|
54
|
+
pageValidFlag: { type: Boolean, default: true,
|
|
55
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
56
|
+
}, //form
|
|
57
|
+
haveAnyBuyToLetProperties: { type: Boolean, required: true,
|
|
58
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
59
|
+
}, // not-form propertyData - not in Property form
|
|
60
|
+
isPropertyInEnglandOrWales: { type: Boolean, required: true,
|
|
61
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
62
|
+
}, // not-form propertyData - not in Property form
|
|
63
|
+
// price: { type: Pound, required: true, default: '£0.00'} as any, // *already in Purchase Form -> not-form mortgateData - pounds
|
|
64
|
+
noOfBuyToLetProperties: { type: Number, default: 0 }, // not-form propertyData - not in Property form
|
|
65
|
+
totalMonthlyRentalIncome: { type: Pound, required: true, default: '£0.00' }, // not-form pound propertyData - not in Property form
|
|
66
|
+
totalMonthlyRepayment: { type: Pound, required: true, default: '£0.00' }, // not-form pound propertyData - not in Property form
|
|
67
|
+
totalOutstandingBalance: { type: Pound, required: true, default: '£0.00' }, // not-form pound propertyData - not in Property form
|
|
68
|
+
areAllBedRoomsOver10sqm: { type: Boolean, required: true,
|
|
69
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
70
|
+
}, // form
|
|
71
|
+
isBrickTileConstruction: { type: Boolean, required: true,
|
|
72
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
73
|
+
}, // form
|
|
74
|
+
constructionDetails: { type: String, required: true, default: '' }, // form
|
|
75
|
+
isExLAExclusion: { type: Boolean, required: true,
|
|
76
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
77
|
+
}, // form
|
|
78
|
+
isFlatLift: { type: Boolean, required: true,
|
|
79
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
80
|
+
}, // form
|
|
81
|
+
flatNumberOfBedrooms: { type: Number, required: true, default: 0 }, // form
|
|
82
|
+
isGreenEPC: { type: Boolean,
|
|
83
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
84
|
+
}, // form
|
|
85
|
+
isGroundRent: {
|
|
86
|
+
type: Pound,
|
|
87
|
+
required: true,
|
|
88
|
+
default: '£0.00' // Default value in correct format
|
|
89
|
+
}, // form - pounds
|
|
90
|
+
isHouseLicensed: { type: Boolean, required: true,
|
|
91
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
92
|
+
}, // form
|
|
93
|
+
houseNumberOfFloors: { type: Number, required: true, default: 0 }, // form
|
|
94
|
+
houseNumberOfKitchens: { type: Number, required: true, default: 0 }, // form
|
|
95
|
+
houseNumberOfLivingRooms: { type: Number, required: true, default: 0 }, // form
|
|
96
|
+
houseNumberOfBathrooms: { type: Number, required: true, default: 0 }, // form
|
|
97
|
+
houseNumberOfTenancies: { type: Number, required: true, default: 0 }, // form
|
|
98
|
+
hasHousePlanningPermission: { type: Boolean, required: true,
|
|
99
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
100
|
+
}, // not-form securityData
|
|
101
|
+
isGarage: { type: Boolean,
|
|
102
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
103
|
+
}, // form
|
|
104
|
+
isNewBuild: { type: Boolean, required: true,
|
|
105
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
106
|
+
}, // form
|
|
107
|
+
propertyAddressCity: { type: String, default: '', maxlength: 30 }, // form
|
|
108
|
+
propertyAddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }, // form
|
|
109
|
+
propertyAddressLine1: { type: String, required: true, maxlength: 35, default: '' }, // form
|
|
110
|
+
propertyAddressLine2: { type: String, default: '', maxlength: 35 }, // form
|
|
111
|
+
propertyAddressLine3: { type: String, default: '', maxlength: 35 }, // form
|
|
112
|
+
propertyAddressPostCode: { type: String, required: true, maxlength: 50, default: '' }, // form
|
|
113
|
+
propertyTenureLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }, // form
|
|
114
|
+
propertyTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" }, // form
|
|
115
|
+
propertyYearBuilt: { type: Number, required: true, max: 9999, default: 0 }, // form
|
|
116
|
+
receiptOfAnyDiscount: { type: Boolean, required: true,
|
|
117
|
+
get: (value) => (value ? "Yes" : "No"),
|
|
118
|
+
}, // form
|
|
119
|
+
receiptOfDiscountDetails: { type: String, required: true, default: '', maxlength: 100 }, // form
|
|
120
|
+
sectorExperience: { type: String, required: true, default: '' }, // form
|
|
121
|
+
serviceCharge: {
|
|
122
|
+
type: Pound,
|
|
123
|
+
required: true,
|
|
124
|
+
default: '£0.00' // Default value in correct format
|
|
125
|
+
}, // form - pounds
|
|
126
|
+
unexpiredRemainingLease: { type: Number, required: true, max: 9999, default: 0 }, // form
|
|
127
|
+
yearLeaseExpires: { type: Number, required: true, default: 0 }, // not-form securityData
|
|
128
|
+
energyEfficiencyRating: { type: String }, // not-form data-street
|
|
129
|
+
energyEfficiencyRatingValue: { type: String }, // not-form data-street
|
|
130
|
+
dataStreetSchema: dataStreetSchema, // not-form data-street
|
|
131
|
+
}, {
|
|
132
|
+
toJSON: { getters: true, virtuals: true },
|
|
133
|
+
toObject: { getters: true, virtuals: true }
|
|
134
|
+
});
|
|
135
|
+
// virtual property 'tenure'
|
|
136
|
+
securitySchema.virtual('tenure').get(function () {
|
|
137
|
+
const propertyTenure = this.propertyTenureLid;
|
|
138
|
+
return propertyTenure && propertyTenure instanceof mongoose.Types.ObjectId
|
|
139
|
+
? null
|
|
140
|
+
: propertyTenure?.name || null;
|
|
141
|
+
});
|
|
142
|
+
// virtual property 'type'
|
|
143
|
+
securitySchema.virtual('type').get(function () {
|
|
144
|
+
return this.propertyTypeLid && this.propertyTypeLid instanceof mongoose.Types.ObjectId
|
|
145
|
+
? null
|
|
146
|
+
: this.propertyTypeLid?.name || null;
|
|
147
|
+
});
|
|
148
|
+
const SecurityModel = mongoose.model("Security", securitySchema);
|
|
149
|
+
export default SecurityModel;
|