@dhyasama/totem-models 11.27.0 → 11.29.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/Document.js CHANGED
@@ -168,16 +168,19 @@ module.exports = function(mongoose, config) {
168
168
  if (!id) { return cb(new Error('id is required'), null); }
169
169
  if (!mongoose.Types.ObjectId.isValid(id)) { return cb(new Error('id is not a valid ObjectId'), null); }
170
170
  if (!options) { return cb(new Error('options is required'), null); }
171
- if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
172
- if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
173
171
 
174
- let query = self.findOne({
175
- '_id': id,
176
- 'customer': options.CUSTOMER_ID
177
- });
172
+ if (!options.isWorkerProcess) {
173
+ if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
174
+ if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
175
+ }
178
176
 
179
- // No population so no need to scrub
177
+ let queryOptions = { '_id': id };
178
+
179
+ if (!options.isWorkerProcess) {
180
+ queryOptions.customer = options.CUSTOMER_ID;
181
+ }
180
182
 
183
+ let query = this.findOne(queryOptions);
181
184
  query.exec(cb);
182
185
 
183
186
  };
@@ -230,6 +230,7 @@ module.exports = function(mongoose, config) {
230
230
  sheet: {
231
231
  id: { type: String, trim: true, unique: true, partialFilterExpression : { type :"string" } },
232
232
  format: {
233
+ transformInvested: { type: Boolean, default: false },
233
234
  transformRounds: { type: Boolean, default: false },
234
235
  transformUnrealized: { type: Boolean, default: false },
235
236
  transformRealized: { type: Boolean, default: false }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "11.27.0",
3
+ "version": "11.29.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",