@dhyasama/totem-models 6.11.6 → 6.11.8

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.
@@ -440,7 +440,7 @@ module.exports = function(mongoose, config) {
440
440
 
441
441
  });
442
442
 
443
- Organization.virtual('customer.deals.activeStatuses').get(function () {
443
+ Organization.virtual('customer.deals.activeStages').get(function () {
444
444
 
445
445
  var self = this;
446
446
 
@@ -450,12 +450,12 @@ module.exports = function(mongoose, config) {
450
450
  // Deals aren't on for customer
451
451
  else if (!self.customer.deals.active) return [];
452
452
 
453
- // Get active status names and sort them
454
- var statuses = _.filter(self.customer.deals.statuses, function(s) { return s.active; });
455
- statuses = _.sortBy(statuses, 'order');
456
- statuses = _.pluck(statuses, 'name');
453
+ // Get active stage names and sort them
454
+ var stages = _.filter(self.customer.deals.stages, function(s) { return s.active; });
455
+ stages = _.sortBy(stages, 'order');
456
+ stages = _.pluck(stages, 'name');
457
457
 
458
- return statuses;
458
+ return stages;
459
459
 
460
460
  });
461
461
 
@@ -755,10 +755,10 @@ module.exports = function(mongoose, config) {
755
755
  if (err) return callback(err, null);
756
756
  else if (!org) return callback(new Error('Customer not found'), null);
757
757
 
758
- var statuses = org.customer.deals.activeStatuses;
758
+ var stages = org.customer.deals.activeStatuses;
759
759
 
760
- var match = _.find(statuses, function(status) {
761
- return status == previous.deal.stage;
760
+ var match = _.find(stages, function(stage) {
761
+ return stage == previous.deal.stage;
762
762
  });
763
763
 
764
764
  if (!match) return callback(new Error('This stage is not valid for this customer'), null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "6.11.6",
3
+ "version": "6.11.8",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",