@dhyasama/totem-models 1.25.4 → 1.25.5
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/Person.js +2 -15
- package/package.json +1 -1
package/lib/Person.js
CHANGED
|
@@ -141,10 +141,7 @@ module.exports = function(mongoose, config) {
|
|
|
141
141
|
},
|
|
142
142
|
notes: [ { type: Schema.ObjectId, ref: 'Note' } ]
|
|
143
143
|
}
|
|
144
|
-
]
|
|
145
|
-
|
|
146
|
-
// used for hiding non-people from the views (e.g. conference rooms that were created as people)
|
|
147
|
-
doNotDisplay: { type: Boolean, default: false }
|
|
144
|
+
]
|
|
148
145
|
|
|
149
146
|
});
|
|
150
147
|
|
|
@@ -1018,8 +1015,6 @@ module.exports = function(mongoose, config) {
|
|
|
1018
1015
|
on: new Date()
|
|
1019
1016
|
};
|
|
1020
1017
|
|
|
1021
|
-
console.log('Person.upsert -', currentPerson._id.toString(), currentPerson.entered.by, currentPerson.entered.by);
|
|
1022
|
-
|
|
1023
1018
|
currentPerson.save(cb);
|
|
1024
1019
|
|
|
1025
1020
|
};
|
|
@@ -1168,8 +1163,6 @@ module.exports = function(mongoose, config) {
|
|
|
1168
1163
|
source.interactions.calendar = 0;
|
|
1169
1164
|
});
|
|
1170
1165
|
|
|
1171
|
-
console.log('Person.pre-save (1) -', self._id.toString(), self.calendarEventSummaries.length, self.sources.length);
|
|
1172
|
-
|
|
1173
1166
|
_.each(self.calendarEventSummaries, function(ces) {
|
|
1174
1167
|
|
|
1175
1168
|
var customerId = ces.totemCustomerId;
|
|
@@ -1203,22 +1196,16 @@ module.exports = function(mongoose, config) {
|
|
|
1203
1196
|
|
|
1204
1197
|
});
|
|
1205
1198
|
|
|
1206
|
-
console.log('Person.pre-save (2) -', self._id.toString(), self.calendarEventSummaries.length, self.sources.length);
|
|
1207
|
-
|
|
1208
1199
|
// must have person and customer refs
|
|
1209
1200
|
self.sources = _.reject(self.sources, function(source) {
|
|
1210
1201
|
return !source.person || !source.customer;
|
|
1211
1202
|
});
|
|
1212
1203
|
|
|
1213
|
-
console.log('Person.pre-save (3) -', self._id.toString(), self.calendarEventSummaries.length, self.sources.length);
|
|
1214
|
-
|
|
1215
1204
|
// dedupe
|
|
1216
1205
|
self.sources = _.uniq(self.sources, function(source) {
|
|
1217
|
-
return source.person.toString()
|
|
1206
|
+
return source.person.toString() + source.customer.toString();
|
|
1218
1207
|
});
|
|
1219
1208
|
|
|
1220
|
-
console.log('Person.pre-save (4) -', self._id.toString(), self.calendarEventSummaries.length, self.sources.length);
|
|
1221
|
-
|
|
1222
1209
|
next();
|
|
1223
1210
|
|
|
1224
1211
|
});
|