@dhyasama/totem-models 7.32.0 → 7.34.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/Investment.js CHANGED
@@ -63,7 +63,8 @@ module.exports = function(mongoose, config) {
63
63
  // Catch-all for customer specific key-value pairs from sheet that aren't supported by our schema
64
64
  details: [{
65
65
  key: { type: String, trim: true, required: true },
66
- value: { type: String, trim: true, required: true },
66
+ value: { type: Schema.Types.Mixed, required: true },
67
+ format: { type: String, enum: [null, 'number', 'decimal', 'money', 'percentage', 'date']},
67
68
  _id: false
68
69
  }],
69
70
 
@@ -129,6 +130,10 @@ module.exports = function(mongoose, config) {
129
130
  };
130
131
 
131
132
  Investment.statics.upsert = function upsert(investment, cb) {
133
+
134
+ // Required for mixed types
135
+ investment.markModified('details');
136
+
132
137
  if (!investment) { return cb(new Error('investment is required'), null); }
133
138
  investment.save(cb);
134
139
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "7.32.0",
3
+ "version": "7.34.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",