@dhyasama/totem-models 8.52.0 → 8.53.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.
@@ -91,7 +91,15 @@ module.exports = function(mongoose, config) {
91
91
 
92
92
  flags: [ { type: Schema.ObjectId, ref: 'Flag' } ],
93
93
 
94
- notes: [ { type: Schema.ObjectId, ref: 'Note' } ]
94
+ notes: [ { type: Schema.ObjectId, ref: 'Note' } ],
95
+
96
+ // Catch-all for customer specific key-value pairs from sheet that aren't supported by our schema
97
+ details: [{
98
+ key: { type: String, trim: true, required: true },
99
+ value: { type: Schema.Types.Mixed, required: true },
100
+ format: { type: String, enum: [null, 'number', 'decimal', 'money', 'percentage', 'date']},
101
+ _id: false
102
+ }]
95
103
 
96
104
  });
97
105
 
@@ -715,6 +723,9 @@ module.exports = function(mongoose, config) {
715
723
  lp.entered.by = username;
716
724
  lp.entered.on = new Date();
717
725
 
726
+ // Required for mixed types
727
+ lp.markModified('details');
728
+
718
729
  lp.extendWithWriteFilter(lp, options.role);
719
730
  lp.save(function(err, result) {
720
731
  if (err) return cb(err, null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "8.52.0",
3
+ "version": "8.53.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",