@dynamatix/gb-schemas 2.3.332 → 2.3.335

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.
@@ -38,6 +38,7 @@ declare const WelcomeCallModel: mongoose.Model<{
38
38
  firstCallAttemptDate: string;
39
39
  callCompletedDate: string;
40
40
  failedCallReason: string;
41
+ idvStatus: string;
41
42
  customerDOBStatusLid: mongoose.Types.ObjectId;
42
43
  residentialAddressStatusLid: mongoose.Types.ObjectId;
43
44
  contactNumberStatusLid: mongoose.Types.ObjectId;
@@ -91,6 +92,7 @@ declare const WelcomeCallModel: mongoose.Model<{
91
92
  firstCallAttemptDate: string;
92
93
  callCompletedDate: string;
93
94
  failedCallReason: string;
95
+ idvStatus: string;
94
96
  customerDOBStatusLid: mongoose.Types.ObjectId;
95
97
  residentialAddressStatusLid: mongoose.Types.ObjectId;
96
98
  contactNumberStatusLid: mongoose.Types.ObjectId;
@@ -144,6 +146,7 @@ declare const WelcomeCallModel: mongoose.Model<{
144
146
  firstCallAttemptDate: string;
145
147
  callCompletedDate: string;
146
148
  failedCallReason: string;
149
+ idvStatus: string;
147
150
  customerDOBStatusLid: mongoose.Types.ObjectId;
148
151
  residentialAddressStatusLid: mongoose.Types.ObjectId;
149
152
  contactNumberStatusLid: mongoose.Types.ObjectId;
@@ -209,6 +212,7 @@ declare const WelcomeCallModel: mongoose.Model<{
209
212
  firstCallAttemptDate: string;
210
213
  callCompletedDate: string;
211
214
  failedCallReason: string;
215
+ idvStatus: string;
212
216
  customerDOBStatusLid: mongoose.Types.ObjectId;
213
217
  residentialAddressStatusLid: mongoose.Types.ObjectId;
214
218
  contactNumberStatusLid: mongoose.Types.ObjectId;
@@ -262,6 +266,7 @@ declare const WelcomeCallModel: mongoose.Model<{
262
266
  firstCallAttemptDate: string;
263
267
  callCompletedDate: string;
264
268
  failedCallReason: string;
269
+ idvStatus: string;
265
270
  customerDOBStatusLid: mongoose.Types.ObjectId;
266
271
  residentialAddressStatusLid: mongoose.Types.ObjectId;
267
272
  contactNumberStatusLid: mongoose.Types.ObjectId;
@@ -315,6 +320,7 @@ declare const WelcomeCallModel: mongoose.Model<{
315
320
  firstCallAttemptDate: string;
316
321
  callCompletedDate: string;
317
322
  failedCallReason: string;
323
+ idvStatus: string;
318
324
  customerDOBStatusLid: mongoose.Types.ObjectId;
319
325
  residentialAddressStatusLid: mongoose.Types.ObjectId;
320
326
  contactNumberStatusLid: mongoose.Types.ObjectId;
@@ -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;AAmuBhC,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;AAwuBhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
@@ -30,6 +30,11 @@ const welcomeCallSchema = new mongoose.Schema({
30
30
  description: "Failed Call Reason",
31
31
  default: null,
32
32
  },
33
+ idvStatus: {
34
+ type: String,
35
+ description: "IDV Status",
36
+ default: null
37
+ },
33
38
  customerFullNameStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
34
39
  customerDOBStatusLid: {
35
40
  type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.plugin.d.ts","sourceRoot":"","sources":["../../shared/workflow.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,QAqFnE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,SAGrC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,QAE9E"}
1
+ {"version":3,"file":"workflow.plugin.d.ts","sourceRoot":"","sources":["../../shared/workflow.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,QAyGnE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,SAGrC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,QAE9E"}
@@ -51,15 +51,34 @@ export function workflowPlugin(schema, options) {
51
51
  next();
52
52
  });
53
53
  // Apply post-remove middleware
54
- schema.post(/^delete/, async function (doc, next) {
55
- const recordType = doc.constructor.modelName?.toLowerCase() || 'unknown';
54
+ schema.post(/^delete/, async function (result, next) {
55
+ // Try multiple methods to get model name since context differs in delete hooks
56
+ // For query hooks (model.deleteOne or doc.deleteOne), 'this' is the query
57
+ let recordType = 'unknown';
58
+ // Try from query context first (most reliable for deleteOne hooks)
59
+ // When doc.deleteOne() is called, 'this' refers to the query object
60
+ if (this?.model?.modelName) {
61
+ recordType = this.model.modelName.toLowerCase();
62
+ }
63
+ // Try from schema modelName
64
+ else if (schema?.modelName) {
65
+ recordType = schema.modelName.toLowerCase();
66
+ }
67
+ // Try from collection name as fallback
68
+ else if (this?.model?.collection?.name) {
69
+ recordType = this.model.collection.name.toLowerCase();
70
+ }
71
+ // Try from result if it's a document
72
+ else if (result?.constructor?.modelName) {
73
+ recordType = result.constructor.modelName.toLowerCase();
74
+ }
56
75
  console.log(`🗑️ Post-delete middleware triggered for ${recordType}`);
57
76
  try {
58
77
  await middleware.handleEvent({
59
78
  recordType,
60
79
  action: 'deleted',
61
80
  triggerKey: `${recordType}.deleted`
62
- }, doc);
81
+ }, result);
63
82
  }
64
83
  catch (error) {
65
84
  console.error('Workflow middleware error:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "2.3.332",
3
+ "version": "2.3.335",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "homepage": "https://github.com/DynamatixAnalyticsPvtLtd/gb-schemas#readme",
38
38
  "dependencies": {
39
- "@dynamatix/cat-shared": "^0.0.136",
39
+ "@dynamatix/cat-shared": "^0.0.137",
40
40
  "dotenv": "^16.4.5",
41
41
  "mongodb": "^6.14.2",
42
42
  "mongoose": "^8.9.5"