@dhyasama/totem-models 11.17.0 → 11.18.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/CapTable.js +13 -3
- package/package.json +1 -1
package/lib/CapTable.js
CHANGED
|
@@ -149,10 +149,20 @@ module.exports = function(mongoose, config) {
|
|
|
149
149
|
customer: customerid,
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
+
if (options.startDate) {
|
|
153
|
+
var startDate = options.startDate || moment().subtract(20, 'years').startOf('day').toISOString();
|
|
154
|
+
query.where('asOfDate').gte(startDate);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (options.endDate) {
|
|
158
|
+
var endDate = options.endDate || moment().toISOString();
|
|
159
|
+
query.where('asOfDate').lte(endDate);
|
|
160
|
+
}
|
|
161
|
+
|
|
152
162
|
query.populate('organization', 'name logoUrl');
|
|
153
|
-
query.populate('stakeholders.lp', 'name')
|
|
154
|
-
query.populate('stakeholders.org', 'name logoUrl')
|
|
155
|
-
query.populate('stakeholders.person', 'name avatarUrl title')
|
|
163
|
+
query.populate('stakeholders.lp', 'name');
|
|
164
|
+
query.populate('stakeholders.org', 'name logoUrl');
|
|
165
|
+
query.populate('stakeholders.person', 'name avatarUrl title');
|
|
156
166
|
|
|
157
167
|
query.exec(cb);
|
|
158
168
|
|