@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 +16 -0
- package/lib/Message.js +4 -0
- package/package.json +1 -1
- package/.npmignore +0 -14
- package/package-lock.json +0 -1854
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
package/package.json
CHANGED