@dhyasama/totem-models 10.57.2 → 10.58.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/Financials.js +11 -0
  2. package/package.json +1 -1
package/lib/Financials.js CHANGED
@@ -238,6 +238,17 @@ module.exports = function(mongoose, config) {
238
238
  // Statics operate on the entire collection
239
239
  //////////////////////////////////////////////////////
240
240
 
241
+ Financials.statics.addMetrics = function updateProperty(snapshotUUID, metrics, cb) {
242
+
243
+ const self = this;
244
+ const filter = { 'snapshots.uuid': snapshotUUID };
245
+ const update = { '$push': { 'snapshots.$.metrics': { $each: metrics } } };
246
+ const options = { 'upsert': false, 'new': true };
247
+
248
+ self.updateOne(filter, update, options, cb);
249
+
250
+ };
251
+
241
252
  Financials.statics.getAll = function getAll(options, cb) {
242
253
 
243
254
  const self = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "10.57.2",
3
+ "version": "10.58.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",