@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 +8 -2
- package/package.json +1 -1
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
|
-
.
|
|
148
|
-
|
|
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
|
|