@dhyasama/totem-models 5.1.1 → 5.1.3
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 +8 -8
- package/lib/Organization.js +2 -1
- package/package.json +1 -1
- package/.npmignore +0 -14
- package/package-lock.json +0 -1854
package/lib/Deal.js
CHANGED
|
@@ -45,7 +45,7 @@ module.exports = function(mongoose, config) {
|
|
|
45
45
|
}],
|
|
46
46
|
|
|
47
47
|
history: [{
|
|
48
|
-
timestamp: { type:
|
|
48
|
+
timestamp: { type: Date, required: true, default: Date.now },
|
|
49
49
|
account: { type: Schema.ObjectId, ref: 'Account', required: true },
|
|
50
50
|
stage: { type: String, required: true },
|
|
51
51
|
description: { type: String, trim: true, required: true }
|
|
@@ -128,13 +128,13 @@ module.exports = function(mongoose, config) {
|
|
|
128
128
|
|
|
129
129
|
self
|
|
130
130
|
.find({ 'customer': customerId })
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
131
|
+
.populate('organization', 'name logoUrl website websiteAliases')
|
|
132
|
+
.populate('messages')
|
|
133
|
+
.populate('sources.person', 'name avatarUrl')
|
|
134
|
+
.populate({
|
|
135
|
+
path: 'documents',
|
|
136
|
+
match: { customer: customerId }
|
|
137
|
+
})
|
|
138
138
|
.exec(cb);
|
|
139
139
|
|
|
140
140
|
};
|
package/lib/Organization.js
CHANGED
|
@@ -584,7 +584,8 @@ module.exports = function(mongoose, config) {
|
|
|
584
584
|
|
|
585
585
|
// Check if this deal already exists
|
|
586
586
|
var dealMatch = _.find(self.deals, function(d) {
|
|
587
|
-
|
|
587
|
+
var did = d._id ? d._id.toString() : d;
|
|
588
|
+
return did === deal._id.toString();
|
|
588
589
|
});
|
|
589
590
|
|
|
590
591
|
// Update the deal
|
package/package.json
CHANGED