@dhyasama/totem-models 8.43.0 → 8.45.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.
package/lib/Investment.js CHANGED
@@ -71,6 +71,7 @@ module.exports = function(mongoose, config) {
71
71
  // note these fields are duplicative at the round level
72
72
  // this is private data and will override the round level numbers where appropriate
73
73
  preMoneyValuation: { type: Number, default: 0 },
74
+ postMoneyValuation: { type: Number, default: 0 },
74
75
  dollarsRaised: { type: Number, default: 0 },
75
76
  closingDate: { type: Date, default: null }
76
77
 
@@ -1696,6 +1696,20 @@ module.exports = function(mongoose, config) {
1696
1696
 
1697
1697
  };
1698
1698
 
1699
+ Organization.statics.removeCustomerValuations = function(customerId, cb) {
1700
+
1701
+ var self = this;
1702
+
1703
+ self
1704
+ .update(
1705
+ { 'valuations.customer': customerId },
1706
+ { $pull : { 'valuations': { 'customer': customerId } } },
1707
+ { multi : true }
1708
+ )
1709
+ .exec(cb);
1710
+
1711
+ };
1712
+
1699
1713
  Organization.statics.search = function search(data, options, cb) {
1700
1714
 
1701
1715
  // search for orgs based on fields provided
package/lib/Round.js CHANGED
@@ -35,6 +35,7 @@ module.exports = function(mongoose, config) {
35
35
  // these three values are public and will be used in the absence of overriding private data
36
36
  // if private data exists (in the form of investments), the most recent investment data will be used
37
37
  preMoneyValuation: { type: Number, default: 0 },
38
+ postMoneyValuation: { type: Number, default: 0 },
38
39
  dollarsRaised: { type: Number, default: 0 },
39
40
  closingDate: { type: Date, default: null },
40
41
 
@@ -158,6 +159,7 @@ module.exports = function(mongoose, config) {
158
159
  filters: rounds[0].organization.filters,
159
160
  status: rounds[0].organization.status,
160
161
  preMoneyValuation: rounds[0].preMoneyValuation,
162
+ postMoneyValuation: rounds[0].postMoneyValuation,
161
163
  chairs: rounds[0].organization.chairs,
162
164
  funds: funds
163
165
  };
@@ -650,7 +652,7 @@ module.exports = function(mongoose, config) {
650
652
 
651
653
  let query = self.find({ 'vehicles.fund': fundId });
652
654
 
653
- query.select('organization vehicles preMoneyValuation');
655
+ query.select('organization vehicles preMoneyValuation postMoneyValuation');
654
656
  query.populate('organization', 'name slug logoUrl description contact filters status ipo closed acquired operating website websiteAliases');
655
657
  query.populate('vehicles.fund');
656
658
 
@@ -704,7 +706,7 @@ module.exports = function(mongoose, config) {
704
706
 
705
707
  let query = self.find({ 'vehicles.fund': { $in: fundIds } });
706
708
 
707
- query.select('organization vehicles preMoneyValuation');
709
+ query.select('organization vehicles preMoneyValuation postMoneyValuation');
708
710
  query.populate('organization', 'name slug logoUrl description contact chairs filters status ipo closed acquired operating website websiteAliases');
709
711
  query.deepPopulate([
710
712
  'organization.chairs.first',
@@ -940,6 +942,7 @@ module.exports = function(mongoose, config) {
940
942
 
941
943
  // note that public versions of the following data exist at this level:
942
944
  // preMoneyValuation
945
+ // postMoneyValuation
943
946
  // amountRaised
944
947
  // closingDate
945
948
  // this data will be overwritten if private data belonging to the current customer is present
@@ -957,6 +960,7 @@ module.exports = function(mongoose, config) {
957
960
  // if we have private data, use it rather than the public data
958
961
  if (mostRecentInvestment) {
959
962
  if (mostRecentInvestment.preMoneyValuation) { doc.preMoneyValuation = mostRecentInvestment.preMoneyValuation; }
963
+ if (mostRecentInvestment.postMoneyValuation) { doc.postMoneyValuation = mostRecentInvestment.postMoneyValuation; }
960
964
  if (mostRecentInvestment.dollarsRaised) { doc.dollarsRaised = mostRecentInvestment.dollarsRaised; }
961
965
  if (mostRecentInvestment.closingDate) { doc.closingDate = mostRecentInvestment.closingDate; }
962
966
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "8.43.0",
3
+ "version": "8.45.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",