@dhyasama/totem-models 8.82.0 → 8.83.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 +6 -6
- package/lib/Organization.js +138 -8
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -321,8 +321,8 @@ module.exports = function(mongoose, config) {
|
|
|
321
321
|
|
|
322
322
|
_.each(financial.snapshots, function(snapshot) {
|
|
323
323
|
|
|
324
|
-
var hasSendTo = snapshot.notifications.company.sendTo.length > 0;
|
|
325
|
-
var hasSendOnLessThanNow = snapshot.notifications.company.initial.sendOn < now;
|
|
324
|
+
var hasSendTo = snapshot.notifications.company.sendTo && snapshot.notifications.company.sendTo.length > 0;
|
|
325
|
+
var hasSendOnLessThanNow = snapshot.notifications.company.initial.sendOn && snapshot.notifications.company.initial.sendOn < now;
|
|
326
326
|
var hasSentOn = snapshot.notifications.company.initial.sentOn;
|
|
327
327
|
var hasSentToQueue = snapshot.notifications.company.initial.sentToQueue;
|
|
328
328
|
|
|
@@ -388,8 +388,8 @@ module.exports = function(mongoose, config) {
|
|
|
388
388
|
_.each(financial.snapshots, function(snapshot) {
|
|
389
389
|
|
|
390
390
|
var conditions = _.some(snapshot.notifications.company.reminders, function(reminder) {
|
|
391
|
-
var hasSendTo = snapshot.notifications.company.sendTo.length > 0;
|
|
392
|
-
var hasSendOnLessThanNow = reminder.sendOn < now;
|
|
391
|
+
var hasSendTo = snapshot.notifications.company.sendTo && snapshot.notifications.company.sendTo.length > 0;
|
|
392
|
+
var hasSendOnLessThanNow = reminder.sendOn && reminder.sendOn < now;
|
|
393
393
|
var hasSentOn = reminder.sentOn;
|
|
394
394
|
var hasSentToQueue = reminder.sentToQueue;
|
|
395
395
|
var hasBeenSubmitted = snapshot.submittedOn;
|
|
@@ -450,8 +450,8 @@ module.exports = function(mongoose, config) {
|
|
|
450
450
|
_.each(financial.snapshots, function(snapshot) {
|
|
451
451
|
|
|
452
452
|
var conditions = _.some(snapshot.notifications.company.rejections, function(rejection) {
|
|
453
|
-
var hasSendTo = snapshot.notifications.company.sendTo.length > 0;
|
|
454
|
-
var hasSendOnLessThanNow = rejection.sendOn < now;
|
|
453
|
+
var hasSendTo = snapshot.notifications.company.sendTo && snapshot.notifications.company.sendTo.length > 0;
|
|
454
|
+
var hasSendOnLessThanNow = rejection.sendOn && rejection.sendOn < now;
|
|
455
455
|
var hasSentOn = rejection.sentOn;
|
|
456
456
|
var hasSentToQueue = rejection.sentToQueue;
|
|
457
457
|
var hasBeenSubmitted = snapshot.submittedOn;
|
package/lib/Organization.js
CHANGED
|
@@ -204,6 +204,39 @@ module.exports = function(mongoose, config) {
|
|
|
204
204
|
|
|
205
205
|
portfolio: {
|
|
206
206
|
|
|
207
|
+
customFields: [{
|
|
208
|
+
|
|
209
|
+
// store the data using this key (changing it after data is in the system will make data inaccessible)
|
|
210
|
+
key: { type: String, trim: true },
|
|
211
|
+
|
|
212
|
+
// User friendly text, will be displayed
|
|
213
|
+
label: { type: String, trim: true },
|
|
214
|
+
|
|
215
|
+
// Dictates the type of control rendered on form and data validation
|
|
216
|
+
type: { type: String, enum: ['Text', 'Number', 'Checkbox', 'Single Select', 'Timestamp', 'Tags', 'Person', 'Org', 'Poll'] },
|
|
217
|
+
|
|
218
|
+
// These are the number formats
|
|
219
|
+
format: { type: String, enum: ['number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance'] },
|
|
220
|
+
|
|
221
|
+
// These will be the choices in polls, single-selects and multi-selects
|
|
222
|
+
options: [{
|
|
223
|
+
|
|
224
|
+
// This is the option shown to users
|
|
225
|
+
label: { type: String, trim: true },
|
|
226
|
+
|
|
227
|
+
// This is the value that gets stored
|
|
228
|
+
value: { type: String, trim: true },
|
|
229
|
+
|
|
230
|
+
// This is used to aggregate answers for polls
|
|
231
|
+
type: { type: String, enum: ['String', 'Number', 'Boolean'] }
|
|
232
|
+
|
|
233
|
+
}],
|
|
234
|
+
|
|
235
|
+
// Determines whether the field should be pinned to the entity page
|
|
236
|
+
pin: { type: Boolean, default: false }
|
|
237
|
+
|
|
238
|
+
}],
|
|
239
|
+
|
|
207
240
|
reports: [{
|
|
208
241
|
name: { type: String, trim: true },
|
|
209
242
|
filters: [{
|
|
@@ -272,6 +305,39 @@ module.exports = function(mongoose, config) {
|
|
|
272
305
|
required: { type: Boolean, default: false }
|
|
273
306
|
}],
|
|
274
307
|
|
|
308
|
+
customFields: [{
|
|
309
|
+
|
|
310
|
+
// store the data using this key (changing it after data is in the system will make data inaccessible)
|
|
311
|
+
key: { type: String, trim: true },
|
|
312
|
+
|
|
313
|
+
// User friendly text, will be displayed
|
|
314
|
+
label: { type: String, trim: true },
|
|
315
|
+
|
|
316
|
+
// Dictates the type of control rendered on form and data validation
|
|
317
|
+
type: { type: String, enum: ['Text', 'Number', 'Checkbox', 'Single Select', 'Timestamp', 'Tags', 'Person', 'Org', 'Poll'] },
|
|
318
|
+
|
|
319
|
+
// These are the number formats
|
|
320
|
+
format: { type: String, enum: ['number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance'] },
|
|
321
|
+
|
|
322
|
+
// These will be the choices in polls, single-selects and multi-selects
|
|
323
|
+
options: [{
|
|
324
|
+
|
|
325
|
+
// This is the option shown to users
|
|
326
|
+
label: { type: String, trim: true },
|
|
327
|
+
|
|
328
|
+
// This is the value that gets stored
|
|
329
|
+
value: { type: String, trim: true },
|
|
330
|
+
|
|
331
|
+
// This is used to aggregate answers for polls
|
|
332
|
+
type: { type: String, enum: ['String', 'Number', 'Boolean'] }
|
|
333
|
+
|
|
334
|
+
}],
|
|
335
|
+
|
|
336
|
+
// Determines whether the field should be pinned to the entity page
|
|
337
|
+
pin: { type: Boolean, default: false }
|
|
338
|
+
|
|
339
|
+
}],
|
|
340
|
+
|
|
275
341
|
reports: [{
|
|
276
342
|
name: { type: String, trim: true },
|
|
277
343
|
filters: [{
|
|
@@ -310,21 +376,16 @@ module.exports = function(mongoose, config) {
|
|
|
310
376
|
|
|
311
377
|
customFields: [{
|
|
312
378
|
|
|
313
|
-
//
|
|
314
|
-
// It must follow standard js variable naming rules
|
|
315
|
-
// Whenever possible, just use the label and replace spaces with underscore
|
|
316
|
-
// Will not be displayed
|
|
317
|
-
// Changing it after data is in the system will make data on deal inaccessible
|
|
379
|
+
// store the data using this key (changing it after data is in the system will make data inaccessible)
|
|
318
380
|
key: { type: String, trim: true },
|
|
319
381
|
|
|
320
382
|
// User friendly text, will be displayed
|
|
321
383
|
label: { type: String, trim: true },
|
|
322
384
|
|
|
323
|
-
// Dictates the type of control rendered on form
|
|
324
|
-
// Also impacts data validation
|
|
385
|
+
// Dictates the type of control rendered on form and data validation
|
|
325
386
|
type: { type: String, enum: ['Text', 'Number', 'Checkbox', 'Single Select', 'Timestamp', 'Tags', 'Person', 'Org', 'Poll'] },
|
|
326
387
|
|
|
327
|
-
//
|
|
388
|
+
// These are the number formats
|
|
328
389
|
format: { type: String, enum: ['number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance'] },
|
|
329
390
|
|
|
330
391
|
// These will be the choices in polls, single-selects and multi-selects
|
|
@@ -341,6 +402,9 @@ module.exports = function(mongoose, config) {
|
|
|
341
402
|
|
|
342
403
|
}],
|
|
343
404
|
|
|
405
|
+
// Determines whether the field should be pinned to the entity page
|
|
406
|
+
pin: { type: Boolean, default: false }
|
|
407
|
+
|
|
344
408
|
}],
|
|
345
409
|
|
|
346
410
|
reports: [{
|
|
@@ -373,6 +437,39 @@ module.exports = function(mongoose, config) {
|
|
|
373
437
|
active: { type: Boolean, default: false },
|
|
374
438
|
},
|
|
375
439
|
|
|
440
|
+
customFields: [{
|
|
441
|
+
|
|
442
|
+
// store the data using this key (changing it after data is in the system will make data inaccessible)
|
|
443
|
+
key: { type: String, trim: true },
|
|
444
|
+
|
|
445
|
+
// User friendly text, will be displayed
|
|
446
|
+
label: { type: String, trim: true },
|
|
447
|
+
|
|
448
|
+
// Dictates the type of control rendered on form and data validation
|
|
449
|
+
type: { type: String, enum: ['Text', 'Number', 'Checkbox', 'Single Select', 'Timestamp', 'Tags', 'Person', 'Org', 'Poll'] },
|
|
450
|
+
|
|
451
|
+
// These are the number formats
|
|
452
|
+
format: { type: String, enum: ['number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance'] },
|
|
453
|
+
|
|
454
|
+
// These will be the choices in polls, single-selects and multi-selects
|
|
455
|
+
options: [{
|
|
456
|
+
|
|
457
|
+
// This is the option shown to users
|
|
458
|
+
label: { type: String, trim: true },
|
|
459
|
+
|
|
460
|
+
// This is the value that gets stored
|
|
461
|
+
value: { type: String, trim: true },
|
|
462
|
+
|
|
463
|
+
// This is used to aggregate answers for polls
|
|
464
|
+
type: { type: String, enum: ['String', 'Number', 'Boolean'] }
|
|
465
|
+
|
|
466
|
+
}],
|
|
467
|
+
|
|
468
|
+
// Determines whether the field should be pinned to the entity page
|
|
469
|
+
pin: { type: Boolean, default: false }
|
|
470
|
+
|
|
471
|
+
}],
|
|
472
|
+
|
|
376
473
|
reports: [{
|
|
377
474
|
name: { type: String, trim: true },
|
|
378
475
|
filters: [{
|
|
@@ -405,6 +502,39 @@ module.exports = function(mongoose, config) {
|
|
|
405
502
|
active: { type: Boolean, default: false },
|
|
406
503
|
},
|
|
407
504
|
|
|
505
|
+
customFields: [{
|
|
506
|
+
|
|
507
|
+
// store the data using this key (changing it after data is in the system will make data inaccessible)
|
|
508
|
+
key: { type: String, trim: true },
|
|
509
|
+
|
|
510
|
+
// User friendly text, will be displayed
|
|
511
|
+
label: { type: String, trim: true },
|
|
512
|
+
|
|
513
|
+
// Dictates the type of control rendered on form and data validation
|
|
514
|
+
type: { type: String, enum: ['Text', 'Number', 'Checkbox', 'Single Select', 'Timestamp', 'Tags', 'Person', 'Org', 'Poll'] },
|
|
515
|
+
|
|
516
|
+
// These are the number formats
|
|
517
|
+
format: { type: String, enum: ['number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance'] },
|
|
518
|
+
|
|
519
|
+
// These will be the choices in polls, single-selects and multi-selects
|
|
520
|
+
options: [{
|
|
521
|
+
|
|
522
|
+
// This is the option shown to users
|
|
523
|
+
label: { type: String, trim: true },
|
|
524
|
+
|
|
525
|
+
// This is the value that gets stored
|
|
526
|
+
value: { type: String, trim: true },
|
|
527
|
+
|
|
528
|
+
// This is used to aggregate answers for polls
|
|
529
|
+
type: { type: String, enum: ['String', 'Number', 'Boolean'] }
|
|
530
|
+
|
|
531
|
+
}],
|
|
532
|
+
|
|
533
|
+
// Determines whether the field should be pinned to the entity page
|
|
534
|
+
pin: { type: Boolean, default: false }
|
|
535
|
+
|
|
536
|
+
}],
|
|
537
|
+
|
|
408
538
|
reports: [{
|
|
409
539
|
name: { type: String, trim: true },
|
|
410
540
|
filters: [{
|