@dynamatix/gb-schemas 1.2.44 → 1.2.45

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.
@@ -1 +1 @@
1
- {"version":3,"file":"application-company-model.d.ts","sourceRoot":"","sources":["../../applications/application-company-model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAsLhD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAsD,CAAC;AACpF,eAAe,uBAAuB,CAAC"}
@@ -4,10 +4,7 @@ const companySchema = new mongoose.Schema({
4
4
  applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true,
5
5
  description: "Unique identifier for the application"
6
6
  },
7
- pageValidFlag: { type: Boolean, default: true,
8
- get: (value) => (value ? "Yes" : "No"),
9
- set: (value) => value.toLowerCase() === 'yes', // form - hidden
10
- },
7
+ pageValidFlag: { type: Boolean, default: true, },
11
8
  registeredName: { type: String, required: true, maxlength: 70, default: '' }, // form
12
9
  businessTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }, // form
13
10
  registeredNumber: { type: Number, max: 99999999, default: 0 }, // form
@@ -45,83 +42,16 @@ const companySchema = new mongoose.Schema({
45
42
  companySecuredArrears: { type: String, required: true, default: '' }, // form
46
43
  companyUnsecuredArrears: { type: String, required: true, default: '' }, // form
47
44
  companyBankruptcy: { type: String, required: true, default: '' }, // form
48
- companyBankruptcyYes: {
49
- type: Boolean,
50
- default: false,
51
- get: (value) => (value ? "Yes" : "No"),
52
- set: function (value) {
53
- this.companyBankruptcyNo = !(value.toString().toLowerCase() === 'yes');
54
- return value.toString().toLowerCase() === 'yes';
55
- }
56
- },
57
- companyBankruptcyNo: {
58
- type: Boolean,
59
- default: true,
60
- get: function () { return this.companyBankruptcyYes ? "No" : "Yes"; },
61
- set: function (value) {
62
- this.companyBankruptcyYes = !(value.toString().toLowerCase() === 'yes');
63
- return !this.companyBankruptcyYes;
64
- }
65
- },
66
- companyCCJInLastThreeYearYes: {
67
- type: Boolean,
68
- default: false,
69
- get: (value) => (value ? "Yes" : "No"),
70
- set: function (value) {
71
- this.companyCCJInLastThreeYearNo = !(value.toString().toLowerCase() === 'yes');
72
- return value.toString().toLowerCase() === 'yes';
73
- }
74
- },
75
- companyCCJInLastThreeYearNo: {
76
- type: Boolean,
77
- default: true,
78
- get: function () { return this.companyCCJInLastThreeYearYes ? "No" : "Yes"; },
79
- set: function (value) {
80
- this.companyCCJInLastThreeYearYes = !(value.toString().toLowerCase() === 'yes');
81
- return !this.companyCCJInLastThreeYearYes;
82
- }
83
- },
84
- companyDefaultsInLastYearYes: {
85
- type: Boolean,
86
- default: false,
87
- get: (value) => (value ? "Yes" : "No"),
88
- set: function (value) {
89
- this.companyDefaultsInLastYearNo = !(value.toString().toLowerCase() === 'yes');
90
- return value.toString().toLowerCase() === 'yes';
91
- }
92
- },
93
- companyDefaultsInLastYearNo: {
94
- type: Boolean,
95
- default: true,
96
- get: function () { return this.companyDefaultsInLastYearYes ? "No" : "Yes"; },
97
- set: function (value) {
98
- this.companyDefaultsInLastYearYes = !(value.toString().toLowerCase() === 'yes');
99
- return !this.companyDefaultsInLastYearYes;
100
- }
101
- },
102
- companyAnyVoluntaryEnforcedPossessionYes: {
103
- type: Boolean,
104
- default: false,
105
- get: (value) => (value ? "Yes" : "No"),
106
- set: function (value) {
107
- this.companyAnyVoluntaryEnforcedPossessionNo = !(value.toString().toLowerCase() === 'yes');
108
- return value.toString().toLowerCase() === 'yes';
109
- }
110
- },
111
- companyAnyVoluntaryEnforcedPossessionNo: {
112
- type: Boolean,
113
- default: true,
114
- get: function () { return this.companyAnyVoluntaryEnforcedPossessionYes ? "No" : "Yes"; },
115
- set: function (value) {
116
- this.companyAnyVoluntaryEnforcedPossessionYes = !(value.toString().toLowerCase() === 'yes');
117
- return !this.companyAnyVoluntaryEnforcedPossessionYes;
118
- }
119
- },
45
+ companyBankruptcyYes: { type: Boolean, default: false, },
46
+ companyBankruptcyNo: { type: Boolean, default: true, },
47
+ companyCCJInLastThreeYearYes: { type: Boolean, default: false, },
48
+ companyCCJInLastThreeYearNo: { type: Boolean, default: true, },
49
+ companyDefaultsInLastYearYes: { type: Boolean, default: false, },
50
+ companyDefaultsInLastYearNo: { type: Boolean, default: true, },
51
+ companyAnyVoluntaryEnforcedPossessionYes: { type: Boolean, default: false, },
52
+ companyAnyVoluntaryEnforcedPossessionNo: { type: Boolean, default: true, },
120
53
  // Not in form Fields
121
- doYouKnowRegisteredNumber: { type: Boolean, default: true,
122
- get: (value) => (value ? "Yes" : "No"),
123
- set: (value) => value.toLowerCase() === 'yes', // form
124
- },
54
+ doYouKnowRegisteredNumber: { type: Boolean, default: true, },
125
55
  sicCodes: [{ type: String, default: "" }],
126
56
  epc: { type: String, default: "" },
127
57
  remainingLease: { type: String, default: "" },
@@ -131,6 +61,30 @@ const companySchema = new mongoose.Schema({
131
61
  toJSON: { virtuals: true, getters: true },
132
62
  toObject: { virtuals: true, getters: true }
133
63
  });
64
+ ///////////////// HOOKS //////////////////
65
+ const yesNoPairs = [
66
+ ["companyBankruptcyYes", "companyBankruptcyNo"],
67
+ ["companyCCJInLastThreeYearYes", "companyCCJInLastThreeYearNo"],
68
+ ["companyDefaultsInLastYearYes", "companyDefaultsInLastYearNo"],
69
+ ["companyAnyVoluntaryEnforcedPossessionYes", "companyAnyVoluntaryEnforcedPossessionNo"],
70
+ ];
71
+ function handleYesNoLogic(update) {
72
+ const $set = update?.$set ?? update; // Handles both direct update and $set syntax
73
+ yesNoPairs.forEach(([yesKey, noKey]) => {
74
+ if (yesKey in $set) {
75
+ $set[noKey] = !$set[yesKey]; // Set No field to opposite of Yes field
76
+ }
77
+ // Prevent direct updates to No fields
78
+ if (noKey in $set) {
79
+ delete $set[noKey];
80
+ }
81
+ });
82
+ }
83
+ // Apply to various update operations - handle both cases
84
+ companySchema.pre("updateOne", function (next) {
85
+ handleYesNoLogic(this.getUpdate());
86
+ next();
87
+ });
134
88
  const virtualBusinessType = companySchema.virtual('businessType', {
135
89
  ref: 'Lookup',
136
90
  localField: 'businessTypeLid',
@@ -1 +1 @@
1
- {"version":3,"file":"security.model.d.ts","sourceRoot":"","sources":["../../properties/security.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAsLhC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6C,CAAC;AACjE,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"security.model.d.ts","sourceRoot":"","sources":["../../properties/security.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA0JhC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6C,CAAC;AACjE,eAAe,aAAa,CAAC"}
@@ -54,71 +54,35 @@ const securitySchema = new mongoose.Schema({
54
54
  applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true,
55
55
  description: "Unique identifier for the application"
56
56
  }, // not-form securityData
57
- pageValidFlag: { type: Boolean, default: true,
58
- get: (value) => (value ? "Yes" : "No"),
59
- set: (value) => value.toLowerCase() === "yes"
60
- }, //form
61
- haveAnyBuyToLetProperties: { type: Boolean, required: true,
62
- get: (value) => (value ? "Yes" : "No"),
63
- set: (value) => value.toLowerCase() === "yes"
64
- }, // not-form propertyData - not in Property form
65
- isPropertyInEnglandOrWales: { type: Boolean, required: true,
66
- get: (value) => (value ? "Yes" : "No"),
67
- set: (value) => value.toLowerCase() === "yes"
68
- }, // not-form propertyData - not in Property form
57
+ pageValidFlag: { type: Boolean, default: true, }, //form
58
+ haveAnyBuyToLetProperties: { type: Boolean, required: true, default: false }, // not-form propertyData - not in Property form
59
+ isPropertyInEnglandOrWales: { type: Boolean, required: true, default: false }, // not-form propertyData - not in Property form
69
60
  // price: { type: Pound, required: true, default: '£0.00'} as any, // *already in Purchase Form -> not-form mortgateData - pounds
70
61
  noOfBuyToLetProperties: { type: Number, default: 0 }, // not-form propertyData - not in Property form
71
62
  totalMonthlyRentalIncome: { type: Pound, required: true, default: '£0.00' }, // not-form pound propertyData - not in Property form
72
63
  totalMonthlyRepayment: { type: Pound, required: true, default: '£0.00' }, // not-form pound propertyData - not in Property form
73
64
  totalOutstandingBalance: { type: Pound, required: true, default: '£0.00' }, // not-form pound propertyData - not in Property form
74
- areAllBedRoomsOver10sqm: { type: Boolean, required: true,
75
- get: (value) => (value ? "Yes" : "No"),
76
- set: (value) => value.toLowerCase() === "yes"
77
- }, // form
78
- isBrickTileConstruction: { type: Boolean, required: true,
79
- get: (value) => (value ? "Yes" : "No"),
80
- set: (value) => value.toLowerCase() === "yes"
81
- }, // form
65
+ areAllBedRoomsOver10sqm: { type: Boolean, required: true, default: false }, // form
66
+ isBrickTileConstruction: { type: Boolean, required: true, default: false }, // form
82
67
  constructionDetails: { type: String, required: true, default: '' }, // form
83
- isExLAExclusion: { type: Boolean, required: true,
84
- get: (value) => (value ? "Yes" : "No"),
85
- set: (value) => value.toLowerCase() === "yes"
86
- }, // form
87
- isFlatLift: { type: Boolean, required: true,
88
- get: (value) => (value ? "Yes" : "No"),
89
- set: (value) => value.toLowerCase() === "yes"
90
- }, // form
68
+ isExLAExclusion: { type: Boolean, required: true, default: false }, // form
69
+ isFlatLift: { type: Boolean, required: true, default: false }, // form
91
70
  flatNumberOfBedrooms: { type: Number, required: true, default: 0 }, // form
92
- isGreenEPC: { type: Boolean,
93
- get: (value) => (value ? "Yes" : "No"),
94
- set: (value) => value.toLowerCase() === "yes"
95
- }, // form
71
+ isGreenEPC: { type: Boolean, default: false }, // form
96
72
  isGroundRent: {
97
73
  type: Pound,
98
74
  required: true,
99
75
  default: '£0.00' // Default value in correct format
100
76
  }, // form - pounds
101
- isHouseLicensed: { type: Boolean, required: true,
102
- get: (value) => (value ? "Yes" : "No"),
103
- set: (value) => value.toLowerCase() === "yes"
104
- }, // form
77
+ isHouseLicensed: { type: Boolean, required: true, default: false }, // form
105
78
  houseNumberOfFloors: { type: Number, required: true, default: 0 }, // form
106
79
  houseNumberOfKitchens: { type: Number, required: true, default: 0 }, // form
107
80
  houseNumberOfLivingRooms: { type: Number, required: true, default: 0 }, // form
108
81
  houseNumberOfBathrooms: { type: Number, required: true, default: 0 }, // form
109
82
  houseNumberOfTenancies: { type: Number, required: true, default: 0 }, // form
110
- hasHousePlanningPermission: { type: Boolean, required: true,
111
- get: (value) => (value ? "Yes" : "No"),
112
- set: (value) => value.toLowerCase() === "yes"
113
- }, // not-form securityData
114
- isGarage: { type: Boolean,
115
- get: (value) => (value ? "Yes" : "No"),
116
- set: (value) => value.toLowerCase() === "yes"
117
- }, // form
118
- isNewBuild: { type: Boolean, required: true,
119
- get: (value) => (value ? "Yes" : "No"),
120
- set: (value) => value.toLowerCase() === "yes"
121
- }, // form
83
+ hasHousePlanningPermission: { type: Boolean, required: true, default: false }, // not-form securityData
84
+ isGarage: { type: Boolean, default: false }, // form
85
+ isNewBuild: { type: Boolean, required: true, default: false }, // form
122
86
  propertyAddressCity: { type: String, default: '', maxlength: 30 }, // form
123
87
  propertyAddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }, // form
124
88
  propertyAddressLine1: { type: String, required: true, maxlength: 35, default: '' }, // form
@@ -128,10 +92,7 @@ const securitySchema = new mongoose.Schema({
128
92
  propertyTenureLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }, // form
129
93
  propertyTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" }, // form
130
94
  propertyYearBuilt: { type: Number, required: true, max: 9999, default: 0 }, // form
131
- receiptOfAnyDiscount: { type: Boolean, required: true,
132
- get: (value) => (value ? "Yes" : "No"),
133
- set: (value) => value.toLowerCase() === "yes"
134
- }, // form
95
+ receiptOfAnyDiscount: { type: Boolean, required: true, default: false }, // form
135
96
  receiptOfDiscountDetails: { type: String, required: true, default: '', maxlength: 100 }, // form
136
97
  sectorExperience: { type: String, required: true, default: '' }, // form
137
98
  serviceCharge: {
@@ -148,19 +109,24 @@ const securitySchema = new mongoose.Schema({
148
109
  toJSON: { getters: true, virtuals: true },
149
110
  toObject: { getters: true, virtuals: true }
150
111
  });
151
- // virtual property 'tenure'
152
- securitySchema.virtual('tenure').get(function () {
153
- const propertyTenure = this.propertyTenureLid;
154
- return propertyTenure && propertyTenure instanceof mongoose.Types.ObjectId
155
- ? null
156
- : propertyTenure?.name || null;
112
+ // Virtual for 'tenure'
113
+ const virtualTenure = securitySchema.virtual('tenure', {
114
+ ref: 'Lookup',
115
+ localField: 'propertyTenureLid',
116
+ foreignField: '_id',
117
+ justOne: true,
118
+ options: { select: 'label' },
157
119
  });
158
- // virtual property 'type'
159
- securitySchema.virtual('type').get(function () {
160
- return this.propertyTypeLid && this.propertyTypeLid instanceof mongoose.Types.ObjectId
161
- ? null
162
- : this.propertyTypeLid?.name || null;
120
+ virtualTenure.description = 'Populated lookup value for the property tenure';
121
+ // Virtual for 'type'
122
+ const virtualType = securitySchema.virtual('type', {
123
+ ref: 'Lookup',
124
+ localField: 'propertyTypeLid',
125
+ foreignField: '_id',
126
+ justOne: true,
127
+ options: { select: 'label' },
163
128
  });
129
+ virtualType.description = 'Populated lookup value for the property type';
164
130
  // virtual property 'applicationType'
165
131
  securitySchema.virtual('applicationType').get(function () {
166
132
  return this.applicationId?.applicationTypeLid instanceof mongoose.Types.ObjectId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.2.44",
3
+ "version": "1.2.45",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",