@dhyasama/totem-models 8.34.0 → 8.36.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 +0 -2
- package/lib/Message.js +4 -3
- package/lib/Organization.js +15 -4
- package/package.json +1 -1
- package/test/Message.js +1 -0
package/lib/Financials.js
CHANGED
package/lib/Message.js
CHANGED
|
@@ -19,6 +19,7 @@ module.exports = function(mongoose, config) {
|
|
|
19
19
|
subtype: { type: String, required: true, enum: ['boards', 'updates', 'deals', 'portfolio'] },
|
|
20
20
|
customer: { type: Schema.ObjectId, ref: 'Organization', required: true },
|
|
21
21
|
organization: { type: Schema.ObjectId, ref: 'Organization' },
|
|
22
|
+
processed: { type: Boolean, default: false },
|
|
22
23
|
originalMessageDate: { type: Date, required: false, default: null },
|
|
23
24
|
subject: { type: String, required: false, default: null, trim: true },
|
|
24
25
|
body: { type: String, required: false, default: null, trim: true },
|
|
@@ -319,7 +320,7 @@ module.exports = function(mongoose, config) {
|
|
|
319
320
|
let query = self.find({
|
|
320
321
|
customer: customerId,
|
|
321
322
|
subtype: 'deals',
|
|
322
|
-
|
|
323
|
+
processed: { $ne: true }
|
|
323
324
|
});
|
|
324
325
|
query.populate({
|
|
325
326
|
path: 'documents',
|
|
@@ -336,7 +337,7 @@ module.exports = function(mongoose, config) {
|
|
|
336
337
|
let query = self.find({
|
|
337
338
|
customer: customerId,
|
|
338
339
|
subtype: 'portfolio',
|
|
339
|
-
|
|
340
|
+
processed: { $ne: true }
|
|
340
341
|
});
|
|
341
342
|
query.populate({
|
|
342
343
|
path: 'documents',
|
|
@@ -387,4 +388,4 @@ module.exports = function(mongoose, config) {
|
|
|
387
388
|
|
|
388
389
|
mongoose.model('Message', Message);
|
|
389
390
|
|
|
390
|
-
};
|
|
391
|
+
};
|
package/lib/Organization.js
CHANGED
|
@@ -208,7 +208,6 @@ module.exports = function(mongoose, config) {
|
|
|
208
208
|
portfolio: {
|
|
209
209
|
|
|
210
210
|
reports: [{
|
|
211
|
-
|
|
212
211
|
name: { type: String, trim: true },
|
|
213
212
|
filters: [{
|
|
214
213
|
_id: false,
|
|
@@ -220,12 +219,24 @@ module.exports = function(mongoose, config) {
|
|
|
220
219
|
reverse: { type: Boolean, default: false }
|
|
221
220
|
},
|
|
222
221
|
fields: [ {type: String, trim: true} ],
|
|
223
|
-
|
|
224
222
|
}],
|
|
225
223
|
|
|
226
|
-
financials
|
|
224
|
+
financials: {
|
|
227
225
|
active: { type: Boolean, default: false },
|
|
228
|
-
|
|
226
|
+
approval: {
|
|
227
|
+
active: { type: Boolean, default: false }
|
|
228
|
+
},
|
|
229
|
+
reminders: {
|
|
230
|
+
active: { type: Boolean, default: false },
|
|
231
|
+
frequency: { type: Number, default: 7 },
|
|
232
|
+
occurences: { type: Number, default: 3 },
|
|
233
|
+
},
|
|
234
|
+
documents: [{
|
|
235
|
+
_id: false,
|
|
236
|
+
name: { type: String, trim: true },
|
|
237
|
+
description: { type: String, trim: true },
|
|
238
|
+
required: { type: Boolean, default: false }
|
|
239
|
+
}],
|
|
229
240
|
metrics: [{
|
|
230
241
|
_id: false,
|
|
231
242
|
name: { type: String, trim: true },
|
package/package.json
CHANGED