@dhyasama/totem-models 8.5.4 → 8.6.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/Account.js +1 -1
- package/lib/Activity.js +1 -0
- package/lib/CalendarEvent.js +1 -0
- package/lib/CapTable.js +1 -0
- package/lib/Deal.js +1 -0
- package/lib/Document.js +1 -0
- package/lib/Financials.js +1 -0
- package/lib/Flag.js +1 -0
- package/lib/Fund.js +1 -0
- package/lib/Interaction.js +3 -2
- package/lib/Investment.js +1 -0
- package/lib/LimitedPartner.js +1 -0
- package/lib/List.js +1 -0
- package/lib/Message.js +3 -2
- package/lib/News.js +1 -0
- package/lib/Note.js +1 -0
- package/lib/Organization.js +3 -2
- package/lib/Person.js +3 -2
- package/lib/Round.js +1 -0
- package/lib/Snapshot.js +2 -0
- package/lib/Sync.js +1 -0
- package/lib/Webhook.js +1 -0
- package/package.json +3 -3
- package/test/CapTable.js +8 -8
- package/test/Investment.js +8 -8
- package/test/Round.js +8 -8
package/lib/Account.js
CHANGED
package/lib/Activity.js
CHANGED
package/lib/CalendarEvent.js
CHANGED
|
@@ -177,6 +177,7 @@ module.exports = function(mongoose, config) {
|
|
|
177
177
|
};
|
|
178
178
|
|
|
179
179
|
|
|
180
|
+
CalendarEvent.set('usePushEach', true);
|
|
180
181
|
CalendarEvent.set('autoIndex', false);
|
|
181
182
|
CalendarEvent.on('index', function(err) { console.log('error building calendar event indexes: ' + err); });
|
|
182
183
|
|
package/lib/CapTable.js
CHANGED
|
@@ -418,6 +418,7 @@ module.exports = function(mongoose, config) {
|
|
|
418
418
|
// CONFIG
|
|
419
419
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
420
420
|
|
|
421
|
+
CapTable.set('usePushEach', true);
|
|
421
422
|
CapTable.set('toJSON', { virtuals: true });
|
|
422
423
|
CapTable.set('autoIndex', false);
|
|
423
424
|
|
package/lib/Deal.js
CHANGED
|
@@ -450,6 +450,7 @@ module.exports = function(mongoose, config) {
|
|
|
450
450
|
|
|
451
451
|
Deal.set('toJSON', { virtuals: true });
|
|
452
452
|
Deal.set('autoIndex', false);
|
|
453
|
+
Deal.set('usePushEach', true);
|
|
453
454
|
|
|
454
455
|
Deal.on('index', function(err) { console.log('error building deal indexes: ' + err); });
|
|
455
456
|
|
package/lib/Document.js
CHANGED
|
@@ -202,6 +202,7 @@ module.exports = function(mongoose, config) {
|
|
|
202
202
|
// CONFIG
|
|
203
203
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
204
204
|
|
|
205
|
+
Document.set('usePushEach', true);
|
|
205
206
|
Document.set('toJSON', { virtuals: true });
|
|
206
207
|
Document.set('autoIndex', false);
|
|
207
208
|
Document.on('index', function(err) { console.log('error building document indexes: ' + err); });
|
package/lib/Financials.js
CHANGED
|
@@ -523,6 +523,7 @@ module.exports = function(mongoose, config) {
|
|
|
523
523
|
// CONFIG
|
|
524
524
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
525
525
|
|
|
526
|
+
Financials.set('usePushEach', true);
|
|
526
527
|
Financials.set('toJSON', { virtuals: true });
|
|
527
528
|
Financials.set('autoIndex', false);
|
|
528
529
|
|
package/lib/Flag.js
CHANGED
|
@@ -118,6 +118,7 @@ module.exports = function(mongoose, config) {
|
|
|
118
118
|
self.text = querystring.unescape(self.text);
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
+
Flag.set('usePushEach', true);
|
|
121
122
|
Flag.set('autoIndex', false);
|
|
122
123
|
Flag.on('index', function(err) { console.log('error building Flag indexes: ' + err); });
|
|
123
124
|
|
package/lib/Fund.js
CHANGED
package/lib/Interaction.js
CHANGED
|
@@ -62,7 +62,7 @@ module.exports = function(mongoose, config) {
|
|
|
62
62
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
Interaction.statics.deleteNote = function(noteId, cb) {
|
|
65
|
+
Interaction.statics.deleteNote = function(noteId, customerId, cb) {
|
|
66
66
|
|
|
67
67
|
// Delete the note itself along with any references
|
|
68
68
|
|
|
@@ -79,7 +79,7 @@ module.exports = function(mongoose, config) {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
async.series([
|
|
82
|
-
Note.delete.bind(Note, noteId),
|
|
82
|
+
Note.delete.bind(Note, noteId, customerId),
|
|
83
83
|
removeReferences
|
|
84
84
|
], function(err, results) {
|
|
85
85
|
return cb(err, null);
|
|
@@ -269,6 +269,7 @@ module.exports = function(mongoose, config) {
|
|
|
269
269
|
|
|
270
270
|
};
|
|
271
271
|
|
|
272
|
+
Interaction.set('usePushEach', true);
|
|
272
273
|
Interaction.set('autoIndex', false);
|
|
273
274
|
Interaction.on('index', function(err) { console.log('error building interaction indexes: ' + err); });
|
|
274
275
|
|
package/lib/Investment.js
CHANGED
|
@@ -170,6 +170,7 @@ module.exports = function(mongoose, config) {
|
|
|
170
170
|
// CONFIG
|
|
171
171
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
172
172
|
|
|
173
|
+
Investment.set('usePushEach', true);
|
|
173
174
|
Investment.set('toJSON', { virtuals: true });
|
|
174
175
|
Investment.set('autoIndex', false);
|
|
175
176
|
|
package/lib/LimitedPartner.js
CHANGED
|
@@ -720,6 +720,7 @@ module.exports = function(mongoose, config) {
|
|
|
720
720
|
|
|
721
721
|
//////////////////////////////
|
|
722
722
|
|
|
723
|
+
LimitedPartner.set('usePushEach', true);
|
|
723
724
|
LimitedPartner.set('autoIndex', false);
|
|
724
725
|
LimitedPartner.on('index', function(err) { console.log('error building limited partner indexes: ' + err); });
|
|
725
726
|
|
package/lib/List.js
CHANGED
package/lib/Message.js
CHANGED
|
@@ -96,7 +96,7 @@ module.exports = function(mongoose, config) {
|
|
|
96
96
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
Message.statics.deleteNote = function(noteId, cb) {
|
|
99
|
+
Message.statics.deleteNote = function(noteId, customerId, cb) {
|
|
100
100
|
|
|
101
101
|
// Delete the note itself along with any references
|
|
102
102
|
|
|
@@ -109,7 +109,7 @@ module.exports = function(mongoose, config) {
|
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
async.series([
|
|
112
|
-
Note.delete.bind(Note, noteId),
|
|
112
|
+
Note.delete.bind(Note, noteId, customerId),
|
|
113
113
|
removeReferences
|
|
114
114
|
], function(err, results) {
|
|
115
115
|
return cb(err, null);
|
|
@@ -378,6 +378,7 @@ module.exports = function(mongoose, config) {
|
|
|
378
378
|
|
|
379
379
|
///////////////////////////////////////
|
|
380
380
|
|
|
381
|
+
Message.set('usePushEach', true);
|
|
381
382
|
Message.set('autoIndex', false);
|
|
382
383
|
Message.set('toJSON', { virtuals: true });
|
|
383
384
|
|
package/lib/News.js
CHANGED
package/lib/Note.js
CHANGED
|
@@ -127,6 +127,7 @@ module.exports = function(mongoose, config) {
|
|
|
127
127
|
self.text = querystring.unescape(self.text);
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
+
Note.set('usePushEach', true);
|
|
130
131
|
Note.set('autoIndex', false);
|
|
131
132
|
Note.on('index', function(err) { console.log('error building note indexes: ' + err); });
|
|
132
133
|
|
package/lib/Organization.js
CHANGED
|
@@ -1032,7 +1032,7 @@ module.exports = function(mongoose, config) {
|
|
|
1032
1032
|
|
|
1033
1033
|
};
|
|
1034
1034
|
|
|
1035
|
-
Organization.statics.deleteNote = function(noteId, cb) {
|
|
1035
|
+
Organization.statics.deleteNote = function(noteId, customerId, cb) {
|
|
1036
1036
|
|
|
1037
1037
|
// Delete the note itself along with any references
|
|
1038
1038
|
|
|
@@ -1045,7 +1045,7 @@ module.exports = function(mongoose, config) {
|
|
|
1045
1045
|
};
|
|
1046
1046
|
|
|
1047
1047
|
async.series([
|
|
1048
|
-
Note.delete.bind(Note, noteId),
|
|
1048
|
+
Note.delete.bind(Note, noteId, customerId),
|
|
1049
1049
|
removeReferences
|
|
1050
1050
|
], function(err, results) {
|
|
1051
1051
|
return cb(err, null);
|
|
@@ -2054,6 +2054,7 @@ module.exports = function(mongoose, config) {
|
|
|
2054
2054
|
// CONFIG
|
|
2055
2055
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
2056
2056
|
|
|
2057
|
+
Organization.set('usePushEach', true);
|
|
2057
2058
|
Organization.set('toJSON', { virtuals: true });
|
|
2058
2059
|
Organization.set('autoIndex', false);
|
|
2059
2060
|
|
package/lib/Person.js
CHANGED
|
@@ -288,7 +288,7 @@ module.exports = function(mongoose, config) {
|
|
|
288
288
|
|
|
289
289
|
};
|
|
290
290
|
|
|
291
|
-
Person.statics.deleteNote = function(noteId, cb) {
|
|
291
|
+
Person.statics.deleteNote = function(noteId, customerId, cb) {
|
|
292
292
|
|
|
293
293
|
// Delete the note itself along with any references on people
|
|
294
294
|
|
|
@@ -301,7 +301,7 @@ module.exports = function(mongoose, config) {
|
|
|
301
301
|
};
|
|
302
302
|
|
|
303
303
|
async.series([
|
|
304
|
-
Note.delete.bind(Note, noteId),
|
|
304
|
+
Note.delete.bind(Note, noteId, customerId),
|
|
305
305
|
removePersonNoteReferences
|
|
306
306
|
], function(err, results) {
|
|
307
307
|
return cb(err, null);
|
|
@@ -1075,6 +1075,7 @@ module.exports = function(mongoose, config) {
|
|
|
1075
1075
|
Person.set('autoIndex', false);
|
|
1076
1076
|
Person.on('index', function(err) { console.log('error building person indexes: ' + err); });
|
|
1077
1077
|
|
|
1078
|
+
Person.set('usePushEach', true);
|
|
1078
1079
|
Person.set('toJSON', { virtuals: true });
|
|
1079
1080
|
|
|
1080
1081
|
mongoose.model('Person', Person);
|
package/lib/Round.js
CHANGED
|
@@ -957,6 +957,7 @@ module.exports = function(mongoose, config) {
|
|
|
957
957
|
// CONFIG
|
|
958
958
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
959
959
|
|
|
960
|
+
Round.set('usePushEach', true);
|
|
960
961
|
Round.set('toJSON', { virtuals: true });
|
|
961
962
|
Round.set('autoIndex', false);
|
|
962
963
|
|
package/lib/Snapshot.js
CHANGED
package/lib/Sync.js
CHANGED
package/lib/Webhook.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhyasama/totem-models",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0",
|
|
4
4
|
"author": "Jason Reynolds",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "Models for Totem platform",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@dhyasama/totem-utilities": "^3.0.0",
|
|
19
19
|
"async": "^2.6.3",
|
|
20
20
|
"awesome-phonenumber": "^1.0.14",
|
|
21
|
-
"bluebird": "^3.7.
|
|
21
|
+
"bluebird": "^3.7.2",
|
|
22
22
|
"escape-string-regexp": "^1.0.5",
|
|
23
23
|
"moment": "^2.24.0",
|
|
24
24
|
"mongoose-deep-populate": "^3.0.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"mocha": "^5.2.0",
|
|
33
33
|
"mocha-mongoose": "^1.2.0",
|
|
34
|
-
"mongoose": "^4.
|
|
34
|
+
"mongoose": "^4.13.20",
|
|
35
35
|
"nock": "^7.2.2",
|
|
36
36
|
"should": "^11.1.1"
|
|
37
37
|
}
|
package/test/CapTable.js
CHANGED
|
@@ -27,14 +27,14 @@ describe('Cap Tables', function() {
|
|
|
27
27
|
clearDB(done);
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
before(function(done) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
30
|
+
// before(function(done) {
|
|
31
|
+
// CapTable.collection.dropIndexes(function (err, result) {
|
|
32
|
+
// should.not.exist(err);
|
|
33
|
+
// should.exist(result);
|
|
34
|
+
// result.should.equal(true);
|
|
35
|
+
// return done();
|
|
36
|
+
// });
|
|
37
|
+
// });
|
|
38
38
|
|
|
39
39
|
before(function(done) {
|
|
40
40
|
|
package/test/Investment.js
CHANGED
|
@@ -22,14 +22,14 @@ describe('Investments', function() {
|
|
|
22
22
|
clearDB(done);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
before(function (done) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
25
|
+
// before(function (done) {
|
|
26
|
+
// Investment.collection.dropIndexes(function (err, result) {
|
|
27
|
+
// should.not.exist(err);
|
|
28
|
+
// should.exist(result);
|
|
29
|
+
// result.should.equal(true);
|
|
30
|
+
// return done();
|
|
31
|
+
// });
|
|
32
|
+
// });
|
|
33
33
|
|
|
34
34
|
it('creates an investment', function(done) {
|
|
35
35
|
|
package/test/Round.js
CHANGED
|
@@ -29,14 +29,14 @@ describe('Rounds', function() {
|
|
|
29
29
|
clearDB(done);
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
before(function (done) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
32
|
+
// before(function (done) {
|
|
33
|
+
// Round.collection.dropIndexes(function (err, result) {
|
|
34
|
+
// should.not.exist(err);
|
|
35
|
+
// should.exist(result);
|
|
36
|
+
// result.should.equal(true);
|
|
37
|
+
// return done();
|
|
38
|
+
// });
|
|
39
|
+
// });
|
|
40
40
|
|
|
41
41
|
before(function(done) {
|
|
42
42
|
|