@dhyasama/totem-models 11.45.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 +40 -0
- package/package.json +1 -1
package/lib/Interaction.js
CHANGED
|
@@ -24,6 +24,14 @@ module.exports = function(mongoose, config) {
|
|
|
24
24
|
},
|
|
25
25
|
notes: [ { type: Schema.ObjectId, ref: 'Note' } ],
|
|
26
26
|
documents: [ { type: Schema.ObjectId, ref: 'Document' } ],
|
|
27
|
+
transcript: { type: String, required: false, default: null, trim: true },
|
|
28
|
+
analysis: {
|
|
29
|
+
summary: { type: String },
|
|
30
|
+
insights: [{
|
|
31
|
+
text: { type: String },
|
|
32
|
+
category: { type: String, enum: ['highlight', 'lowlight', 'goal', 'ask'] }
|
|
33
|
+
}]
|
|
34
|
+
},
|
|
27
35
|
|
|
28
36
|
// handy for querying data that was updated on a recent pull
|
|
29
37
|
updatedOn: { type: Date, default: Date.now }
|
|
@@ -117,6 +125,38 @@ module.exports = function(mongoose, config) {
|
|
|
117
125
|
|
|
118
126
|
};
|
|
119
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
|
+
|
|
120
160
|
Interaction.statics.getForCustomer = function getForCustomer(customerId, since, cb) {
|
|
121
161
|
|
|
122
162
|
if (!cb) { throw new Error('cb is required'); }
|