@dynamatix/gb-schemas 1.3.370 → 1.3.371

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.
@@ -31,8 +31,12 @@ declare const WelcomeCallModel: mongoose.Model<{
31
31
  createdAt: NativeDate;
32
32
  updatedAt: NativeDate;
33
33
  } & {
34
+ applicationId: mongoose.Types.ObjectId;
34
35
  applicantId: mongoose.Types.ObjectId;
35
36
  applicantName: string;
37
+ repaymentTypeLid: mongoose.Types.ObjectId;
38
+ lendingTypeLid: mongoose.Types.ObjectId;
39
+ purchaseTypeLid: mongoose.Types.ObjectId;
36
40
  bepReference: string;
37
41
  firstCallAttemptDate: string;
38
42
  callCompletedDate: string;
@@ -68,8 +72,12 @@ declare const WelcomeCallModel: mongoose.Model<{
68
72
  createdAt: NativeDate;
69
73
  updatedAt: NativeDate;
70
74
  } & {
75
+ applicationId: mongoose.Types.ObjectId;
71
76
  applicantId: mongoose.Types.ObjectId;
72
77
  applicantName: string;
78
+ repaymentTypeLid: mongoose.Types.ObjectId;
79
+ lendingTypeLid: mongoose.Types.ObjectId;
80
+ purchaseTypeLid: mongoose.Types.ObjectId;
73
81
  bepReference: string;
74
82
  firstCallAttemptDate: string;
75
83
  callCompletedDate: string;
@@ -105,8 +113,12 @@ declare const WelcomeCallModel: mongoose.Model<{
105
113
  createdAt: NativeDate;
106
114
  updatedAt: NativeDate;
107
115
  } & {
116
+ applicationId: mongoose.Types.ObjectId;
108
117
  applicantId: mongoose.Types.ObjectId;
109
118
  applicantName: string;
119
+ repaymentTypeLid: mongoose.Types.ObjectId;
120
+ lendingTypeLid: mongoose.Types.ObjectId;
121
+ purchaseTypeLid: mongoose.Types.ObjectId;
110
122
  bepReference: string;
111
123
  firstCallAttemptDate: string;
112
124
  callCompletedDate: string;
@@ -154,8 +166,12 @@ declare const WelcomeCallModel: mongoose.Model<{
154
166
  createdAt: NativeDate;
155
167
  updatedAt: NativeDate;
156
168
  } & {
169
+ applicationId: mongoose.Types.ObjectId;
157
170
  applicantId: mongoose.Types.ObjectId;
158
171
  applicantName: string;
172
+ repaymentTypeLid: mongoose.Types.ObjectId;
173
+ lendingTypeLid: mongoose.Types.ObjectId;
174
+ purchaseTypeLid: mongoose.Types.ObjectId;
159
175
  bepReference: string;
160
176
  firstCallAttemptDate: string;
161
177
  callCompletedDate: string;
@@ -191,8 +207,12 @@ declare const WelcomeCallModel: mongoose.Model<{
191
207
  createdAt: NativeDate;
192
208
  updatedAt: NativeDate;
193
209
  } & {
210
+ applicationId: mongoose.Types.ObjectId;
194
211
  applicantId: mongoose.Types.ObjectId;
195
212
  applicantName: string;
213
+ repaymentTypeLid: mongoose.Types.ObjectId;
214
+ lendingTypeLid: mongoose.Types.ObjectId;
215
+ purchaseTypeLid: mongoose.Types.ObjectId;
196
216
  bepReference: string;
197
217
  firstCallAttemptDate: string;
198
218
  callCompletedDate: string;
@@ -228,8 +248,12 @@ declare const WelcomeCallModel: mongoose.Model<{
228
248
  createdAt: NativeDate;
229
249
  updatedAt: NativeDate;
230
250
  } & {
251
+ applicationId: mongoose.Types.ObjectId;
231
252
  applicantId: mongoose.Types.ObjectId;
232
253
  applicantName: string;
254
+ repaymentTypeLid: mongoose.Types.ObjectId;
255
+ lendingTypeLid: mongoose.Types.ObjectId;
256
+ purchaseTypeLid: mongoose.Types.ObjectId;
233
257
  bepReference: string;
234
258
  firstCallAttemptDate: string;
235
259
  callCompletedDate: string;
@@ -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;AA+NhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,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;AAqRhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
@@ -3,6 +3,7 @@ import { applyWorkflowPlugin } from "../shared/workflow.plugin";
3
3
  // Welcome Call Schema
4
4
  const welcomeCallSchema = new mongoose.Schema({
5
5
  applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
6
+ applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true },
6
7
  bepReference: {
7
8
  type: String,
8
9
  description: "BEP reference",
@@ -15,7 +16,7 @@ const welcomeCallSchema = new mongoose.Schema({
15
16
  },
16
17
  firstCallAttemptDate: {
17
18
  type: String,
18
- description: "Call Starte Date ",
19
+ description: "Call Started Date",
19
20
  default: null
20
21
  },
21
22
  callCompletedDate: {
@@ -104,6 +105,22 @@ const welcomeCallSchema = new mongoose.Schema({
104
105
  nextStepsStatusLid: {
105
106
  type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
106
107
  },
108
+ repaymentTypeLid: {
109
+ type: mongoose.Schema.Types.ObjectId,
110
+ ref: "Lookup",
111
+ default: null,
112
+ description: "Lookup ID representing the type of repayment (e.g., interest-only, repayment)",
113
+ },
114
+ purchaseTypeLid: {
115
+ type: mongoose.Schema.Types.ObjectId,
116
+ ref: "Lookup",
117
+ required: true
118
+ },
119
+ lendingTypeLid: {
120
+ type: mongoose.Schema.Types.ObjectId,
121
+ ref: "Lookup",
122
+ required: true
123
+ },
107
124
  customerQuestions: {
108
125
  type: String,
109
126
  description: "Ask the customer if they have any questions",
@@ -124,13 +141,6 @@ const welcomeCallSchema = new mongoose.Schema({
124
141
  toJSON: { virtuals: true },
125
142
  toObject: { virtuals: true }
126
143
  });
127
- // Virtual property for Full Name
128
- welcomeCallSchema.virtual('fullName').get(function () {
129
- if (this.applicantId && typeof this.applicantId === 'object' && this.applicantId.firstName && this.applicantId.lastName) {
130
- return this.applicantId.firstName + " " + this.applicantId.lastName;
131
- }
132
- return null;
133
- });
134
144
  // Virtual property for current address
135
145
  welcomeCallSchema.virtual('customerCurrentResidentialAddress').get(function () {
136
146
  if (this.applicantId && typeof this.applicantId === 'object') {
@@ -149,20 +159,6 @@ welcomeCallSchema.virtual('customerCurrentResidentialAddress').get(function () {
149
159
  }
150
160
  return null;
151
161
  });
152
- // Virtual property for email address
153
- welcomeCallSchema.virtual('customerEmailAddress').get(function () {
154
- if (this.applicantId && typeof this.applicantId === 'object' && this.applicantId.email) {
155
- return this.applicantId.email;
156
- }
157
- return null;
158
- });
159
- // Virtual property for DOB
160
- welcomeCallSchema.virtual('customerDOB').get(function () {
161
- if (this.applicantId && typeof this.applicantId === 'object' && this.applicantId.dateOfBirth) {
162
- return this.applicantId.dateOfBirth;
163
- }
164
- return null;
165
- });
166
162
  // Virtual property for Customer's Contact Numbers (Phone and Mobile)
167
163
  welcomeCallSchema.virtual('customerContactNumbers').get(function () {
168
164
  if (this.applicantId && typeof this.applicantId === 'object') {
@@ -180,14 +176,6 @@ welcomeCallSchema.virtual('customerContactNumbers').get(function () {
180
176
  }
181
177
  return null;
182
178
  });
183
- //
184
- // Virtual property for Finance Amount
185
- welcomeCallSchema.virtual('customerAmountOfFinance').get(function () {
186
- if (this.applicantId && typeof this.applicantId === 'object' && this.applicantId.proposedFinanceAmount) {
187
- return this.applicantId.proposedFinanceAmount;
188
- }
189
- return null;
190
- });
191
179
  // Virtual property for all applicants name/DOB when there are multiple applicants
192
180
  welcomeCallSchema.virtual('allApplicantsNameAndDOB').get(function () {
193
181
  // For single applicant, return the current applicant's name and DOB
@@ -201,6 +189,68 @@ welcomeCallSchema.virtual('allApplicantsNameAndDOB').get(function () {
201
189
  }
202
190
  return null;
203
191
  });
192
+ // Virtual property for broker name and firm
193
+ welcomeCallSchema.virtual('brokerNameAndFirm').get(function () {
194
+ if (this.applicantId && typeof this.applicantId === 'object' && this.applicantId.applicationId) {
195
+ const application = this.applicantId.applicationId;
196
+ let brokerName = '';
197
+ let solicitorFirmName = '';
198
+ // Get broker name
199
+ if (application && application.brokerId && typeof application.brokerId === 'object') {
200
+ const broker = application.brokerId;
201
+ if (broker.firstName && broker.lastName) {
202
+ brokerName = `${broker.firstName} ${broker.lastName}`;
203
+ }
204
+ }
205
+ // Get solicitor firm name
206
+ if (application && application.solicitorId && typeof application.solicitorId === 'object') {
207
+ const solicitor = application.solicitorId;
208
+ if (solicitor.nameOfFirm) {
209
+ solicitorFirmName = solicitor.nameOfFirm;
210
+ }
211
+ }
212
+ // Combine in format "Broker name / nameOfFirm"
213
+ if (brokerName && solicitorFirmName) {
214
+ return `${brokerName} / ${solicitorFirmName}`;
215
+ }
216
+ else if (brokerName) {
217
+ return brokerName;
218
+ }
219
+ else if (solicitorFirmName) {
220
+ return solicitorFirmName;
221
+ }
222
+ }
223
+ return null;
224
+ });
225
+ // Virtual property for account holder and Bank
226
+ welcomeCallSchema.virtual('accountHolderAndBank').get(function () {
227
+ if (this.applicantId && typeof this.applicantId === 'object' && this.applicantId.applicationId) {
228
+ const application = this.applicantId.applicationId;
229
+ let accountHolderName = '';
230
+ let institutionName = '';
231
+ // Get solicitor information
232
+ if (application && application.solicitorId && typeof application.solicitorId === 'object') {
233
+ const solicitor = application.solicitorId;
234
+ if (solicitor.nameOfAccountHolder) {
235
+ accountHolderName = solicitor.nameOfAccountHolder;
236
+ }
237
+ if (solicitor.institution) {
238
+ institutionName = solicitor.institution;
239
+ }
240
+ }
241
+ // Combine in format "account holder / institution"
242
+ if (accountHolderName && institutionName) {
243
+ return `${accountHolderName} / ${institutionName}`;
244
+ }
245
+ else if (accountHolderName) {
246
+ return accountHolderName;
247
+ }
248
+ else if (institutionName) {
249
+ return institutionName;
250
+ }
251
+ }
252
+ return null;
253
+ });
204
254
  // Apply workflow plugin to the schema
205
255
  applyWorkflowPlugin(welcomeCallSchema, 'applicantwelcomecall');
206
256
  const WelcomeCallModel = mongoose.model('ApplicantWelcomeCall', welcomeCallSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.3.370",
3
+ "version": "1.3.371",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",