@dhyasama/totem-models 11.47.0 → 11.48.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/Interaction.js +32 -0
- package/package.json +1 -1
package/lib/Interaction.js
CHANGED
|
@@ -125,6 +125,38 @@ module.exports = function(mongoose, config) {
|
|
|
125
125
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
+
|
|
129
|
+
Interaction.statics.getByCalendarEventId = function getByCalendarEventId(calendarEventId, cb) {
|
|
130
|
+
|
|
131
|
+
if (!cb) { throw new Error('cb is required'); }
|
|
132
|
+
if (!calendarEventId) { return cb(new Error('calendarEventId is required'), null); }
|
|
133
|
+
|
|
134
|
+
var self = this;
|
|
135
|
+
var query = self.find({ calendarEventId: calendarEventId });
|
|
136
|
+
|
|
137
|
+
query.populate('attendees.internal');
|
|
138
|
+
query.populate('attendees.external');
|
|
139
|
+
|
|
140
|
+
query.exec(cb);
|
|
141
|
+
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
Interaction.statics.getBySummaryAndStartTime = function getBySummaryAndStartTime(summary, startTime, cb) {
|
|
145
|
+
|
|
146
|
+
if (!cb) { throw new Error('cb is required'); }
|
|
147
|
+
if (!summary) { return cb(new Error('summary is required'), null); }
|
|
148
|
+
if (!startTime) { return cb(new Error('startTime is required'), null); }
|
|
149
|
+
|
|
150
|
+
var self = this;
|
|
151
|
+
var query = self.find({ summary: summary, startTime: new Date(startTime) });
|
|
152
|
+
|
|
153
|
+
query.populate('attendees.internal');
|
|
154
|
+
query.populate('attendees.external');
|
|
155
|
+
|
|
156
|
+
query.exec(cb);
|
|
157
|
+
|
|
158
|
+
};
|
|
159
|
+
|
|
128
160
|
Interaction.statics.getForCustomer = function getForCustomer(customerId, since, cb) {
|
|
129
161
|
|
|
130
162
|
if (!cb) { throw new Error('cb is required'); }
|