@dhyasama/totem-models 8.40.0 → 8.42.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/CapTable.js CHANGED
@@ -240,7 +240,7 @@ module.exports = function(mongoose, config) {
240
240
 
241
241
  CapTable.statics.deleteAllForCustomer = function(customerId, cb) {
242
242
  var self = this;
243
- self.remove({ customer: customerId }, cb);
243
+ self.remove({ customer: customerId, 'entered.by': { $ne: 'carta-parser' } }, cb);
244
244
  };
245
245
 
246
246
  CapTable.statics.getAllForCustomer = function getAllForCustomer(customerId, cb) {
@@ -354,7 +354,13 @@ module.exports = function(mongoose, config) {
354
354
 
355
355
  };
356
356
 
357
+ CapTable.statics.upsert = function upsert(capTable, cb) {
357
358
 
359
+ if (!capTable) { return cb(new Error('cap table is required'), null); }
360
+
361
+ capTable.save(cb);
362
+
363
+ }
358
364
 
359
365
  ///////////////////////////////////////////////////////////////////////////////////////
360
366
  // HOOKS
@@ -225,10 +225,7 @@ module.exports = function(mongoose, config) {
225
225
  active: { type: Boolean, default: false },
226
226
  managedServices: { type: Boolean, default: false },
227
227
  greeting: { type: String, trim: true },
228
- reminders: {
229
- frequency: { type: Number, default: 7 },
230
- occurences: { type: Number, default: 3 },
231
- },
228
+ reminders: { type: [Number], default: [7, 7, 7] },
232
229
  documents: [{
233
230
  _id: false,
234
231
  name: { type: String, trim: true },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "8.40.0",
3
+ "version": "8.42.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",