@dhyasama/totem-models 11.25.0 → 11.27.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.
@@ -1726,21 +1726,17 @@ module.exports = function(mongoose, config) {
1726
1726
  }
1727
1727
 
1728
1728
  let query = self
1729
- .find({
1730
- '_id': { $in: orgIds },
1731
- 'valuations': {
1732
- $elemMatch: {
1733
- 'date': { $gte: startDate, $lte: endDate },
1734
- 'customer': customerId
1735
- }
1736
- }
1737
- })
1729
+ .find( {'_id': { $in : orgIds } } )
1738
1730
  .select('_id valuations');
1739
1731
 
1740
1732
  query.exec(function(err, orgs) {
1741
1733
 
1742
1734
  if (err) { return cb(err, null); }
1743
1735
 
1736
+ orgs = _.map(orgs, function(org) {
1737
+ return helpers.cleanOrg(org, customerId);
1738
+ });
1739
+
1744
1740
  return cb(null, orgs);
1745
1741
 
1746
1742
  });
package/lib/Round.js CHANGED
@@ -666,7 +666,7 @@ module.exports = function(mongoose, config) {
666
666
  let query = self.find({ 'vehicles.fund': { $in: fundIds } });
667
667
 
668
668
  query.select('organization');
669
- query.populate('organization', 'name people website');
669
+ query.populate('organization', 'name website status ipo operating people');
670
670
 
671
671
  query.exec(function(err, rounds) {
672
672
 
@@ -675,6 +675,7 @@ module.exports = function(mongoose, config) {
675
675
 
676
676
  if (!options.isWorkerProcess) {
677
677
  _.each(rounds, function(round) {
678
+ round.organization = round.organization.toObject({ virtuals: true });
678
679
  round = helpers.cleanRound(round, fundIds, options.CUSTOMER_ID);
679
680
  round.organization = helpers.cleanOrg(round.organization, options.CUSTOMER_ID);
680
681
  });
@@ -689,6 +690,7 @@ module.exports = function(mongoose, config) {
689
690
  _id: rounds[0].organization._id,
690
691
  name: rounds[0].organization.name,
691
692
  website: rounds[0].organization.website,
693
+ status: rounds[0].organization.status,
692
694
  people: rounds[0].organization.people
693
695
  });
694
696
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "11.25.0",
3
+ "version": "11.27.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",