@dhyasama/totem-models 5.11.2 → 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.
- package/lib/Interaction.js +3 -2
- package/lib/LimitedPartner.js +3 -2
- package/lib/Message.js +3 -2
- package/lib/Note.js +2 -0
- package/lib/Organization.js +5 -2
- package/lib/Person.js +3 -2
- package/package.json +1 -1
- package/test/Organization.js +1 -1
- package/test/Person.js +1 -1
package/lib/Interaction.js
CHANGED
|
@@ -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
|
};
|
package/lib/LimitedPartner.js
CHANGED
|
@@ -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
|
});
|
package/lib/Organization.js
CHANGED
|
@@ -227,6 +227,8 @@ module.exports = function(mongoose, config) {
|
|
|
227
227
|
|
|
228
228
|
customFields: [{
|
|
229
229
|
|
|
230
|
+
custom: { type: Boolean },
|
|
231
|
+
|
|
230
232
|
// Data stored on deals will be accessed with this key
|
|
231
233
|
// It must follow standard js variable naming rules
|
|
232
234
|
// Whenever possible, just use the label and replace spaces with underscore
|
|
@@ -816,11 +818,12 @@ module.exports = function(mongoose, config) {
|
|
|
816
818
|
|
|
817
819
|
};
|
|
818
820
|
|
|
819
|
-
Organization.statics.addNote = function(organizationId, creatorPersonId, text, cb) {
|
|
821
|
+
Organization.statics.addNote = function(organizationId, creatorPersonId, text, isPrivate, cb) {
|
|
820
822
|
|
|
821
823
|
Note.createForModel({
|
|
822
824
|
createdBy: creatorPersonId,
|
|
823
|
-
text: text
|
|
825
|
+
text: text,
|
|
826
|
+
isPrivate: isPrivate
|
|
824
827
|
}, this, organizationId, cb);
|
|
825
828
|
|
|
826
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
package/test/Organization.js
CHANGED
|
@@ -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);
|