@dhyasama/totem-models 5.11.1 → 6.0.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.
@@ -30,11 +30,12 @@ module.exports = function(mongoose, config) {
30
30
 
31
31
  ///////////////////////////////////////
32
32
 
33
- Interaction.statics.addNote = function(interactionId, creatorPersonId, text, cb) {
33
+ Interaction.statics.addNote = function(interactionId, creatorPersonId, text, isPrivate, cb) {
34
34
 
35
35
  Note.createForModel({
36
36
  createdBy: creatorPersonId,
37
- text: text
37
+ text: text,
38
+ isPrivate: isPrivate
38
39
  }, this, interactionId, cb);
39
40
 
40
41
  };
@@ -742,11 +742,12 @@ module.exports = function(mongoose, config) {
742
742
 
743
743
  };
744
744
 
745
- LimitedPartner.statics.addNote = function(lpid, creatorPersonId, text, cb) {
745
+ LimitedPartner.statics.addNote = function(lpid, creatorPersonId, text, isPrivate, cb) {
746
746
 
747
747
  Note.createForModel({
748
748
  createdBy: creatorPersonId,
749
- text: text
749
+ text: text,
750
+ isPrivate: isPrivate
750
751
  }, this, lpid, cb);
751
752
 
752
753
  };
package/lib/Message.js CHANGED
@@ -56,11 +56,12 @@ module.exports = function(mongoose, config) {
56
56
 
57
57
  };
58
58
 
59
- Message.statics.addNote = function(messageId, creatorPersonId, text, cb) {
59
+ Message.statics.addNote = function(messageId, creatorPersonId, text, isPrivate, cb) {
60
60
 
61
61
  Note.createForModel({
62
62
  createdBy: creatorPersonId,
63
- text: text
63
+ text: text,
64
+ isPrivate: isPrivate
64
65
  }, this, messageId, cb);
65
66
 
66
67
  };
package/lib/Note.js CHANGED
@@ -19,6 +19,8 @@ module.exports = function(mongoose, config) {
19
19
 
20
20
  createdBy: { type: Schema.ObjectId, ref: 'Person', index: false, required: true },
21
21
 
22
+ isPrivate: { type: Boolean, default: false },
23
+
22
24
  text: { type: String, index: false, required: true, trim: true }
23
25
 
24
26
  });
@@ -227,10 +227,19 @@ module.exports = function(mongoose, config) {
227
227
 
228
228
  customFields: [{
229
229
 
230
+ custom: { type: Boolean },
231
+
232
+ // Data stored on deals will be accessed with this key
233
+ // It must follow standard js variable naming rules
234
+ // Whenever possible, just use the label and replace spaces with underscore
235
+ // Will not be displayed
230
236
  permanentKey: { type: String, trim: true, required: true },
231
237
 
238
+ // User friendly text, will be displayed
232
239
  label: { type: String, trim: true, required: true },
233
240
 
241
+ // Dictates the type of control rendered on form
242
+ // Also impacts data validation
234
243
  type: { type: String, enum: ['Text', 'Checkbox', 'Single select', 'Multiple select'], required: true },
235
244
 
236
245
  // These will be the values in single- and multi-selects
@@ -809,11 +818,12 @@ module.exports = function(mongoose, config) {
809
818
 
810
819
  };
811
820
 
812
- Organization.statics.addNote = function(organizationId, creatorPersonId, text, cb) {
821
+ Organization.statics.addNote = function(organizationId, creatorPersonId, text, isPrivate, cb) {
813
822
 
814
823
  Note.createForModel({
815
824
  createdBy: creatorPersonId,
816
- text: text
825
+ text: text,
826
+ isPrivate: isPrivate
817
827
  }, this, organizationId, cb);
818
828
 
819
829
  };
package/lib/Person.js CHANGED
@@ -1061,11 +1061,12 @@ module.exports = function(mongoose, config) {
1061
1061
 
1062
1062
  };
1063
1063
 
1064
- Person.statics.addNote = function(personId, creatorPersonId, text, cb) {
1064
+ Person.statics.addNote = function(personId, creatorPersonId, text, isPrivate, cb) {
1065
1065
 
1066
1066
  Note.createForModel({
1067
1067
  createdBy: creatorPersonId,
1068
- text: text
1068
+ text: text,
1069
+ isPrivate: isPrivate
1069
1070
  }, this, personId, cb);
1070
1071
 
1071
1072
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "5.11.1",
3
+ "version": "6.0.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",
@@ -879,7 +879,7 @@ describe('Organization', function() {
879
879
 
880
880
  it('adds a note', function (done) {
881
881
 
882
- Organization.addNote(org4.id, person._id, 'Sweet note bro!', function (err, result) {
882
+ Organization.addNote(org4.id, person._id, 'Sweet note bro!', false, function (err, result) {
883
883
 
884
884
  should.not.exist(err);
885
885
  should.exist(result);
package/test/Person.js CHANGED
@@ -836,7 +836,7 @@ describe('Person', function() {
836
836
 
837
837
  it('adds a note to a person', function(done) {
838
838
 
839
- Person.addNote(person2.id, person3.id, 'Sweet note bro!', function(err, result) {
839
+ Person.addNote(person2.id, person3.id, 'Sweet note bro!', false, function(err, result) {
840
840
 
841
841
  should.not.exist(err);
842
842
  should.exist(result);