@dhyasama/totem-models 9.45.1 → 9.45.3

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 +16 -7
  2. package/package.json +1 -1
package/lib/Financials.js CHANGED
@@ -613,6 +613,8 @@ module.exports = function(mongoose, config) {
613
613
 
614
614
  financials = financials || [];
615
615
 
616
+ console.log('count: ' + financials.length);
617
+
616
618
  let results = [];
617
619
 
618
620
  _.each(financials, function(financial) {
@@ -633,6 +635,13 @@ module.exports = function(mongoose, config) {
633
635
  const sentToQueue = stakeholder.initial.sentToQueue;
634
636
  const conditionsMet = sendToEmail && sendOnLessThanNow && !sentOn && !sentToQueue;
635
637
 
638
+ console.log(' uuid: ' + snapshot.uuid);
639
+ console.log(' sendToEmail: ' + sendToEmail);
640
+ console.log(' sendOnLessThanNow: ' + sendOnLessThanNow);
641
+ console.log(' sentOn: ' + sentOn);
642
+ console.log(' sentToQueue: ' + sentToQueue);
643
+ console.log(' conditionsMet: ' + conditionsMet);
644
+
636
645
  if (conditionsMet) {
637
646
 
638
647
  results.push({
@@ -835,15 +844,15 @@ module.exports = function(mongoose, config) {
835
844
 
836
845
  const updateStatus = function updateStatus(self) {
837
846
 
838
- console.log('Financials update status ' + self._id.toString() + ' begin');
847
+ console.log('Financials update status begin');
839
848
 
840
849
  _.each(self.snapshots, function(snapshot, index) {
841
850
 
842
- console.log('Financials update status ' + self._id.toString() + ' snapshot index ' + index.toString());
851
+ console.log('Financials update status snapshot index ' + index.toString());
843
852
 
844
853
  if (!snapshot) return;
845
854
 
846
- console.log('Financials update status ' + self._id.toString() + ' snapshot index ' + index.toString() + ' - 1');
855
+ console.log('Financials update status snapshot index ' + index.toString() + ' - 1');
847
856
 
848
857
  var needsReview = snapshot.review;
849
858
  var isSubmitted = snapshot.submittedOn;
@@ -852,7 +861,7 @@ module.exports = function(mongoose, config) {
852
861
  var isArchived = snapshot.archivedOn;
853
862
  var isOverdue = snapshot.dueOn ? moment(new Date()).isAfter(moment(snapshot.dueOn)) : false;
854
863
 
855
- console.log('Financials update status ' + self._id.toString() + ' snapshot index ' + index.toString() + ' - 2');
864
+ console.log('Financials update status snapshot index ' + index.toString() + ' - 2');
856
865
 
857
866
  var isOpened = false;
858
867
  var isDelivered = false;
@@ -861,7 +870,7 @@ module.exports = function(mongoose, config) {
861
870
  isDelivered = snapshot.notifications.company.initial.sentOn;
862
871
  }
863
872
 
864
- console.log('Financials update status ' + self._id.toString() + ' snapshot index ' + index.toString() + ' - 3');
873
+ console.log('Financials update status snapshot index ' + index.toString() + ' - 3');
865
874
 
866
875
  if(!snapshot.uuid) snapshot.status = 'Completed'; // no uuid means the snapshot was created from the google sheet and should always be completed
867
876
  else if(needsReview && isApproved) snapshot.status = 'Completed';
@@ -874,11 +883,11 @@ module.exports = function(mongoose, config) {
874
883
  else if(isDelivered) snapshot.status = 'Delivered';
875
884
  else snapshot.status = 'Upcoming'; // Upcoming is set when a snapshot is created to be sent to an org, typically within a minute or so
876
885
 
877
- console.log('Financials update status ' + self._id.toString() + ' snapshot index ' + index.toString() + ' - 4');
886
+ console.log('Financials update status snapshot index ' + index.toString() + ' - 4');
878
887
 
879
888
  });
880
889
 
881
- console.log('Financials update status ' + self._id.toString() + ' end');
890
+ console.log('Financials update status end');
882
891
 
883
892
  };
884
893
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "9.45.1",
3
+ "version": "9.45.3",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",