@dhyasama/totem-models 1.13.2 → 1.14.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/LimitedPartner.js +4 -7
- package/lib/Organization.js +9 -0
- package/package.json +1 -1
package/lib/LimitedPartner.js
CHANGED
|
@@ -35,8 +35,6 @@ module.exports = function(mongoose, config) {
|
|
|
35
35
|
|
|
36
36
|
shortName: { type: String, default: '' },
|
|
37
37
|
|
|
38
|
-
related: [{ type: Schema.ObjectId, ref: 'Organization'}],
|
|
39
|
-
|
|
40
38
|
start: { type: String, default: '' },
|
|
41
39
|
|
|
42
40
|
people: [{
|
|
@@ -376,7 +374,6 @@ module.exports = function(mongoose, config) {
|
|
|
376
374
|
query.populate('fundsInvested.fund');
|
|
377
375
|
query.populate('people');
|
|
378
376
|
query.populate('notes');
|
|
379
|
-
query.populate('related', 'name logoUrl');
|
|
380
377
|
query.deepPopulate([
|
|
381
378
|
'people.sources.person',
|
|
382
379
|
'people.calendarEventSummaries.attendees.internal',
|
|
@@ -702,14 +699,14 @@ module.exports = function(mongoose, config) {
|
|
|
702
699
|
|
|
703
700
|
LimitedPartner.plugin(filter, {
|
|
704
701
|
readFilter: {
|
|
705
|
-
'admin': ['name', 'shortName', '
|
|
706
|
-
'lp-full': ['name', 'shortName', '
|
|
702
|
+
'admin': ['name', 'shortName', 'start', 'people', 'documentSlugs', 'fundsInvested', 'contact', 'distributions', 'k1', 'entered', 'status', 'flagged', 'notes'],
|
|
703
|
+
'lp-full': ['name', 'shortName', 'start', 'people', 'documentSlugs', 'fundsInvested', 'contact', 'distributions', 'k1', 'entered', 'status', 'flagged', 'notes'],
|
|
707
704
|
'lp-names': ['name', 'shortName', 'flagged'],
|
|
708
705
|
'none': []
|
|
709
706
|
},
|
|
710
707
|
writeFilter: {
|
|
711
|
-
'admin': ['name', 'shortName', '
|
|
712
|
-
'lp-full': ['name', 'shortName', '
|
|
708
|
+
'admin': ['name', 'shortName', 'start', 'people', 'documentSlugs', 'fundsInvested', 'contact', 'distributions', 'k1', 'entered', 'status', 'flagged', 'notes'],
|
|
709
|
+
'lp-full': ['name', 'shortName', 'start', 'people', 'documentSlugs', 'fundsInvested', 'contact', 'distributions', 'k1', 'entered', 'status', 'flagged', 'notes'],
|
|
713
710
|
'lp-names': ['flagged'],
|
|
714
711
|
'none': []
|
|
715
712
|
},
|
package/lib/Organization.js
CHANGED
|
@@ -619,6 +619,14 @@ module.exports = function(mongoose, config) {
|
|
|
619
619
|
|
|
620
620
|
};
|
|
621
621
|
|
|
622
|
+
Organization.statics.findByLimitedPartner = function findByLimitedPartner(lpid, cb) {
|
|
623
|
+
var self = this;
|
|
624
|
+
self
|
|
625
|
+
.find({ 'lps': lpid, 'deleted': {$ne: true} })
|
|
626
|
+
.select('name logoUrl')
|
|
627
|
+
.exec(cb);
|
|
628
|
+
};
|
|
629
|
+
|
|
622
630
|
Organization.statics.findByPerson = function findByPerson(personId, cb) {
|
|
623
631
|
|
|
624
632
|
// Given a person id, get all organizations with that person
|
|
@@ -726,6 +734,7 @@ module.exports = function(mongoose, config) {
|
|
|
726
734
|
.populate('funds', 'name hexColorCode closeDate')
|
|
727
735
|
.populate('operating.acquired.public.by', 'name logoUrl')
|
|
728
736
|
.populate('operating.acquired.private.by', 'name logoUrl')
|
|
737
|
+
.populate('lps')
|
|
729
738
|
.deepPopulate([
|
|
730
739
|
'people.person.sources.person',
|
|
731
740
|
'people.person.calendarEventSummaries.attendees.internal',
|