@dhyasama/totem-models 10.22.0 → 10.22.1

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/lib/CapTable.js CHANGED
@@ -433,13 +433,9 @@ module.exports = function(mongoose, config) {
433
433
  compound: {
434
434
  should: [
435
435
  {
436
- text: {
436
+ autocomplete: {
437
437
  query: value,
438
- path: path,
439
- fuzzy: {
440
- maxEdits: options.maxEdits,
441
- maxExpansions: options.maxExpansions
442
- }
438
+ path: path
443
439
  }
444
440
  }
445
441
  ],
@@ -452,6 +448,9 @@ module.exports = function(mongoose, config) {
452
448
  }
453
449
  ],
454
450
  minimumShouldMatch: 1
451
+ },
452
+ highlight: {
453
+ path: path
455
454
  }
456
455
  }
457
456
  },
@@ -482,7 +481,8 @@ module.exports = function(mongoose, config) {
482
481
  name: 1,
483
482
  logoUrl: 1,
484
483
  orgId: 1,
485
- score: { $meta: "searchScore" }
484
+ score: { $meta: "searchScore" },
485
+ highlights: { $meta: "searchHighlights" }
486
486
  }
487
487
  }
488
488
  ]).exec(cb);
package/lib/Deal.js CHANGED
@@ -54,6 +54,8 @@ module.exports = function(mongoose, config) {
54
54
  description: { type: String, trim: true, required: true }
55
55
  }],
56
56
 
57
+ lastUpdated: { type: Date, default: Date.now },
58
+
57
59
  customFields: { type: Schema.Types.Mixed },
58
60
 
59
61
  latestInteraction: { type: Schema.ObjectId, ref: 'Interaction', required: false },
@@ -369,8 +371,12 @@ module.exports = function(mongoose, config) {
369
371
 
370
372
  deal.history = deal.history || [];
371
373
 
374
+ const timestamp = new Date();
375
+
376
+ deal.lastUpdated = timestamp;
377
+
372
378
  deal.history.push({
373
- timestamp: new Date(),
379
+ timestamp: timestamp,
374
380
  account: options.account || null,
375
381
  stage: deal.stage,
376
382
  description: description
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "10.22.0",
3
+ "version": "10.22.1",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",