@dhyasama/totem-models 7.41.0 → 7.42.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.
@@ -381,7 +381,7 @@ module.exports = function(mongoose, config) {
381
381
  .exec(cb);
382
382
  };
383
383
 
384
- LimitedPartner.statics.getById = function(id, role, cb) {
384
+ LimitedPartner.statics.getById = function(customerId, lpId, role, cb) {
385
385
 
386
386
  var self = this;
387
387
  var query;
@@ -408,11 +408,11 @@ module.exports = function(mongoose, config) {
408
408
  };
409
409
 
410
410
  if (CUSTOMER_ID == 'GLOBAL_PROCESS') {
411
- query = self.findById(id, self.getReadFilterKeys(role))
411
+ query = self.findById(lpId, self.getReadFilterKeys(role))
412
412
  getLp();
413
413
  }
414
414
  else {
415
- query = self.findOne({ '_id': id, 'transactions.fund': { $in : self.customerFunds }}, self.getReadFilterKeys(role));
415
+ query = self.findOne({ '_id': lpId, 'customer': customerId, 'transactions.fund': { $in : self.customerFunds }}, self.getReadFilterKeys(role));
416
416
  getLp();
417
417
  }
418
418
 
@@ -444,7 +444,7 @@ module.exports = function(mongoose, config) {
444
444
 
445
445
  };
446
446
 
447
- LimitedPartner.statics.getByName = function(lpName, role, cb) {
447
+ LimitedPartner.statics.getByName = function(customerId, lpName, role, cb) {
448
448
 
449
449
  var self = this;
450
450
  var query;
@@ -459,7 +459,7 @@ module.exports = function(mongoose, config) {
459
459
  getLps();
460
460
  }
461
461
  else {
462
- query = self.find({'name': lpName, 'transactions.fund': { $in : self.customerFunds }}, self.getReadFilterKeys(role));
462
+ query = self.find({'customer': customerId, 'name': lpName, 'transactions.fund': { $in : self.customerFunds }}, self.getReadFilterKeys(role));
463
463
  getLps();
464
464
  }
465
465
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "7.41.0",
3
+ "version": "7.42.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",