@dhyasama/totem-models 5.10.6 → 5.10.7
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/Deal.js +3 -17
- package/lib/Organization.js +3 -0
- package/package.json +1 -1
package/lib/Deal.js
CHANGED
|
@@ -60,7 +60,9 @@ module.exports = function(mongoose, config) {
|
|
|
60
60
|
timestamp: { type: Date, required: true, default: Date.now },
|
|
61
61
|
person: { type: Schema.ObjectId, ref: 'Person', required: true },
|
|
62
62
|
value: { type: Number }
|
|
63
|
-
}]
|
|
63
|
+
}],
|
|
64
|
+
|
|
65
|
+
sectors: [{ type: String, trim: true }]
|
|
64
66
|
|
|
65
67
|
});
|
|
66
68
|
|
|
@@ -249,22 +251,6 @@ module.exports = function(mongoose, config) {
|
|
|
249
251
|
});
|
|
250
252
|
};
|
|
251
253
|
|
|
252
|
-
Deal.statics.addVote = function(dealId, personId, vote, cb) {
|
|
253
|
-
|
|
254
|
-
var self = this;
|
|
255
|
-
|
|
256
|
-
self.findByIdAndUpdate(dealId, {$push:
|
|
257
|
-
{
|
|
258
|
-
votes: {
|
|
259
|
-
timestamp: new Date(),
|
|
260
|
-
person: personId,
|
|
261
|
-
value: vote
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}, cb);
|
|
265
|
-
|
|
266
|
-
};
|
|
267
|
-
|
|
268
254
|
Deal.statics.upsert = function upsert(deal, user, cb) {
|
|
269
255
|
|
|
270
256
|
// Deal is dumb and doesn't validate customer stages or duplicate deals. That responsibility is with the org.
|
package/lib/Organization.js
CHANGED