@dhyasama/totem-models 8.0.9 → 8.1.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/Account.js CHANGED
@@ -98,7 +98,7 @@ module.exports = function(mongoose, config) {
98
98
  });
99
99
  };
100
100
 
101
- Account.statics.getById = function (id, cb) {
101
+ Account.statics.getById = function (id, options, cb) {
102
102
 
103
103
  const self = this;
104
104
 
package/lib/Deal.js CHANGED
@@ -349,8 +349,6 @@ module.exports = function(mongoose, config) {
349
349
  if (!deal) { return cb(new Error('deal is required'), null); }
350
350
  if (!options) { return cb(new Error('options is required'), null); }
351
351
  if (!options.account) { return cb(new Error('options.account is required'), null); }
352
- if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
353
- if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
354
352
 
355
353
  let getLastStage = function() {
356
354
 
package/lib/Financials.js CHANGED
@@ -320,6 +320,21 @@ module.exports = function(mongoose, config) {
320
320
 
321
321
  };
322
322
 
323
+ Financials.statics.getToSend = function getToSend(uuid, cb) {
324
+
325
+ let self = this;
326
+
327
+ let query = self.findOne({
328
+ 'snapshots.uuid': uuid
329
+ });
330
+
331
+ query.populate('organization', 'name logoUrl');
332
+ query.populate('customer', 'name logoUrl customer.totemUrl');
333
+
334
+ query.exec(cb);
335
+
336
+ };
337
+
323
338
  Financials.statics.getUUIDsToSendInitial = function getUUIDsToSendInitial(cb) {
324
339
 
325
340
  let self = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "8.0.9",
3
+ "version": "8.1.1",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",
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, function(err, account) {
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);
package/.npmignore DELETED
@@ -1,14 +0,0 @@
1
- lib-cov
2
- *.seed
3
- *.log
4
- *.csv
5
- *.dat
6
- *.out
7
- *.pid
8
- *.gz
9
-
10
- npm-debug.log
11
- node_modules
12
-
13
- .DS_Store
14
- .idea