@dhyasama/totem-models 7.46.0 → 7.48.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/Financials.js CHANGED
@@ -287,19 +287,27 @@ module.exports = function(mongoose, config) {
287
287
  }
288
288
  });
289
289
 
290
- query.exec(function(err, result) {
290
+ query.populate('organization', 'name');
291
291
 
292
- var snapshots = _.pluck(result || [], 'snapshots');
293
- snapshots = _.flatten(snapshots);
292
+ query.exec(function(err, results) {
294
293
 
295
- snapshots = _.filter(snapshots, function(snapshot) {
294
+ var snapshots = [];
296
295
 
297
- var bool = snapshot.managedServices;
298
- bool = bool && snapshot.submittedOn;
299
- bool = bool && !snapshot.reviewedOn;
296
+ _.each(results, function(result) {
297
+ _.each(result.snapshots, function(snapshot) {
300
298
 
301
- return bool;
299
+ var bool = snapshot.managedServices;
300
+ bool = bool && snapshot.submittedOn;
301
+ bool = bool && !snapshot.reviewedOn;
302
+
303
+ if(bool) {
304
+ snapshots.push({
305
+ organization: result.organization.name,
306
+ snapshot: snapshot
307
+ });
308
+ }
302
309
 
310
+ });
303
311
  });
304
312
 
305
313
  if (err) { return cb(err, null); }
@@ -454,7 +454,7 @@ module.exports = function(mongoose, config) {
454
454
  query.exec(cb);
455
455
  };
456
456
 
457
- query = self.find({'customer': customerId, 'name': lpName, 'transactions.fund': { $in : self.customerFunds }}, self.getReadFilterKeys(role));
457
+ query = self.find({'customer': customerId, 'name': lpName}, self.getReadFilterKeys(role));
458
458
  getLps();
459
459
 
460
460
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "7.46.0",
3
+ "version": "7.48.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",