@dhyasama/totem-models 7.4.1 → 7.5.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/Financials.js +2 -2
- package/lib/Round.js +8 -18
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -402,8 +402,8 @@ module.exports = function(mongoose, config) {
|
|
|
402
402
|
|
|
403
403
|
else {
|
|
404
404
|
snapshot.status = 'In Progress';
|
|
405
|
-
if(snapshot.notifications.company.reminder.status) snapshot.action =
|
|
406
|
-
else if (snapshot.notifications.company.initial.status) snapshot.action =
|
|
405
|
+
if(snapshot.notifications.company.reminder.status) snapshot.action = snapshot.notifications.company.reminder.status;
|
|
406
|
+
else if (snapshot.notifications.company.initial.status) snapshot.action = snapshot.notifications.company.initial.status;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
}
|
package/lib/Round.js
CHANGED
|
@@ -875,26 +875,16 @@ module.exports = function(mongoose, config) {
|
|
|
875
875
|
|
|
876
876
|
// participating vehicles are public
|
|
877
877
|
// merge private data that was matched for customer
|
|
878
|
-
_.each(doc.vehicles, function(vehicle) {
|
|
879
878
|
|
|
880
|
-
|
|
879
|
+
var allInvestments = _.flatten(_.pluck(doc.vehicles, 'investments'));
|
|
880
|
+
var mostRecentInvestment = _.max(allInvestments, function(investment) { return investment.investmentDate; });
|
|
881
881
|
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
if (mostRecentInvestment.preMoneyValuation) doc.preMoneyValuation = mostRecentInvestment.preMoneyValuation;
|
|
889
|
-
if (mostRecentInvestment.dollarsRaised) doc.dollarsRaised = mostRecentInvestment.dollarsRaised;
|
|
890
|
-
if (mostRecentInvestment.closingDate) doc.closingDate = mostRecentInvestment.closingDate;
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
doc.vehicles = _.filter(doc.vehicles, function(v) {
|
|
894
|
-
return v.investments.length >= 1;
|
|
895
|
-
});
|
|
896
|
-
|
|
897
|
-
});
|
|
882
|
+
// if we have private data, use it rather than the public data
|
|
883
|
+
if (mostRecentInvestment) {
|
|
884
|
+
if (mostRecentInvestment.preMoneyValuation) doc.preMoneyValuation = mostRecentInvestment.preMoneyValuation;
|
|
885
|
+
if (mostRecentInvestment.dollarsRaised) doc.dollarsRaised = mostRecentInvestment.dollarsRaised;
|
|
886
|
+
if (mostRecentInvestment.closingDate) doc.closingDate = mostRecentInvestment.closingDate;
|
|
887
|
+
}
|
|
898
888
|
|
|
899
889
|
return next();
|
|
900
890
|
|