@dhyasama/totem-models 3.1.0 → 3.2.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/.npmignore +14 -0
- package/index.js +2 -0
- package/lib/Document.js +65 -285
- package/lib/Interaction.js +2 -1
- package/lib/LimitedPartner.js +1 -0
- package/lib/Message.js +209 -0
- package/lib/Organization.js +3 -6
- package/lib/Person.js +2 -0
- package/package-lock.json +1168 -0
- package/package.json +1 -1
- package/test/Document.js +236 -0
- package/test/Message.js +144 -0
- package/test/Organization.js +1 -1
package/lib/Organization.js
CHANGED
|
@@ -143,6 +143,9 @@ module.exports = function(mongoose, config) {
|
|
|
143
143
|
// customer specific (customer id is stored on note)
|
|
144
144
|
notes: [ { type: Schema.ObjectId, ref: 'Note' } ],
|
|
145
145
|
|
|
146
|
+
// customer specific (customer id is stored on doc)
|
|
147
|
+
documents: [ { type: Schema.ObjectId, ref: 'Document' } ],
|
|
148
|
+
|
|
146
149
|
customer: {
|
|
147
150
|
|
|
148
151
|
active: { type: Boolean, default: false },
|
|
@@ -176,11 +179,6 @@ module.exports = function(mongoose, config) {
|
|
|
176
179
|
|
|
177
180
|
},
|
|
178
181
|
|
|
179
|
-
docs: [{
|
|
180
|
-
customer: { type: Schema.ObjectId, ref: 'Organization' },
|
|
181
|
-
url: { type: String, trim: true, unique: true, partialFilterExpression : { type :"string" } }
|
|
182
|
-
}],
|
|
183
|
-
|
|
184
182
|
// Link to deeper data on iLevel
|
|
185
183
|
// iLevelUser must be true at the account level
|
|
186
184
|
iLevel: [{
|
|
@@ -1363,7 +1361,6 @@ module.exports = function(mongoose, config) {
|
|
|
1363
1361
|
|
|
1364
1362
|
doc.lps = _.reject(doc.lps, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
1365
1363
|
doc.filters = _.reject(doc.filters, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
1366
|
-
doc.docs = _.reject(doc.docs, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
1367
1364
|
doc.iLevel = _.reject(doc.iLevel, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
1368
1365
|
doc.chairs = _.reject(doc.chairs, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
1369
1366
|
doc.operating.acquired.private = _.find(doc.operating.acquired.private, function(item) { return !item.customer || item.customer.toString() == CUSTOMER_ID; });
|
package/lib/Person.js
CHANGED
|
@@ -94,6 +94,8 @@ module.exports = function(mongoose, config) {
|
|
|
94
94
|
|
|
95
95
|
notes: [ { type: Schema.ObjectId, ref: 'Note' } ],
|
|
96
96
|
|
|
97
|
+
documents: [ { type: Schema.ObjectId, ref: 'Document' } ],
|
|
98
|
+
|
|
97
99
|
// this only relates to access for lps
|
|
98
100
|
syndication: {
|
|
99
101
|
notify: { type: Boolean, default: false }
|