@dynamatix/gb-schemas 1.2.50 → 1.2.52

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.
@@ -48,7 +48,7 @@ declare const applicantExpenditureSchema: mongoose.Schema<any, mongoose.Model<an
48
48
  vehicleInsurance: Pound;
49
49
  mortgagePaymentVehicle: Pound;
50
50
  other: Pound;
51
- totalMontlyExpenditure: string;
51
+ totalMontlyExpenditure?: string | null | undefined;
52
52
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
53
53
  pageValidFlag: boolean;
54
54
  utilities: Pound;
@@ -64,7 +64,7 @@ declare const applicantExpenditureSchema: mongoose.Schema<any, mongoose.Model<an
64
64
  vehicleInsurance: Pound;
65
65
  mortgagePaymentVehicle: Pound;
66
66
  other: Pound;
67
- totalMontlyExpenditure: string;
67
+ totalMontlyExpenditure?: string | null | undefined;
68
68
  }>> & mongoose.FlatRecord<{
69
69
  pageValidFlag: boolean;
70
70
  utilities: Pound;
@@ -80,7 +80,7 @@ declare const applicantExpenditureSchema: mongoose.Schema<any, mongoose.Model<an
80
80
  vehicleInsurance: Pound;
81
81
  mortgagePaymentVehicle: Pound;
82
82
  other: Pound;
83
- totalMontlyExpenditure: string;
83
+ totalMontlyExpenditure?: string | null | undefined;
84
84
  }> & {
85
85
  _id: mongoose.Types.ObjectId;
86
86
  } & {
@@ -15,7 +15,7 @@ const applicantExpenditureSchema = new mongoose.Schema({
15
15
  vehicleInsurance: { type: Pound, required: true },
16
16
  mortgagePaymentVehicle: { type: Pound, required: true },
17
17
  other: { type: Pound, required: true },
18
- totalMontlyExpenditure: { type: String, default: 0.00 }
18
+ totalMontlyExpenditure: { type: String, }
19
19
  }, {
20
20
  toJSON: { getters: true },
21
21
  toObject: { getters: true }
@@ -1 +1 @@
1
- {"version":3,"file":"solicitor.model.d.ts","sourceRoot":"","sources":["../../applications/solicitor.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAuHtD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA+C,CAAC;AACpE,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"solicitor.model.d.ts","sourceRoot":"","sources":["../../applications/solicitor.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAsHtD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA+C,CAAC;AACpE,eAAe,cAAc,CAAC"}
@@ -9,7 +9,6 @@ const solicitorSchema = new Schema({
9
9
  pageValidFlag: {
10
10
  type: Boolean,
11
11
  default: true,
12
- description: "Flag indicating if the page is valid"
13
12
  },
14
13
  accountNumber: {
15
14
  type: Number,
@@ -1 +1 @@
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;AAyI/C,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6C,CAAC;AACjE,eAAe,aAAa,CAAC"}
@@ -9,8 +9,6 @@ const propertySchema = new mongoose.Schema({
9
9
  type: Boolean,
10
10
  default: true,
11
11
  description: "Flag indicating if the page is valid",
12
- get: (value) => value ? 'Yes' : 'No',
13
- set: (value) => value.toLowerCase() === 'yes',
14
12
  },
15
13
  propertyId: {
16
14
  type: String,
@@ -121,10 +119,11 @@ propertySchema.virtual('country').get(function () {
121
119
  return this.countryLid instanceof mongoose.Types.ObjectId ? null : this.countryLid?.name || null;
122
120
  });
123
121
  propertySchema.virtual('stressedRCR').get(function () {
124
- const monthlyRentValue = parseFloat((this.monthlyRent?.toString()).replace('£', '').replace(',', ''));
125
- const monthlyRepaymentValue = parseFloat((this.monthlyRepayment?.toString()).replace('£', '').replace(',', ''));
122
+ const monthlyRentValue = this.monthlyRent ? parseFloat(this.monthlyRent.toString()) : 0.00;
123
+ const monthlyRepaymentValue = this.monthlyRepayment ? parseFloat(this.monthlyRepayment.toString()) : 0.00;
124
+ // Avoid division by zero
126
125
  if (monthlyRepaymentValue === 0) {
127
- return 0; // Avoid division by zero
126
+ return '0.00'; // Return 0.00 if monthlyRepayment is zero
128
127
  }
129
128
  const stressedRCR = (monthlyRentValue / monthlyRepaymentValue) * 100;
130
129
  return stressedRCR.toFixed(2);
@@ -21,6 +21,6 @@ class Pound extends mongoose.SchemaType {
21
21
  return val.toFixed(2);
22
22
  }
23
23
  }
24
- // Register the custom type globally with Mongoose
24
+ // Register custom type
25
25
  mongoose.Schema.Types.Pound = Pound;
26
26
  export { Pound };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.2.50",
3
+ "version": "1.2.52",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",