@dhyasama/totem-models 9.21.0 → 9.22.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 +6 -21
  2. package/package.json +1 -1
package/lib/Financials.js CHANGED
@@ -403,7 +403,7 @@ module.exports = function(mongoose, config) {
403
403
  'notifications.company.sendTo': { $gt: [] },
404
404
  'notifications.company.initial.sendOn': { $lte: now },
405
405
  'notifications.company.initial.sentOn': null,
406
- 'notifications.company.initial.sentToQueue': false,
406
+ 'notifications.company.initial.sentToQueue': false
407
407
  }
408
408
  }
409
409
  });
@@ -460,16 +460,7 @@ module.exports = function(mongoose, config) {
460
460
  'notifications.company.sendTo': { $gt: [] },
461
461
  'notifications.company.reminders.sendOn': { $lte: now },
462
462
  'notifications.company.reminders.sentOn': null,
463
- 'notifications.company.reminders.sentToQueue': false,
464
- '$or': [
465
- {
466
- 'submittedOn': null,
467
- },
468
- {
469
- 'submittedOn': { $ne: null },
470
- 'rejection': { $ne: null }
471
- }
472
- ]
463
+ 'notifications.company.reminders.sentToQueue': false
473
464
  }
474
465
  }
475
466
  });
@@ -489,9 +480,7 @@ module.exports = function(mongoose, config) {
489
480
  var hasSendOnLessThanNow = reminder.sendOn && reminder.sendOn < now;
490
481
  var hasSentOn = reminder.sentOn;
491
482
  var hasSentToQueue = reminder.sentToQueue;
492
- var hasBeenSubmitted = snapshot.submittedOn;
493
- var hasBeenRejected = snapshot.rejection;
494
- return hasSendTo && hasSendOnLessThanNow && !hasSentOn && !hasSentToQueue && ((!hasBeenSubmitted) || (hasBeenSubmitted && hasBeenRejected));
483
+ return hasSendTo && hasSendOnLessThanNow && !hasSentOn && !hasSentToQueue;
495
484
  });
496
485
 
497
486
  if(conditions) {
@@ -529,9 +518,7 @@ module.exports = function(mongoose, config) {
529
518
  'notifications.company.sendTo': { $gt: [] },
530
519
  'notifications.company.rejections.sendOn': { $lte: now },
531
520
  'notifications.company.rejections.sentOn': null,
532
- 'notifications.company.rejections.sentToQueue': false,
533
- 'submittedOn': { $ne: null },
534
- 'rejection': { $ne: null }
521
+ 'notifications.company.rejections.sentToQueue': false
535
522
  }
536
523
  }
537
524
  });
@@ -551,9 +538,7 @@ module.exports = function(mongoose, config) {
551
538
  var hasSendOnLessThanNow = rejection.sendOn && rejection.sendOn < now;
552
539
  var hasSentOn = rejection.sentOn;
553
540
  var hasSentToQueue = rejection.sentToQueue;
554
- var hasBeenSubmitted = snapshot.submittedOn;
555
- var hasBeenRejected = snapshot.rejection;
556
- return hasSendTo && hasSendOnLessThanNow && !hasSentOn && !hasSentToQueue && hasBeenSubmitted && hasBeenRejected;
541
+ return hasSendTo && hasSendOnLessThanNow && !hasSentOn && !hasSentToQueue;
557
542
  });
558
543
 
559
544
  if(conditions) {
@@ -592,7 +577,7 @@ module.exports = function(mongoose, config) {
592
577
  'notifications.stakeholders.sendTo.organization': { $ne: null },
593
578
  'notifications.stakeholders.initial.sendOn': { $lte: now },
594
579
  'notifications.stakeholders.initial.sentOn': null,
595
- 'notifications.stakeholders.initial.sentToQueue': false,
580
+ 'notifications.stakeholders.initial.sentToQueue': false
596
581
  }
597
582
  }
598
583
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "9.21.0",
3
+ "version": "9.22.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",