@dhyasama/totem-models 8.19.0 → 8.20.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/Financials.js +8 -2
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -150,11 +150,16 @@ module.exports = function(mongoose, config) {
|
|
|
150
150
|
},
|
|
151
151
|
|
|
152
152
|
share: {
|
|
153
|
+
|
|
153
154
|
recipients: [{
|
|
154
|
-
|
|
155
|
+
sendTo: { type: String, trim: true },
|
|
156
|
+
sendOn: { type: Date, required: false },
|
|
157
|
+
sentOn: { type: Date, required: false },
|
|
158
|
+
organization: { type: Schema.ObjectId, ref: 'Organization' },
|
|
155
159
|
postmarkMessageId: { type: String, trim: true },
|
|
156
160
|
status: { type: String, enum: [null, 'Sent', 'Bounced', 'Delivered', 'Opened', 'Clicked']}
|
|
157
161
|
}]
|
|
162
|
+
|
|
158
163
|
}
|
|
159
164
|
|
|
160
165
|
}
|
|
@@ -219,6 +224,7 @@ module.exports = function(mongoose, config) {
|
|
|
219
224
|
|
|
220
225
|
query.populate('organization', 'name logoUrl');
|
|
221
226
|
query.populate('customer');
|
|
227
|
+
query.populate('snapshots.documents');
|
|
222
228
|
|
|
223
229
|
query.exec(function (err, result) {
|
|
224
230
|
|
|
@@ -235,7 +241,7 @@ module.exports = function(mongoose, config) {
|
|
|
235
241
|
_.each(result.snapshots, function (snapshot) {
|
|
236
242
|
|
|
237
243
|
snapshot.documents = _.filter(snapshot.documents, function (document) {
|
|
238
|
-
return document.customer
|
|
244
|
+
return document.customer.toString() === result.customer._id.toString();
|
|
239
245
|
});
|
|
240
246
|
|
|
241
247
|
});
|