@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 +10 -7
- package/lib/Organization.js +1 -0
- package/package.json +1 -1
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
|
-
|
|
175
|
-
'
|
|
176
|
-
|
|
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
|
-
|
|
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
|
};
|
package/lib/Organization.js
CHANGED
|
@@ -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 }
|