@dhyasama/totem-models 8.0.8 → 8.1.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/Financials.js +15 -0
- package/lib/Organization.js +0 -2
- package/package.json +1 -1
- package/.npmignore +0 -14
package/lib/Financials.js
CHANGED
|
@@ -320,6 +320,21 @@ module.exports = function(mongoose, config) {
|
|
|
320
320
|
|
|
321
321
|
};
|
|
322
322
|
|
|
323
|
+
Financials.statics.getToSend = function getToSend(uuid, cb) {
|
|
324
|
+
|
|
325
|
+
let self = this;
|
|
326
|
+
|
|
327
|
+
let query = self.findOne({
|
|
328
|
+
'snapshots.uuid': uuid
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
query.populate('organization', 'name logoUrl');
|
|
332
|
+
query.populate('customer', 'name logoUrl customer.totemUrl');
|
|
333
|
+
|
|
334
|
+
query.exec(cb);
|
|
335
|
+
|
|
336
|
+
};
|
|
337
|
+
|
|
323
338
|
Financials.statics.getUUIDsToSendInitial = function getUUIDsToSendInitial(cb) {
|
|
324
339
|
|
|
325
340
|
let self = this;
|
package/lib/Organization.js
CHANGED
|
@@ -1344,8 +1344,6 @@ module.exports = function(mongoose, config) {
|
|
|
1344
1344
|
if (!id) { return cb(new Error('id is required'), null); }
|
|
1345
1345
|
if (!mongoose.Types.ObjectId.isValid(id)) { return cb(new Error('id is not a valid ObjectId'), null); }
|
|
1346
1346
|
if (!options) { return cb(new Error('options is required'), null); }
|
|
1347
|
-
if (!options.CUSTOMER_ID) { return cb(new Error('options.CUSTOMER_ID is required'), null); }
|
|
1348
|
-
if (!mongoose.Types.ObjectId.isValid(options.CUSTOMER_ID)) { return cb(new Error('options.CUSTOMER_ID is not a valid ObjectId'), null); }
|
|
1349
1347
|
|
|
1350
1348
|
options = helpers.getDefaultOptions(options);
|
|
1351
1349
|
|
package/package.json
CHANGED