@dhyasama/totem-models 9.75.0 → 9.78.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.
@@ -47,8 +47,8 @@ module.exports = function(mongoose, config) {
47
47
 
48
48
  };
49
49
 
50
- // Scheduled but not sent and now isn't the time
51
- LimitedPartnerCampaign.statics.getFuture = function getFuture(customerId, options, cb) {
50
+ // Scheduled but not sent
51
+ LimitedPartnerCampaign.statics.getUpcoming = function getUpcoming(customerId, options, cb) {
52
52
 
53
53
  const self = this;
54
54
  const now = new Date();
@@ -57,17 +57,18 @@ module.exports = function(mongoose, config) {
57
57
  if (!customerId) { return cb(new Error('customerId is required'), null); }
58
58
  if (!mongoose.Types.ObjectId.isValid(customerId)) { return cb(new Error('customerId is not a valid ObjectId'), null); }
59
59
 
60
+ // No need to check send on. If no sentEmailsToQueue then safe to assume sendOn is in the future.
61
+
60
62
  const query = self.find({
61
63
  customer: customerId,
62
- sentEmailsToQueue: false,
63
- sendOn: { $gte: now }
64
+ sentEmailsToQueue: false
64
65
  });
65
66
 
66
67
  query.exec(cb);
67
68
 
68
69
  };
69
70
 
70
- // Scheduled and not yet sent but now is the time
71
+ // Scheduled and ready to be sent
71
72
  // Note this doesn't use customer id because it's for the worker and we want all customers.
72
73
  LimitedPartnerCampaign.statics.getOutbound = function getOutbound(options, cb) {
73
74
 
@@ -90,8 +91,8 @@ module.exports = function(mongoose, config) {
90
91
 
91
92
  };
92
93
 
93
- // Already sent
94
- LimitedPartnerCampaign.statics.getPrevious = function getPrevious(customerId, options, cb) {
94
+ // Scheduled and sent
95
+ LimitedPartnerCampaign.statics.getHistorical = function getHistorical(customerId, options, cb) {
95
96
 
96
97
  const self = this;
97
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "9.75.0",
3
+ "version": "9.78.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",