@dynamatix/gb-schemas 0.7.0 → 0.8.0

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.
@@ -0,0 +1,9 @@
1
+ import mongoose from "mongoose";
2
+
3
+ const fieldConfigSchema = new mongoose.Schema({
4
+ fieldName: { type: String, required: true, unique: true },
5
+ validateProductOnChange: { type: Boolean, default: true }
6
+ });
7
+
8
+ const ApplicationFieldConfigModel = mongoose.model('FieldConfig', fieldConfigSchema);
9
+ export default ApplicationFieldConfigModel;
@@ -134,6 +134,16 @@ applicationSchema.virtual('noOfApplicants').get(function() {
134
134
  applicationSchema.virtual('solicitorEmail').get(function() {
135
135
  return this.solicitorId ? this.solicitorId?.email : null;
136
136
  });
137
+
138
+ // Virtual property for broker phone
139
+ applicationSchema.virtual('brokerPhone').get(function () {
140
+ return this.brokerId ? this.brokerId?.mobileTelephone : null;
141
+ });
142
+
143
+ // Virtual property for solicitor phone
144
+ applicationSchema.virtual('solicitorPhone').get(function () {
145
+ return this.solicitorId ? this.solicitorId?.telephone : null;
146
+ });
137
147
 
138
148
  const ApplicationModel = mongoose.model("Application", applicationSchema);
139
149
  export default ApplicationModel;
@@ -13,4 +13,5 @@ export { default as BrokerModel } from './broker.model.js';
13
13
  export { default as ProductFeaturesModel } from './productfeatures.model.js';
14
14
  export { default as SolicitorModel } from './solicitor.model.js';
15
15
  export { default as ApplicationDocumentModel } from './application-document.model.js';
16
- export { default as ApplicationRiskNarrativeModel } from './application-risk-narrative.model.js';
16
+ export { default as ApplicationRiskNarrativeModel } from './application-risk-narrative.model.js';
17
+ export { default as ApplicationFieldConfigModel } from './application-fieldconfig.model.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "index.js",
6
6
  "scripts": {