@dynamatix/gb-schemas 1.3.280 → 1.3.282

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,6 +1,5 @@
1
1
  import mongoose from "mongoose";
2
2
  import { Pound, formatPound } from "./../value-objects/pound";
3
- import { AccountNumber } from "../value-objects/account-number";
4
3
  const ApplicantShareholdingSchema = new mongoose.Schema({
5
4
  applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true, default: null },
6
5
  applicantName: { type: String, default: "" },
@@ -15,7 +14,7 @@ const companySchema = new mongoose.Schema({
15
14
  pageValidFlag: { type: Boolean, default: true, },
16
15
  registeredName: { type: String, required: true, maxlength: 70, default: '' }, // form
17
16
  businessTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }, // form
18
- registeredNumber: { type: AccountNumber, max: 99999999, default: 0 }, // form
17
+ registeredNumber: { type: String, maxlength: 8, default: '' }, // form
19
18
  taxJurisdictionLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }, // form
20
19
  tradingSince: { type: String, default: null }, // form
21
20
  natureOfBusiness: { type: String, maxlength: 100, default: '' }, // form
@@ -1 +1 @@
1
- {"version":3,"file":"application.model.d.ts","sourceRoot":"","sources":["../../applications/application.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAgPhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmD,CAAC;AAC1E,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"application.model.d.ts","sourceRoot":"","sources":["../../applications/application.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAoOhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmD,CAAC;AAC1E,eAAe,gBAAgB,CAAC"}
@@ -103,15 +103,9 @@ applicationSchema.virtual('status').get(function () {
103
103
  });
104
104
  // Ensure the fields are populated when querying
105
105
  applicationSchema.pre('find', function () {
106
- this.populate('applicationTypeLid')
107
- .populate('lendingTypeLid')
108
- .populate('statusLid')
109
- .populate('applicants')
110
- .populate('brokerId')
111
- .populate('solicitorId')
112
- .populate('mortgageId');
113
- });
114
- // Virtual property 'isUkResident' - computed from applicants
106
+ this.populate('applicationTypeLid').populate('lendingTypeLid').populate('statusLid');
107
+ });
108
+ // Virtual property 'isUkResident'
115
109
  applicationSchema.virtual('isUkResident').get(function () {
116
110
  if (!this.applicants || !Array.isArray(this.applicants))
117
111
  return false;
@@ -130,13 +124,7 @@ applicationSchema.virtual('isUkResident').get(function () {
130
124
  return false;
131
125
  });
132
126
  applicationSchema.pre('findOne', function () {
133
- this.populate('applicationTypeLid')
134
- .populate('lendingTypeLid')
135
- .populate('statusLid')
136
- .populate('applicants')
137
- .populate('brokerId')
138
- .populate('solicitorId')
139
- .populate('mortgageId');
127
+ this.populate('applicationTypeLid').populate('lendingTypeLid').populate('statusLid');
140
128
  });
141
129
  // Virtual property 'LTV %'
142
130
  applicationSchema.virtual('ltv').get(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.3.280",
3
+ "version": "1.3.282",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "homepage": "https://github.com/DynamatixAnalyticsPvtLtd/gb-schemas#readme",
28
28
  "dependencies": {
29
- "@dynamatix/cat-shared": "^0.0.115",
29
+ "@dynamatix/cat-shared": "^0.0.116",
30
30
  "@dynamatix/gb-schemas": "^1.3.256",
31
31
  "dotenv": "^16.4.5",
32
32
  "mongodb": "^6.14.2",