@dhyasama/totem-models 1.26.0 → 1.26.2
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/Fund.js +1 -0
- package/lib/LimitedPartner.js +5 -0
- package/lib/List.js +1 -1
- package/lib/Organization.js +2 -2
- package/lib/Round.js +2 -1
- package/package.json +1 -1
package/lib/Fund.js
CHANGED
|
@@ -12,6 +12,7 @@ module.exports = function(mongoose, config) {
|
|
|
12
12
|
name: { type: String, required: true, unique: true },
|
|
13
13
|
slug: { type: String, required: true, unique: true },
|
|
14
14
|
shortName: { type: String, required: true },
|
|
15
|
+
abbreviation: { type: String, required: true },
|
|
15
16
|
spv: { type: Boolean, default: false },
|
|
16
17
|
hexColorCode: { type: String, required: true, default: '#cccccc' },
|
|
17
18
|
closeDate: { type: Date },
|
package/lib/LimitedPartner.js
CHANGED
|
@@ -176,6 +176,11 @@ module.exports = function(mongoose, config) {
|
|
|
176
176
|
|
|
177
177
|
/////////////////////
|
|
178
178
|
|
|
179
|
+
LimitedPartner.virtual('totalCommitted').get(function () {
|
|
180
|
+
var self = this;
|
|
181
|
+
return _.reduce(self.fundsInvested, function(memo, fund) { return memo + fund.committed; }, 0);
|
|
182
|
+
});
|
|
183
|
+
|
|
179
184
|
LimitedPartner.virtual('email.primary').get(function () {
|
|
180
185
|
var primary = _.find(this.contact.email, function(email) {
|
|
181
186
|
return email.primary;
|
package/lib/List.js
CHANGED
|
@@ -116,7 +116,7 @@ module.exports = function(mongoose, config) {
|
|
|
116
116
|
'customer': config.CUSTOMER_ID
|
|
117
117
|
})
|
|
118
118
|
.populate('createdBy', 'name avatarUrl')
|
|
119
|
-
.populate('limitedPartners', 'name logoUrl')
|
|
119
|
+
.populate('limitedPartners', 'name logoUrl fundsInvested')
|
|
120
120
|
.populate('organizations', 'name logoUrl')
|
|
121
121
|
.populate('people', 'name title avatarUrl contact')
|
|
122
122
|
.exec(cb);
|
package/lib/Organization.js
CHANGED
|
@@ -657,7 +657,7 @@ module.exports = function(mongoose, config) {
|
|
|
657
657
|
.populate('related', 'name logoUrl')
|
|
658
658
|
.populate('chairs.first', 'name avatarUrl title')
|
|
659
659
|
.populate('chairs.second', 'name avatarUrl title')
|
|
660
|
-
.populate('funds', 'name hexColorCode')
|
|
660
|
+
.populate('funds', 'name hexColorCode abbreviation')
|
|
661
661
|
.deepPopulate([
|
|
662
662
|
'people.person.sources.person',
|
|
663
663
|
'people.person.calendarEventSummaries.attendees.internal',
|
|
@@ -799,7 +799,7 @@ module.exports = function(mongoose, config) {
|
|
|
799
799
|
.populate('related', 'name logoUrl')
|
|
800
800
|
.populate('chairs.first', 'name avatarUrl title')
|
|
801
801
|
.populate('chairs.second', 'name avatarUrl title')
|
|
802
|
-
.populate('funds', 'name hexColorCode closeDate')
|
|
802
|
+
.populate('funds', 'name hexColorCode abbreviation closeDate')
|
|
803
803
|
.populate('operating.acquired.public.by', 'name logoUrl')
|
|
804
804
|
.populate('operating.acquired.private.by', 'name logoUrl')
|
|
805
805
|
.populate(lpPopulateOptions)
|
package/lib/Round.js
CHANGED
|
@@ -560,7 +560,8 @@ module.exports = function(mongoose, config) {
|
|
|
560
560
|
.exec(function(err, rounds) {
|
|
561
561
|
|
|
562
562
|
if (err) return cb(err, null);
|
|
563
|
-
if (!rounds
|
|
563
|
+
else if (!rounds) return cb(null, null);
|
|
564
|
+
else if(rounds.length == 0) return cb(null, []);
|
|
564
565
|
|
|
565
566
|
rounds = filterVehicles(rounds, [fundId]);
|
|
566
567
|
|