@dhyasama/totem-models 6.30.1 → 6.30.3

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
@@ -141,11 +141,17 @@ module.exports = function(mongoose, config) {
141
141
 
142
142
  Financials.statics.removeCustomerFinancials = function removeCustomerFinancials(customerId, cb) {
143
143
 
144
+ // this is only used to wipe out financials created by the google sheet import process
145
+ // we do NOT want to delete any financials submitted via forms generated directly from the app
146
+
144
147
  var self = this;
145
148
 
146
149
  self
147
- .remove({customer: customerId})
148
- .exec(cb);
150
+ .update(
151
+ { customer: customerId },
152
+ { $pull : { snapshots: { uuid : null, submittedOn: null, submittedBy: null } } },
153
+ { multi : true }
154
+ ).exec(cb);
149
155
 
150
156
  };
151
157
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "6.30.1",
3
+ "version": "6.30.3",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",