@dhyasama/totem-models 1.7.0 → 1.7.1
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/Investment.js +14 -0
- package/lib/Organization.js +3 -1
- package/package.json +1 -1
- package/test/List.js +9 -0
package/lib/Investment.js
CHANGED
|
@@ -46,6 +46,20 @@ module.exports = function(mongoose, config) {
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
|
|
49
|
+
converted: { type: Boolean, default: false },
|
|
50
|
+
convertedInto: {
|
|
51
|
+
type: String,
|
|
52
|
+
trim: true,
|
|
53
|
+
validate: {
|
|
54
|
+
validator: function(v) {
|
|
55
|
+
var self = this;
|
|
56
|
+
if (self.converted && (!v || v.length == 0)) return false;
|
|
57
|
+
else return true;
|
|
58
|
+
},
|
|
59
|
+
message: 'The investments is marked as converted but a converted into value was not provided! Either set converted to false or provide a value for converted into.'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
|
|
49
63
|
// Catch-all for customer specific key-value pairs from sheet that aren't supported by our schema
|
|
50
64
|
details: [{
|
|
51
65
|
key: { type: String, trim: true, required: true },
|
package/lib/Organization.js
CHANGED
|
@@ -68,6 +68,8 @@ module.exports = function(mongoose, config) {
|
|
|
68
68
|
board: { type: String, enum: ['chairman', 'director', 'observer', 'none'], default: 'none', index: true }
|
|
69
69
|
}],
|
|
70
70
|
|
|
71
|
+
lps: [{ type: Schema.ObjectId, ref: 'LimitedPartner' }],
|
|
72
|
+
|
|
71
73
|
entered: {
|
|
72
74
|
by: { type: String, default: '', trim: true },
|
|
73
75
|
on: { type: Date, default: Date.now }
|
|
@@ -620,7 +622,7 @@ module.exports = function(mongoose, config) {
|
|
|
620
622
|
}
|
|
621
623
|
}
|
|
622
624
|
})
|
|
623
|
-
.select('name
|
|
625
|
+
.select('name logoUrl people')
|
|
624
626
|
.exec(cb);
|
|
625
627
|
|
|
626
628
|
};
|
package/package.json
CHANGED
package/test/List.js
CHANGED
|
@@ -28,6 +28,15 @@ describe('List', function() {
|
|
|
28
28
|
clearDB(done);
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
+
before(function (done) {
|
|
32
|
+
Person.collection.dropIndexes(function (err, result) {
|
|
33
|
+
should.not.exist(err);
|
|
34
|
+
should.exist(result);
|
|
35
|
+
result.should.equal(true);
|
|
36
|
+
return done();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
31
40
|
before(function(done) {
|
|
32
41
|
|
|
33
42
|
lp = new LimitedPartner();
|