@dynamatix/gb-schemas 0.5.13 → 0.5.15
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.
|
@@ -107,15 +107,15 @@ const applicantSchema = new mongoose.Schema({
|
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
applicantSchema.virtual('nationality').get(function () {
|
|
110
|
-
return this.
|
|
110
|
+
return this.nationalityLid ? this.nationalityLid.name : null;
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
applicantSchema.virtual('residence').get(function () {
|
|
114
|
-
return this.
|
|
114
|
+
return this.countryOfResidenceLid ? this.countryOfResidenceLid.name : null;
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
applicantSchema.virtual('industry').get(function () {
|
|
118
|
-
return this.employment?.
|
|
118
|
+
return this.employment?.industryLid ? this.employment?.industryLid.name : null;
|
|
119
119
|
});
|
|
120
120
|
applicantSchema.set('toJSON', { virtuals: true });
|
|
121
121
|
const ApplicantModel = mongoose.model("Applicant", applicantSchema);
|
|
@@ -83,7 +83,7 @@ applicationSchema.virtual('noOfApplicants').get(function() {
|
|
|
83
83
|
|
|
84
84
|
// Virtual property 'applicationTypeName'
|
|
85
85
|
applicationSchema.virtual('applicationTypeName').get(function() {
|
|
86
|
-
return this.
|
|
86
|
+
return this.applicationTypeLid ? this.applicationTypeLid.name : null;
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
// Virtual property 'LTV %'
|
|
@@ -117,22 +117,22 @@ applicationSchema.virtual('noOfApplicants').get(function() {
|
|
|
117
117
|
|
|
118
118
|
// Virtual property for broker name
|
|
119
119
|
applicationSchema.virtual('brokerFirstName').get(function() {
|
|
120
|
-
return this.
|
|
120
|
+
return this.brokerId ? this.brokerId?.firstName : null;
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
// Virtual property for broker email
|
|
124
124
|
applicationSchema.virtual('brokerEmail').get(function() {
|
|
125
|
-
return this.
|
|
125
|
+
return this.brokerId ? this.brokerId?.email : null;
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
// Virtual property for solicitor name
|
|
129
129
|
applicationSchema.virtual('solicitorName').get(function() {
|
|
130
|
-
return this.
|
|
130
|
+
return this.solicitorId ? this.solicitorId?.nameOfAccountHolder : null;
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
// Virtual property for solicitor email
|
|
134
134
|
applicationSchema.virtual('solicitorEmail').get(function() {
|
|
135
|
-
return this.
|
|
135
|
+
return this.solicitorId ? this.solicitorId?.email : null;
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
const ApplicationModel = mongoose.model("Application", applicationSchema);
|
package/package.json
CHANGED
|
@@ -101,12 +101,12 @@ const propertySchema = new mongoose.Schema({
|
|
|
101
101
|
|
|
102
102
|
// virtual property 'tenure'
|
|
103
103
|
propertySchema.virtual('tenure').get(function () {
|
|
104
|
-
return this.
|
|
104
|
+
return this.propertyTenureLid ? this.propertyTenureLid.name : null;
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
// virtual property 'type'
|
|
108
108
|
propertySchema.virtual('type').get(function () {
|
|
109
|
-
return this.
|
|
109
|
+
return this.propertyTypeLid ? this.propertyTypeLid.name : null;
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
const PropertyModel = mongoose.model("Property", propertySchema);
|