@dhyasama/totem-models 8.91.0 → 8.92.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/Account.js +14 -0
- package/package.json +1 -1
package/lib/Account.js
CHANGED
|
@@ -216,6 +216,20 @@ module.exports = function(mongoose, config) {
|
|
|
216
216
|
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
+
Account.statics.getAccountsByCustomer = function (cb) {
|
|
220
|
+
|
|
221
|
+
const self = this;
|
|
222
|
+
|
|
223
|
+
if (!cb) { throw new Error('cb is required'); }
|
|
224
|
+
|
|
225
|
+
self
|
|
226
|
+
.find({'active': true})
|
|
227
|
+
.populate('person')
|
|
228
|
+
.populate('org')
|
|
229
|
+
.exec(cb);
|
|
230
|
+
|
|
231
|
+
};
|
|
232
|
+
|
|
219
233
|
Account.statics.listAllAccounts = function (options, cb) {
|
|
220
234
|
|
|
221
235
|
// This is only for worker
|