@dhyasama/totem-models 8.19.0 → 8.19.1
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 +3 -2
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -209,7 +209,7 @@ module.exports = function(mongoose, config) {
|
|
|
209
209
|
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
Financials.statics.getByUUID = function getByUUID(uuid, cb) {
|
|
213
213
|
|
|
214
214
|
let self = this;
|
|
215
215
|
|
|
@@ -219,6 +219,7 @@ module.exports = function(mongoose, config) {
|
|
|
219
219
|
|
|
220
220
|
query.populate('organization', 'name logoUrl');
|
|
221
221
|
query.populate('customer');
|
|
222
|
+
query.populate('snapshots.documents');
|
|
222
223
|
|
|
223
224
|
query.exec(function (err, result) {
|
|
224
225
|
|
|
@@ -235,7 +236,7 @@ module.exports = function(mongoose, config) {
|
|
|
235
236
|
_.each(result.snapshots, function (snapshot) {
|
|
236
237
|
|
|
237
238
|
snapshot.documents = _.filter(snapshot.documents, function (document) {
|
|
238
|
-
return document.customer
|
|
239
|
+
return document.customer.toString() === result.customer._id.toString();
|
|
239
240
|
});
|
|
240
241
|
|
|
241
242
|
});
|