@dhyasama/totem-models 8.54.1 → 8.55.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/LimitedPartner.js +2 -20
- package/lib/Person.js +4 -1
- package/package.json +1 -1
package/lib/LimitedPartner.js
CHANGED
|
@@ -665,7 +665,7 @@ module.exports = function(mongoose, config) {
|
|
|
665
665
|
|
|
666
666
|
};
|
|
667
667
|
|
|
668
|
-
LimitedPartner.statics.
|
|
668
|
+
LimitedPartner.statics.removeCustomerExtras = function removeCustomerExtras(customerId, cb) {
|
|
669
669
|
|
|
670
670
|
const self = this;
|
|
671
671
|
|
|
@@ -675,25 +675,7 @@ module.exports = function(mongoose, config) {
|
|
|
675
675
|
|
|
676
676
|
let query = self.update(
|
|
677
677
|
{ 'customer': customerId },
|
|
678
|
-
{ $set: { details: [] } },
|
|
679
|
-
{ multi : true }
|
|
680
|
-
);
|
|
681
|
-
|
|
682
|
-
query.exec(cb);
|
|
683
|
-
|
|
684
|
-
};
|
|
685
|
-
|
|
686
|
-
LimitedPartner.statics.removeCustomerPeople = function removeCustomerPeople(customerId, cb) {
|
|
687
|
-
|
|
688
|
-
const self = this;
|
|
689
|
-
|
|
690
|
-
if (!cb) { throw new Error('cb is required'); }
|
|
691
|
-
if (!customerId) { return cb(new Error('customerId is required'), null); }
|
|
692
|
-
if (!mongoose.Types.ObjectId.isValid(customerId)) { return cb(new Error('customerId is not a valid ObjectId'), null); }
|
|
693
|
-
|
|
694
|
-
let query = self.update(
|
|
695
|
-
{ 'customer': customerId },
|
|
696
|
-
{ $set: { people: [] } },
|
|
678
|
+
{ $set: { details: [], people: [], contact: { phone: [], email: [], address: [] } } },
|
|
697
679
|
{ multi : true }
|
|
698
680
|
);
|
|
699
681
|
|
package/lib/Person.js
CHANGED
|
@@ -137,7 +137,10 @@ module.exports = function(mongoose, config) {
|
|
|
137
137
|
/////////////
|
|
138
138
|
|
|
139
139
|
Person.virtual('name.full').get(function () {
|
|
140
|
-
|
|
140
|
+
var name = '';
|
|
141
|
+
if(this.name.first) name += this.name.first
|
|
142
|
+
if(this.name.last) name += this.name.last;
|
|
143
|
+
return name;
|
|
141
144
|
});
|
|
142
145
|
|
|
143
146
|
Person.virtual('avatar').get(function() {
|