@dynamatix/gb-schemas 2.3.293 → 2.3.294
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-welcome-call.model.d.ts.map +1 -1
- package/dist/applicants/applicant-welcome-call.model.js +19 -19
- package/dist/applications/application-rationale.model.d.ts +21 -1
- package/dist/applications/application-rationale.model.d.ts.map +1 -1
- package/dist/applications/application-rationale.model.js +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-welcome-call.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-welcome-call.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-welcome-call.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-welcome-call.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAwtBhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
|
|
@@ -611,25 +611,6 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(async function () {
|
|
|
611
611
|
else {
|
|
612
612
|
financeTerm = '-';
|
|
613
613
|
}
|
|
614
|
-
// Get monthly repayment amount from productFeatures collection
|
|
615
|
-
try {
|
|
616
|
-
const ApplicationProductFeatures = mongoose.model('ApplicationProductFeatures');
|
|
617
|
-
const productFeatures = await ApplicationProductFeatures.findOne({
|
|
618
|
-
applicationId: application
|
|
619
|
-
});
|
|
620
|
-
if (productFeatures && productFeatures.repayment !== undefined && productFeatures.repayment !== null) {
|
|
621
|
-
const numericValue = Number(productFeatures.repayment);
|
|
622
|
-
const repaymentValue = isNaN(numericValue) ? '0.00' : numericValue.toFixed(2);
|
|
623
|
-
monthlyRepayment = `£${repaymentValue}`;
|
|
624
|
-
}
|
|
625
|
-
else {
|
|
626
|
-
monthlyRepayment = '-';
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
catch (error) {
|
|
630
|
-
console.log('Error fetching product features:', error);
|
|
631
|
-
monthlyRepayment = '-';
|
|
632
|
-
}
|
|
633
614
|
// Get rental income from mortgage - mortgageId is at application level
|
|
634
615
|
let mortgage = null;
|
|
635
616
|
if (application.mortgageId && typeof application.mortgageId === 'object') {
|
|
@@ -643,6 +624,25 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(async function () {
|
|
|
643
624
|
const rentalValue = isNaN(numericValue) ? '0.00' : numericValue.toFixed(2);
|
|
644
625
|
rentalIncome = `£${rentalValue}`;
|
|
645
626
|
}
|
|
627
|
+
// Get monthly repayment amount from productFeatures collection
|
|
628
|
+
try {
|
|
629
|
+
const ApplicationProductFeatures = mongoose.model('ApplicationProductFeatures');
|
|
630
|
+
const productFeatures = await ApplicationProductFeatures.findOne({
|
|
631
|
+
applicationId: application
|
|
632
|
+
});
|
|
633
|
+
if (productFeatures && productFeatures.repayment !== undefined && productFeatures.repayment !== null) {
|
|
634
|
+
const numericValue = Number(productFeatures.repayment);
|
|
635
|
+
const repaymentValue = isNaN(numericValue) ? '0.00' : numericValue.toFixed(2);
|
|
636
|
+
monthlyRepayment = `£${repaymentValue}`;
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
monthlyRepayment = '-';
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
catch (error) {
|
|
643
|
+
console.log('Error fetching product features:', error);
|
|
644
|
+
monthlyRepayment = '-';
|
|
645
|
+
}
|
|
646
646
|
// Get occupancy information from mortgage
|
|
647
647
|
if (mortgage.proposedTenantsLids && Array.isArray(mortgage.proposedTenantsLids) && mortgage.proposedTenantsLids.length > 0) {
|
|
648
648
|
// Get the first proposed tenant type
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
29
29
|
import mongoose from "mongoose";
|
|
30
30
|
declare const ApplicationRationaleModel: mongoose.Model<{
|
|
31
|
+
createdAt: NativeDate;
|
|
32
|
+
updatedAt: NativeDate;
|
|
33
|
+
} & {
|
|
31
34
|
applicationId: mongoose.Types.ObjectId;
|
|
32
35
|
rationaleTypeLid: mongoose.Types.ObjectId;
|
|
33
36
|
generatedText: string;
|
|
@@ -39,6 +42,9 @@ declare const ApplicationRationaleModel: mongoose.Model<{
|
|
|
39
42
|
updatedBy: string;
|
|
40
43
|
} | null | undefined;
|
|
41
44
|
}, {}, {}, {}, mongoose.Document<unknown, {}, {
|
|
45
|
+
createdAt: NativeDate;
|
|
46
|
+
updatedAt: NativeDate;
|
|
47
|
+
} & {
|
|
42
48
|
applicationId: mongoose.Types.ObjectId;
|
|
43
49
|
rationaleTypeLid: mongoose.Types.ObjectId;
|
|
44
50
|
generatedText: string;
|
|
@@ -50,6 +56,9 @@ declare const ApplicationRationaleModel: mongoose.Model<{
|
|
|
50
56
|
updatedBy: string;
|
|
51
57
|
} | null | undefined;
|
|
52
58
|
}, {}> & {
|
|
59
|
+
createdAt: NativeDate;
|
|
60
|
+
updatedAt: NativeDate;
|
|
61
|
+
} & {
|
|
53
62
|
applicationId: mongoose.Types.ObjectId;
|
|
54
63
|
rationaleTypeLid: mongoose.Types.ObjectId;
|
|
55
64
|
generatedText: string;
|
|
@@ -64,7 +73,12 @@ declare const ApplicationRationaleModel: mongoose.Model<{
|
|
|
64
73
|
_id: mongoose.Types.ObjectId;
|
|
65
74
|
} & {
|
|
66
75
|
__v: number;
|
|
67
|
-
}, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {},
|
|
76
|
+
}, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
77
|
+
timestamps: true;
|
|
78
|
+
}, {
|
|
79
|
+
createdAt: NativeDate;
|
|
80
|
+
updatedAt: NativeDate;
|
|
81
|
+
} & {
|
|
68
82
|
applicationId: mongoose.Types.ObjectId;
|
|
69
83
|
rationaleTypeLid: mongoose.Types.ObjectId;
|
|
70
84
|
generatedText: string;
|
|
@@ -76,6 +90,9 @@ declare const ApplicationRationaleModel: mongoose.Model<{
|
|
|
76
90
|
updatedBy: string;
|
|
77
91
|
} | null | undefined;
|
|
78
92
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
93
|
+
createdAt: NativeDate;
|
|
94
|
+
updatedAt: NativeDate;
|
|
95
|
+
} & {
|
|
79
96
|
applicationId: mongoose.Types.ObjectId;
|
|
80
97
|
rationaleTypeLid: mongoose.Types.ObjectId;
|
|
81
98
|
generatedText: string;
|
|
@@ -87,6 +104,9 @@ declare const ApplicationRationaleModel: mongoose.Model<{
|
|
|
87
104
|
updatedBy: string;
|
|
88
105
|
} | null | undefined;
|
|
89
106
|
}>, {}> & mongoose.FlatRecord<{
|
|
107
|
+
createdAt: NativeDate;
|
|
108
|
+
updatedAt: NativeDate;
|
|
109
|
+
} & {
|
|
90
110
|
applicationId: mongoose.Types.ObjectId;
|
|
91
111
|
rationaleTypeLid: mongoose.Types.ObjectId;
|
|
92
112
|
generatedText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-rationale.model.d.ts","sourceRoot":"","sources":["../../applications/application-rationale.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"application-rationale.model.d.ts","sourceRoot":"","sources":["../../applications/application-rationale.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA4BhC,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0D,CAAC;AAC1F,eAAe,yBAAyB,CAAC"}
|
|
@@ -13,6 +13,8 @@ const rationaleSchema = new mongoose.Schema({
|
|
|
13
13
|
generatedText: { type: String, default: null },
|
|
14
14
|
comment: commentSchema,
|
|
15
15
|
isConfirmed: { type: Boolean, default: null }
|
|
16
|
+
}, {
|
|
17
|
+
timestamps: true
|
|
16
18
|
});
|
|
17
19
|
applyAuditMiddleware(rationaleSchema, "ApplicationRationale");
|
|
18
20
|
// Apply workflow plugin to the schema
|