@dhyasama/totem-models 6.26.2 → 6.28.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/Organization.js +8 -0
- package/package.json +1 -1
package/lib/Organization.js
CHANGED
|
@@ -135,6 +135,13 @@ module.exports = function(mongoose, config) {
|
|
|
135
135
|
customer: { type: Schema.ObjectId, ref: 'Organization' }
|
|
136
136
|
}],
|
|
137
137
|
|
|
138
|
+
valuations: [{
|
|
139
|
+
amount: { type: Number, default: 0 },
|
|
140
|
+
description: { type: String, trim: true },
|
|
141
|
+
date: { type: Date, default: null },
|
|
142
|
+
customer: { type: Schema.ObjectId, ref: 'Organization' },
|
|
143
|
+
}],
|
|
144
|
+
|
|
138
145
|
clearbit: {
|
|
139
146
|
uuid: { type: String, unique: true, partialFilterExpression : { type : "string" }, trim: true },
|
|
140
147
|
lastEnrichmentRequestedOn: { type: Date, default: null }
|
|
@@ -2121,6 +2128,7 @@ module.exports = function(mongoose, config) {
|
|
|
2121
2128
|
|
|
2122
2129
|
doc.lps = _.reject(doc.lps, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
2123
2130
|
doc.filters = _.reject(doc.filters, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
2131
|
+
doc.valuations = _.reject(doc.valuations, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
2124
2132
|
doc.iLevel = _.reject(doc.iLevel, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
2125
2133
|
doc.chairs = _.reject(doc.chairs, function(item) { return !item.customer || item.customer.toString() != CUSTOMER_ID; });
|
|
2126
2134
|
doc.operating.acquired.private = _.find(doc.operating.acquired.private, function(item) { return !item.customer || item.customer.toString() == CUSTOMER_ID; });
|