@dhyasama/totem-models 8.41.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.
Files changed (2) hide show
  1. package/lib/CapTable.js +7 -1
  2. package/package.json +1 -1
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "8.41.0",
3
+ "version": "8.42.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",