@dhyasama/totem-models 11.89.0 → 11.90.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.
Files changed (2) hide show
  1. package/lib/Financials.js +10 -25
  2. package/package.json +1 -1
package/lib/Financials.js CHANGED
@@ -138,7 +138,6 @@ module.exports = function(mongoose, config) {
138
138
  initial: {
139
139
  sendOn: { type: Date, required: false },
140
140
  sentOn: { type: Date, required: false },
141
- sentToQueue: { type: Boolean, default: false },
142
141
  postmarkMessageId: { type: String, trim: true },
143
142
  status: { type: String, enum: [null, 'Sent', 'Bounced', 'Delivered', 'Opened', 'Clicked']},
144
143
  email: {
@@ -154,7 +153,6 @@ module.exports = function(mongoose, config) {
154
153
  reminders: [{
155
154
  sendOn: { type: Date, required: false },
156
155
  sentOn: { type: Date, required: false },
157
- sentToQueue: { type: Boolean, default: false },
158
156
  postmarkMessageId: { type: String, trim: true },
159
157
  status: { type: String, enum: [null, 'Sent', 'Bounced', 'Delivered', 'Opened', 'Clicked']},
160
158
  email: {
@@ -170,7 +168,6 @@ module.exports = function(mongoose, config) {
170
168
  rejections: [{
171
169
  sendOn: { type: Date, required: false },
172
170
  sentOn: { type: Date, required: false },
173
- sentToQueue: { type: Boolean, default: false },
174
171
  postmarkMessageId: { type: String, trim: true },
175
172
  status: { type: String, enum: [null, 'Sent', 'Bounced', 'Delivered', 'Opened', 'Clicked']},
176
173
  email: {
@@ -196,7 +193,6 @@ module.exports = function(mongoose, config) {
196
193
  initial: {
197
194
  sendOn: { type: Date, required: false },
198
195
  sentOn: { type: Date, required: false },
199
- sentToQueue: { type: Boolean, default: false },
200
196
  postmarkMessageId: { type: String, trim: true },
201
197
  status: { type: String, enum: [null, 'Sent', 'Bounced', 'Delivered', 'Opened', 'Clicked']}
202
198
  },
@@ -204,7 +200,6 @@ module.exports = function(mongoose, config) {
204
200
  reminders: [{
205
201
  sendOn: { type: Date, required: false },
206
202
  sentOn: { type: Date, required: false },
207
- sentToQueue: { type: Boolean, default: false },
208
203
  postmarkMessageId: { type: String, trim: true },
209
204
  status: { type: String, enum: [null, 'Sent', 'Bounced', 'Delivered', 'Opened', 'Clicked']}
210
205
  }]
@@ -617,8 +612,7 @@ module.exports = function(mongoose, config) {
617
612
  $elemMatch: {
618
613
  'notifications.company.initial.sendTo': { $gt: [] },
619
614
  'notifications.company.initial.sendOn': { $lte: now },
620
- 'notifications.company.initial.sentOn': null,
621
- 'notifications.company.initial.sentToQueue': false
615
+ 'notifications.company.initial.sentOn': null
622
616
  }
623
617
  }
624
618
  });
@@ -636,9 +630,8 @@ module.exports = function(mongoose, config) {
636
630
  var hasSendTo = snapshot.notifications.company.initial.sendTo && snapshot.notifications.company.initial.sendTo.length > 0;
637
631
  var hasSendOnLessThanNow = snapshot.notifications.company.initial.sendOn && snapshot.notifications.company.initial.sendOn < now;
638
632
  var hasSentOn = snapshot.notifications.company.initial.sentOn;
639
- var hasSentToQueue = snapshot.notifications.company.initial.sentToQueue;
640
633
 
641
- var conditions = hasSendTo && hasSendOnLessThanNow && !hasSentOn && !hasSentToQueue;
634
+ var conditions = hasSendTo && hasSendOnLessThanNow && !hasSentOn;
642
635
 
643
636
  if(conditions) {
644
637
 
@@ -674,8 +667,7 @@ module.exports = function(mongoose, config) {
674
667
  $elemMatch: {
675
668
  'notifications.company.reminders.sendTo': { $gt: [] },
676
669
  'notifications.company.reminders.sendOn': { $lte: now },
677
- 'notifications.company.reminders.sentOn': null,
678
- 'notifications.company.reminders.sentToQueue': false
670
+ 'notifications.company.reminders.sentOn': null
679
671
  }
680
672
  }
681
673
  });
@@ -695,9 +687,8 @@ module.exports = function(mongoose, config) {
695
687
  var hasSendTo = reminder.sendTo && reminder.sendTo.length > 0;
696
688
  var hasSendOnLessThanNow = reminder.sendOn && reminder.sendOn < now;
697
689
  var hasSentOn = reminder.sentOn;
698
- var hasSentToQueue = reminder.sentToQueue;
699
690
 
700
- var conditions = hasSendTo && hasSendOnLessThanNow && !hasSentOn && !hasSentToQueue;
691
+ var conditions = hasSendTo && hasSendOnLessThanNow && !hasSentOn;
701
692
 
702
693
  if(conditions) {
703
694
 
@@ -735,8 +726,7 @@ module.exports = function(mongoose, config) {
735
726
  $elemMatch: {
736
727
  'notifications.company.rejections.sendTo': { $gt: [] },
737
728
  'notifications.company.rejections.sendOn': { $lte: now },
738
- 'notifications.company.rejections.sentOn': null,
739
- 'notifications.company.rejections.sentToQueue': false
729
+ 'notifications.company.rejections.sentOn': null
740
730
  }
741
731
  }
742
732
  });
@@ -756,9 +746,8 @@ module.exports = function(mongoose, config) {
756
746
  var hasSendTo = rejection.sendTo && rejection.sendTo.length > 0;
757
747
  var hasSendOnLessThanNow = rejection.sendOn && rejection.sendOn < now;
758
748
  var hasSentOn = rejection.sentOn;
759
- var hasSentToQueue = rejection.sentToQueue;
760
749
 
761
- var conditions = hasSendTo && hasSendOnLessThanNow && !hasSentOn && !hasSentToQueue;
750
+ var conditions = hasSendTo && hasSendOnLessThanNow && !hasSentOn;
762
751
 
763
752
  if(conditions) {
764
753
 
@@ -798,8 +787,7 @@ module.exports = function(mongoose, config) {
798
787
  $elemMatch: {
799
788
  'notifications.stakeholders.sendTo.email': { $ne: null },
800
789
  'notifications.stakeholders.initial.sendOn': { $lte: now },
801
- 'notifications.stakeholders.initial.sentOn': null,
802
- 'notifications.stakeholders.initial.sentToQueue': false
790
+ 'notifications.stakeholders.initial.sentOn': null
803
791
  }
804
792
  }
805
793
  });
@@ -827,8 +815,7 @@ module.exports = function(mongoose, config) {
827
815
  const sendToEmail = stakeholder.sendTo.email;
828
816
  const sendOnLessThanNow = stakeholder.initial.sendOn < now;
829
817
  const sentOn = stakeholder.initial.sentOn;
830
- const sentToQueue = stakeholder.initial.sentToQueue;
831
- const conditionsMet = sendToEmail && sendOnLessThanNow && !sentOn && !sentToQueue;
818
+ const conditionsMet = sendToEmail && sendOnLessThanNow && !sentOn;
832
819
 
833
820
  if (conditionsMet) {
834
821
 
@@ -865,8 +852,7 @@ module.exports = function(mongoose, config) {
865
852
  'notifications.stakeholders.sendTo.email': { $ne: null },
866
853
  'notifications.stakeholders.sendTo.organization': { $ne: null },
867
854
  'notifications.stakeholders.reminders.sendOn': { $lte: now },
868
- 'notifications.stakeholders.reminders.sentOn': null,
869
- 'notifications.stakeholders.reminders.sentToQueue': false
855
+ 'notifications.stakeholders.reminders.sentOn': null
870
856
  }
871
857
  }
872
858
  });
@@ -888,8 +874,7 @@ module.exports = function(mongoose, config) {
888
874
  var hasOrganization = stakeholder.sendTo && stakeholder.sendTo.organization;
889
875
  var hasSendOnLessThanNow = reminder.sendOn < now;
890
876
  var hasSentOn = reminder.sentOn;
891
- var hasSentToQueue = reminder.sentToQueue;
892
- return hasSendTo && hasOrganization && hasSendOnLessThanNow && !hasSentOn && !hasSentToQueue;
877
+ return hasSendTo && hasOrganization && hasSendOnLessThanNow && !hasSentOn;
893
878
  });
894
879
 
895
880
  if(conditions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "11.89.0",
3
+ "version": "11.90.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",