@dhyasama/totem-models 11.23.0 → 11.25.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 +16 -0
- package/package.json +1 -1
package/lib/Account.js
CHANGED
|
@@ -242,6 +242,22 @@ module.exports = function(mongoose, config) {
|
|
|
242
242
|
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
+
Account.statics.listSummaryAccounts = function (options, cb) {
|
|
246
|
+
|
|
247
|
+
const self = this;
|
|
248
|
+
|
|
249
|
+
if (!cb) { throw new Error('cb is required'); }
|
|
250
|
+
|
|
251
|
+
let queryObj = { 'active': true, 'summary.active': true };
|
|
252
|
+
|
|
253
|
+
if (options.CUSTOMER_ID) {
|
|
254
|
+
queryObj['org'] = options.CUSTOMER_ID;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
self.find(queryObj).exec(cb);
|
|
258
|
+
|
|
259
|
+
};
|
|
260
|
+
|
|
245
261
|
Account.statics.listAllAccounts = function (options, cb) {
|
|
246
262
|
|
|
247
263
|
// This is only for worker
|