@dhyasama/totem-models 5.5.1 → 5.6.0
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/Interaction.js +11 -0
- package/package.json +1 -1
package/lib/Interaction.js
CHANGED
|
@@ -83,6 +83,17 @@ module.exports = function(mongoose, config) {
|
|
|
83
83
|
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
+
Interaction.statics.getForCustomerSkinny = function getForCustomer(customerId, since, cb) {
|
|
87
|
+
|
|
88
|
+
since = since || moment().subtract(20, 'years').startOf('day').toString()
|
|
89
|
+
var sinceObjectId = utilities.convertTimestampToObjectId(since);
|
|
90
|
+
|
|
91
|
+
var self = this;
|
|
92
|
+
var query = self.find({ totemCustomerId: customerId, _id: { $gt: sinceObjectId } });
|
|
93
|
+
query.exec(cb);
|
|
94
|
+
|
|
95
|
+
};
|
|
96
|
+
|
|
86
97
|
Interaction.statics.getForPeople = function getForPeople(personIds, options, cb) {
|
|
87
98
|
|
|
88
99
|
// This filters by customer so is NOT usable by admin tools
|