@dhyasama/totem-models 7.41.0 → 7.43.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 +6 -12
- package/package.json +1 -1
package/lib/LimitedPartner.js
CHANGED
|
@@ -381,7 +381,7 @@ module.exports = function(mongoose, config) {
|
|
|
381
381
|
.exec(cb);
|
|
382
382
|
};
|
|
383
383
|
|
|
384
|
-
LimitedPartner.statics.getById = function(
|
|
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(
|
|
411
|
+
query = self.findById(lpId, self.getReadFilterKeys(role))
|
|
412
412
|
getLp();
|
|
413
413
|
}
|
|
414
414
|
else {
|
|
415
|
-
query = self.findOne({ '_id':
|
|
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;
|
|
@@ -454,14 +454,8 @@ module.exports = function(mongoose, config) {
|
|
|
454
454
|
query.exec(cb);
|
|
455
455
|
};
|
|
456
456
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
getLps();
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
query = self.find({'name': lpName, 'transactions.fund': { $in : self.customerFunds }}, self.getReadFilterKeys(role));
|
|
463
|
-
getLps();
|
|
464
|
-
}
|
|
457
|
+
query = self.find({'customer': customerId, 'name': lpName, 'transactions.fund': { $in : self.customerFunds }}, self.getReadFilterKeys(role));
|
|
458
|
+
getLps();
|
|
465
459
|
|
|
466
460
|
};
|
|
467
461
|
|