@dhyasama/totem-models 11.4.0 → 11.5.1

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.
@@ -196,13 +196,13 @@ module.exports = function(mongoose, config) {
196
196
  if (!mongoose.Types.ObjectId.isValid(customerId)) { return cb(new Error('customerId is not a valid ObjectId'), null); }
197
197
 
198
198
  const self = this;
199
- const startDate = options.startDate || moment().subtract(20, 'years').startOf('day').toISOString();
200
- const endDate = options.endDate || moment().toISOString();
199
+ const startDate = options.startDate ? moment(options.startDate).toDate() : moment().subtract(20, 'years').startOf('day').toDate();
200
+ const endDate = options.endDate ? moment(options.endDate).toDate() : new Date();
201
201
 
202
202
  self.aggregate([
203
203
  {
204
204
  $match: {
205
- totemCustomerId: customerId,
205
+ totemCustomerId: mongoose.Types.ObjectId(customerId),
206
206
  startTime: {
207
207
  $gte: startDate,
208
208
  $lte: endDate
package/lib/Round.js CHANGED
@@ -628,7 +628,7 @@ module.exports = function(mongoose, config) {
628
628
  let query = self.find({ 'vehicles.fund': { $in: fundIds } });
629
629
 
630
630
  query.select('organization');
631
- query.populate('organization', 'name people');
631
+ query.populate('organization', 'name people website');
632
632
 
633
633
  query.exec(function(err, rounds) {
634
634
 
@@ -650,6 +650,7 @@ module.exports = function(mongoose, config) {
650
650
  portfolio.push({
651
651
  _id: rounds[0].organization._id,
652
652
  name: rounds[0].organization.name,
653
+ website: rounds[0].organization.website,
653
654
  people: rounds[0].organization.people
654
655
  });
655
656
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "11.4.0",
3
+ "version": "11.5.1",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",
@@ -20,17 +20,17 @@
20
20
  "awesome-phonenumber": "^1.0.14",
21
21
  "bluebird": "^3.7.2",
22
22
  "escape-string-regexp": "^1.0.5",
23
- "moment": "^2.29.4",
23
+ "moment": "^2.30.1",
24
24
  "mongoose-deep-populate": "^3.2.0",
25
25
  "range_check": "^1.4.0",
26
26
  "request": "^2.88.0",
27
27
  "underscore": "^1.13.6",
28
- "validator": "^13.7.0"
28
+ "validator": "^13.11.0"
29
29
  },
30
30
  "devDependencies": {
31
- "mocha": "^10.2.0",
31
+ "mocha": "^10.3.0",
32
32
  "mocha-mongoose": "^1.2.0",
33
- "mongoose": "^5.13.17",
33
+ "mongoose": "^5.13.22",
34
34
  "should": "^11.1.1"
35
35
  }
36
36
  }