@dhyasama/totem-models 5.6.0 → 5.6.2

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/Deal.js CHANGED
@@ -60,7 +60,23 @@ module.exports = function(mongoose, config) {
60
60
  // Properties that are not persisted to the database
61
61
  ///////////////////////////////////////////////////////////////////////////////////////
62
62
 
63
+ Deal.virtual('added').get(function () {
63
64
 
65
+ var self = this;
66
+
67
+ if(self.history && self.history.length > 0) return self.history[0].timestamp;
68
+ else return null;
69
+
70
+ });
71
+
72
+ Deal.virtual('updated').get(function () {
73
+
74
+ var self = this;
75
+
76
+ if(self.history && self.history.length > 0) return self.history[self.history.length - 1].timestamp;
77
+ else return null;
78
+
79
+ });
64
80
 
65
81
  ///////////////////////////////////////////////////////////////////////////////////////
66
82
  // METHODS
package/lib/Message.js CHANGED
@@ -270,6 +270,10 @@ module.exports = function(mongoose, config) {
270
270
  subtype: 'deals',
271
271
  organization: { $exists: false }
272
272
  });
273
+ query.populate({
274
+ path: 'documents',
275
+ match: { customer: customerId }
276
+ });
273
277
  query.exec(cb);
274
278
 
275
279
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "5.6.0",
3
+ "version": "5.6.2",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",
package/.npmignore DELETED
@@ -1,14 +0,0 @@
1
- lib-cov
2
- *.seed
3
- *.log
4
- *.csv
5
- *.dat
6
- *.out
7
- *.pid
8
- *.gz
9
-
10
- npm-debug.log
11
- node_modules
12
-
13
- .DS_Store
14
- .idea