@dhyasama/totem-models 8.1.2 → 8.3.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 +17 -0
- package/lib/LimitedPartner.js +13 -0
- package/package.json +1 -1
- package/test/Account.js +1 -1
package/lib/Account.js
CHANGED
|
@@ -183,6 +183,23 @@ module.exports = function(mongoose, config) {
|
|
|
183
183
|
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
+
Account.statics.listAllAccountsSkinny = function (options, cb) {
|
|
187
|
+
|
|
188
|
+
const self = this;
|
|
189
|
+
|
|
190
|
+
if (!cb) { throw new Error('cb is required'); }
|
|
191
|
+
|
|
192
|
+
options = helpers.getDefaultOptions(options);
|
|
193
|
+
|
|
194
|
+
if (!options.isWorkerProcess) { return cb(null, []); }
|
|
195
|
+
|
|
196
|
+
self
|
|
197
|
+
.find({'active': true})
|
|
198
|
+
.select('active email auth')
|
|
199
|
+
.exec(cb);
|
|
200
|
+
|
|
201
|
+
};
|
|
202
|
+
|
|
186
203
|
Account.statics.listGoogleAccounts = function(options, cb) {
|
|
187
204
|
|
|
188
205
|
// This is only for worker
|
package/lib/LimitedPartner.js
CHANGED
|
@@ -555,6 +555,19 @@ module.exports = function(mongoose, config) {
|
|
|
555
555
|
|
|
556
556
|
};
|
|
557
557
|
|
|
558
|
+
LimitedPartner.statics.removeCustomerCommitments = function removeCustomerCommitments(customerId, cb) {
|
|
559
|
+
|
|
560
|
+
const self = this;
|
|
561
|
+
|
|
562
|
+
let query = self.update(
|
|
563
|
+
{ 'customer': customerId },
|
|
564
|
+
{ $set: { fundsInvested: [] } },
|
|
565
|
+
{ multi : true }
|
|
566
|
+
);
|
|
567
|
+
query.exec(cb);
|
|
568
|
+
|
|
569
|
+
};
|
|
570
|
+
|
|
558
571
|
LimitedPartner.statics.search = function (terms, options, cb) {
|
|
559
572
|
|
|
560
573
|
const self = this;
|
package/package.json
CHANGED
package/test/Account.js
CHANGED
|
@@ -107,7 +107,7 @@ describe('Account', function() {
|
|
|
107
107
|
|
|
108
108
|
it('finds by id', function(done) {
|
|
109
109
|
|
|
110
|
-
Account.getById(accountid,
|
|
110
|
+
Account.getById(accountid, function(err, account) {
|
|
111
111
|
should.not.exist(err);
|
|
112
112
|
should.exist(account);
|
|
113
113
|
account.id.should.equal(accountid);
|