@dhyasama/totem-models 1.17.5 → 1.17.6
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 +16 -3
- package/lib/Organization.js +1 -1
- package/package.json +1 -1
package/lib/LimitedPartner.js
CHANGED
|
@@ -433,6 +433,12 @@ module.exports = function(mongoose, config) {
|
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
+
// self
|
|
437
|
+
// .find({'people': personId}, this.getReadFilterKeys(role))
|
|
438
|
+
// .populate('fundsInvested.fund')
|
|
439
|
+
// .populate('people', 'name')
|
|
440
|
+
// .exec(cb);
|
|
441
|
+
|
|
436
442
|
};
|
|
437
443
|
|
|
438
444
|
LimitedPartner.statics.list = function (role, cb) {
|
|
@@ -669,11 +675,16 @@ module.exports = function(mongoose, config) {
|
|
|
669
675
|
});
|
|
670
676
|
|
|
671
677
|
LimitedPartner.pre('init', function(next) {
|
|
672
|
-
if (!LPS_ENABLED) throw new Error('LPS_ENABLED is false');
|
|
678
|
+
if (CUSTOMER_ID != 'GLOBAL_PROCESS' && !LPS_ENABLED) throw new Error('LPS_ENABLED is false');
|
|
673
679
|
else next();
|
|
674
680
|
});
|
|
675
681
|
|
|
676
|
-
LimitedPartner.post('init', function() {
|
|
682
|
+
LimitedPartner.post('init', function(doc, next) {
|
|
683
|
+
|
|
684
|
+
if (CUSTOMER_ID != 'GLOBAL_PROCESS' && !LPS_ENABLED) {
|
|
685
|
+
doc = null;
|
|
686
|
+
return next();
|
|
687
|
+
}
|
|
677
688
|
|
|
678
689
|
// Decrypt sensitive data
|
|
679
690
|
|
|
@@ -706,6 +717,8 @@ module.exports = function(mongoose, config) {
|
|
|
706
717
|
|
|
707
718
|
if (this.k1 && this.k1.EIN) { this.k1.EIN = crypto.decrypt(this.k1.EIN); }
|
|
708
719
|
|
|
720
|
+
next();
|
|
721
|
+
|
|
709
722
|
});
|
|
710
723
|
|
|
711
724
|
//////////////////////////////
|
|
@@ -730,7 +743,7 @@ module.exports = function(mongoose, config) {
|
|
|
730
743
|
|
|
731
744
|
//////////////////////////////
|
|
732
745
|
|
|
733
|
-
LimitedPartner.set('autoIndex',
|
|
746
|
+
LimitedPartner.set('autoIndex', true);
|
|
734
747
|
LimitedPartner.on('index', function(err) { console.log('error building limited partner indexes: ' + err); });
|
|
735
748
|
|
|
736
749
|
LimitedPartner.set('toJSON', { virtuals: true });
|
package/lib/Organization.js
CHANGED
|
@@ -734,7 +734,7 @@ module.exports = function(mongoose, config) {
|
|
|
734
734
|
Organization.statics.getById = function getById(id, cb) {
|
|
735
735
|
|
|
736
736
|
var self = this;
|
|
737
|
-
|
|
737
|
+
|
|
738
738
|
self
|
|
739
739
|
.findById(id)
|
|
740
740
|
.populate('people.person', 'name avatarUrl title calendarEventSummaries sources')
|