@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.
- package/dist/applicants/applicant-expenditure.model.d.ts +3 -3
- package/dist/applicants/applicant-expenditure.model.js +1 -1
- package/dist/applications/solicitor.model.d.ts.map +1 -1
- package/dist/applications/solicitor.model.js +0 -1
- package/dist/properties/property.model.d.ts.map +1 -1
- package/dist/properties/property.model.js +4 -5
- package/dist/value-objects/pound.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
|
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,
|
|
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;
|
|
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"}
|
|
@@ -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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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(
|
|
125
|
-
const monthlyRepaymentValue = parseFloat(
|
|
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; //
|
|
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);
|