@dhyasama/totem-models 11.52.0 → 11.54.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/Financials.js CHANGED
@@ -24,6 +24,11 @@ module.exports = function(mongoose, config) {
24
24
  day: { type: Number, default: 1 },
25
25
  },
26
26
 
27
+ pins: [{
28
+ name: { type: String, trim: true },
29
+ type: { type: String, enum: [null, 'document', 'metric', 'question'] },
30
+ }],
31
+
27
32
  recurring: {
28
33
  template: { type: String, trim: true },
29
34
  email: { type: String, trim: true },
@@ -494,9 +494,12 @@ module.exports = function(mongoose, config) {
494
494
  if (!personId) { return cb(new Error('personId is required'), null); }
495
495
  if (!mongoose.Types.ObjectId.isValid(personId)) { return cb(new Error('personId is not a valid ObjectId'), null); }
496
496
  if (!options) { return cb(new Error('options is required'), null); }
497
- if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
498
- if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
499
497
 
498
+ if (!options.isWorkerProcess) {
499
+ if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
500
+ if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
501
+ }
502
+
500
503
  options = helpers.getDefaultOptions(options);
501
504
 
502
505
  let query;
@@ -526,8 +529,11 @@ module.exports = function(mongoose, config) {
526
529
  if (!cb) { throw new Error('cb is required'); }
527
530
  if (!personIds) { return cb(new Error('personIds is required'), null); }
528
531
  if (!options) { return cb(new Error('options is required'), null); }
529
- if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
530
- if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
532
+
533
+ if (!options.isWorkerProcess) {
534
+ if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
535
+ if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
536
+ }
531
537
 
532
538
  options = helpers.getDefaultOptions(options);
533
539
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "11.52.0",
3
+ "version": "11.54.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",