@dhyasama/totem-models 4.5.5 → 4.7.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/Document.js +5 -1
- package/lib/Financials.js +2 -2
- package/lib/Message.js +1 -1
- package/lib/Organization.js +4 -0
- package/lib/Person.js +5 -1
- package/package-lock.json +19 -65
- package/package.json +2 -2
- package/test/Document.js +17 -4
- package/test/Message.js +2 -1
- package/test/Organization.js +8 -8
- package/test/Person.js +25 -0
package/lib/Document.js
CHANGED
|
@@ -28,7 +28,11 @@ module.exports = function(mongoose, config) {
|
|
|
28
28
|
s3: {
|
|
29
29
|
bucket: { type: String, required: true, trim: true },
|
|
30
30
|
key: { type: String, required: true, trim: true }
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
type: { type: String, required: true, enum: ['deals', 'portfolio', 'other'] },
|
|
34
|
+
|
|
35
|
+
subtype: { type: String, enum: ['deck'] },
|
|
32
36
|
|
|
33
37
|
});
|
|
34
38
|
|
package/lib/Financials.js
CHANGED
|
@@ -36,11 +36,11 @@ module.exports = function(mongoose, config) {
|
|
|
36
36
|
},
|
|
37
37
|
burn: {
|
|
38
38
|
amount: { type: Number, default: 0 },
|
|
39
|
-
period: { type: String, enum: [null, 'monthly', 'quarterly']},
|
|
39
|
+
period: { type: String, enum: [null, 'monthly', 'quarterly', 'yearly']},
|
|
40
40
|
},
|
|
41
41
|
runway: {
|
|
42
42
|
amount: { type: Number, default: 0 },
|
|
43
|
-
period: { type: String, enum: [null, 'monthly', 'quarterly']},
|
|
43
|
+
period: { type: String, enum: [null, 'monthly', 'quarterly', 'yearly']},
|
|
44
44
|
},
|
|
45
45
|
|
|
46
46
|
// income statement
|
package/lib/Message.js
CHANGED
|
@@ -17,7 +17,7 @@ module.exports = function(mongoose, config) {
|
|
|
17
17
|
createdOn: { type: Date, required: true },
|
|
18
18
|
webhook: { type: Schema.ObjectId, ref: 'Webhook', required: true },
|
|
19
19
|
type: { type: String, required: true, enum: ['email'], default: 'email' }, // for future options
|
|
20
|
-
subtype: { type: String, required: true, enum: ['boards', 'updates', 'deals'] },
|
|
20
|
+
subtype: { type: String, required: true, enum: ['boards', 'updates', 'deals', 'portfolio'] },
|
|
21
21
|
customer: { type: Schema.ObjectId, ref: 'Organization', required: true },
|
|
22
22
|
organization: { type: Schema.ObjectId, ref: 'Organization' },
|
|
23
23
|
originalMessageDate: { type: Date, required: false, default: null },
|
package/lib/Organization.js
CHANGED
|
@@ -144,6 +144,10 @@ module.exports = function(mongoose, config) {
|
|
|
144
144
|
customer: { type: Schema.ObjectId, ref: 'Organization' }
|
|
145
145
|
}],
|
|
146
146
|
|
|
147
|
+
clearbit: {
|
|
148
|
+
uuid: { type: String, unique: true, partialFilterExpression : { type : "string" }, trim: true }
|
|
149
|
+
},
|
|
150
|
+
|
|
147
151
|
crunchbase: {
|
|
148
152
|
uuid: { type: String, unique: true, partialFilterExpression : { type : "string" }, trim: true },
|
|
149
153
|
url: { type: String, unique: true, partialFilterExpression : { type :"string" }, trim: true }
|
package/lib/Person.js
CHANGED
|
@@ -43,7 +43,7 @@ module.exports = function(mongoose, config) {
|
|
|
43
43
|
|
|
44
44
|
email: [{
|
|
45
45
|
type: { type: String, enum: ['personal', 'work', 'assistant', 'other'] },
|
|
46
|
-
email: { type: String,
|
|
46
|
+
email: { type: String, unique: true, partialFilterExpression : { type :"string" }, trim: true, lowercase: true },
|
|
47
47
|
primary: { type: Boolean, default: false },
|
|
48
48
|
inactive: { type: Boolean, default: false }
|
|
49
49
|
}],
|
|
@@ -69,6 +69,10 @@ module.exports = function(mongoose, config) {
|
|
|
69
69
|
|
|
70
70
|
website: { type: String, default: null, required: false, trim: true, lowercase: true },
|
|
71
71
|
|
|
72
|
+
clearbit: {
|
|
73
|
+
uuid: { type: String, unique: true, partialFilterExpression : { type : "string" }, trim: true }
|
|
74
|
+
},
|
|
75
|
+
|
|
72
76
|
crunchbase: {
|
|
73
77
|
uuid: { type: String, unique: true, required: false, partialFilterExpression : { type :"string" }, trim: true }
|
|
74
78
|
},
|
package/package-lock.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhyasama/totem-models",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -125,9 +125,9 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
"@dhyasama/ffvc-utilities": {
|
|
128
|
-
"version": "2.
|
|
129
|
-
"resolved": "https://registry.npmjs.org/@dhyasama/ffvc-utilities/-/ffvc-utilities-2.
|
|
130
|
-
"integrity": "
|
|
128
|
+
"version": "2.5.0",
|
|
129
|
+
"resolved": "https://registry.npmjs.org/@dhyasama/ffvc-utilities/-/ffvc-utilities-2.5.0.tgz",
|
|
130
|
+
"integrity": "sha512-Wehf3MHuCQW17CxODVaESfc1GBkvcpRDnYdp9/mL/IcoMFhQOB93oZw3jEDhttDVwTm3nXEA1JLEjkE4zghLpQ==",
|
|
131
131
|
"requires": {
|
|
132
132
|
"email-addresses": "^3.0.1",
|
|
133
133
|
"isnumeric": "^0.1.4",
|
|
@@ -137,34 +137,6 @@
|
|
|
137
137
|
"underscore": "^1.8.3"
|
|
138
138
|
},
|
|
139
139
|
"dependencies": {
|
|
140
|
-
"async": {
|
|
141
|
-
"version": "2.6.0",
|
|
142
|
-
"resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz",
|
|
143
|
-
"integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==",
|
|
144
|
-
"requires": {
|
|
145
|
-
"lodash": "^4.14.0"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"mongoose": {
|
|
149
|
-
"version": "4.13.14",
|
|
150
|
-
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.13.14.tgz",
|
|
151
|
-
"integrity": "sha512-20zynb1fvCO37AP+0iTPGDbt4dJJkzM9fNK5BwKf5n+gFU5YYdXpnhxs9Kf8C+Fe0xY8vpUKV8wA7VGWcmDaFw==",
|
|
152
|
-
"requires": {
|
|
153
|
-
"async": "2.6.0",
|
|
154
|
-
"bson": "~1.0.4",
|
|
155
|
-
"hooks-fixed": "2.0.2",
|
|
156
|
-
"kareem": "1.5.0",
|
|
157
|
-
"lodash.get": "4.4.2",
|
|
158
|
-
"mongodb": "2.2.34",
|
|
159
|
-
"mpath": "0.3.0",
|
|
160
|
-
"mpromise": "0.5.5",
|
|
161
|
-
"mquery": "2.3.3",
|
|
162
|
-
"ms": "2.0.0",
|
|
163
|
-
"muri": "1.3.0",
|
|
164
|
-
"regexp-clone": "0.0.1",
|
|
165
|
-
"sliced": "1.0.1"
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
140
|
"underscore": {
|
|
169
141
|
"version": "1.9.1",
|
|
170
142
|
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",
|
|
@@ -656,9 +628,9 @@
|
|
|
656
628
|
}
|
|
657
629
|
},
|
|
658
630
|
"email-addresses": {
|
|
659
|
-
"version": "3.0.
|
|
660
|
-
"resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.0.
|
|
661
|
-
"integrity": "
|
|
631
|
+
"version": "3.0.2",
|
|
632
|
+
"resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.0.2.tgz",
|
|
633
|
+
"integrity": "sha512-IMn9dnwLMsgZjdUHswB/UZ0S8LQ/u+2/qjnHJ9tCtp3QHZsIYwJCiJOo2FT0i3CwwK/dtSODYtxuvzV4D9MY5g=="
|
|
662
634
|
},
|
|
663
635
|
"es6-promise": {
|
|
664
636
|
"version": "3.2.1",
|
|
@@ -1016,7 +988,6 @@
|
|
|
1016
988
|
"version": "4.5.10",
|
|
1017
989
|
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.5.10.tgz",
|
|
1018
990
|
"integrity": "sha1-bBCRGeeydLTlPi8JIXbkx9t+zNY=",
|
|
1019
|
-
"dev": true,
|
|
1020
991
|
"requires": {
|
|
1021
992
|
"async": "1.5.2",
|
|
1022
993
|
"bson": "~0.4.23",
|
|
@@ -1035,26 +1006,22 @@
|
|
|
1035
1006
|
"async": {
|
|
1036
1007
|
"version": "1.5.2",
|
|
1037
1008
|
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
|
|
1038
|
-
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="
|
|
1039
|
-
"dev": true
|
|
1009
|
+
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="
|
|
1040
1010
|
},
|
|
1041
1011
|
"bluebird": {
|
|
1042
1012
|
"version": "2.10.2",
|
|
1043
1013
|
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz",
|
|
1044
|
-
"integrity": "sha1-AkpVFylTCIV/FPkfEQb8O1VfRGs="
|
|
1045
|
-
"dev": true
|
|
1014
|
+
"integrity": "sha1-AkpVFylTCIV/FPkfEQb8O1VfRGs="
|
|
1046
1015
|
},
|
|
1047
1016
|
"bson": {
|
|
1048
1017
|
"version": "0.4.23",
|
|
1049
1018
|
"resolved": "https://registry.npmjs.org/bson/-/bson-0.4.23.tgz",
|
|
1050
|
-
"integrity": "sha1-5louPHUH/63kEJvHV1p25Q+NqRU="
|
|
1051
|
-
"dev": true
|
|
1019
|
+
"integrity": "sha1-5louPHUH/63kEJvHV1p25Q+NqRU="
|
|
1052
1020
|
},
|
|
1053
1021
|
"debug": {
|
|
1054
1022
|
"version": "2.2.0",
|
|
1055
1023
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
|
|
1056
1024
|
"integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=",
|
|
1057
|
-
"dev": true,
|
|
1058
1025
|
"requires": {
|
|
1059
1026
|
"ms": "0.7.1"
|
|
1060
1027
|
}
|
|
@@ -1062,32 +1029,27 @@
|
|
|
1062
1029
|
"es6-promise": {
|
|
1063
1030
|
"version": "3.0.2",
|
|
1064
1031
|
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz",
|
|
1065
|
-
"integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y="
|
|
1066
|
-
"dev": true
|
|
1032
|
+
"integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y="
|
|
1067
1033
|
},
|
|
1068
1034
|
"hooks-fixed": {
|
|
1069
1035
|
"version": "1.2.0",
|
|
1070
1036
|
"resolved": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-1.2.0.tgz",
|
|
1071
|
-
"integrity": "sha1-DSdy1NfWhf+SRHJKnwtbJVmqyWs="
|
|
1072
|
-
"dev": true
|
|
1037
|
+
"integrity": "sha1-DSdy1NfWhf+SRHJKnwtbJVmqyWs="
|
|
1073
1038
|
},
|
|
1074
1039
|
"isarray": {
|
|
1075
1040
|
"version": "0.0.1",
|
|
1076
1041
|
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
|
1077
|
-
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
|
|
1078
|
-
"dev": true
|
|
1042
|
+
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
|
|
1079
1043
|
},
|
|
1080
1044
|
"kareem": {
|
|
1081
1045
|
"version": "1.1.3",
|
|
1082
1046
|
"resolved": "https://registry.npmjs.org/kareem/-/kareem-1.1.3.tgz",
|
|
1083
|
-
"integrity": "sha1-CHdhDYh5w42mLR26/eThfyaS8EE="
|
|
1084
|
-
"dev": true
|
|
1047
|
+
"integrity": "sha1-CHdhDYh5w42mLR26/eThfyaS8EE="
|
|
1085
1048
|
},
|
|
1086
1049
|
"mongodb": {
|
|
1087
1050
|
"version": "2.1.18",
|
|
1088
1051
|
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.1.18.tgz",
|
|
1089
1052
|
"integrity": "sha1-KNQLUVsr5NWmn/3UxTXw30MuQJc=",
|
|
1090
|
-
"dev": true,
|
|
1091
1053
|
"requires": {
|
|
1092
1054
|
"es6-promise": "3.0.2",
|
|
1093
1055
|
"mongodb-core": "1.3.18",
|
|
@@ -1098,7 +1060,6 @@
|
|
|
1098
1060
|
"version": "1.3.18",
|
|
1099
1061
|
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-1.3.18.tgz",
|
|
1100
1062
|
"integrity": "sha1-kGhLO3xzVtZa41Y5HTCw8kiATHo=",
|
|
1101
|
-
"dev": true,
|
|
1102
1063
|
"requires": {
|
|
1103
1064
|
"bson": "~0.4.23",
|
|
1104
1065
|
"require_optional": "~1.0.0"
|
|
@@ -1107,14 +1068,12 @@
|
|
|
1107
1068
|
"mpath": {
|
|
1108
1069
|
"version": "0.2.1",
|
|
1109
1070
|
"resolved": "https://registry.npmjs.org/mpath/-/mpath-0.2.1.tgz",
|
|
1110
|
-
"integrity": "sha1-Ok6Ck1mAHeljCcJ6ay4QLon56W4="
|
|
1111
|
-
"dev": true
|
|
1071
|
+
"integrity": "sha1-Ok6Ck1mAHeljCcJ6ay4QLon56W4="
|
|
1112
1072
|
},
|
|
1113
1073
|
"mquery": {
|
|
1114
1074
|
"version": "1.11.0",
|
|
1115
1075
|
"resolved": "https://registry.npmjs.org/mquery/-/mquery-1.11.0.tgz",
|
|
1116
1076
|
"integrity": "sha1-4MZd7bEDftv2z7iCYud3/uI1Udk=",
|
|
1117
|
-
"dev": true,
|
|
1118
1077
|
"requires": {
|
|
1119
1078
|
"bluebird": "2.10.2",
|
|
1120
1079
|
"debug": "2.2.0",
|
|
@@ -1125,28 +1084,24 @@
|
|
|
1125
1084
|
"sliced": {
|
|
1126
1085
|
"version": "0.0.5",
|
|
1127
1086
|
"resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz",
|
|
1128
|
-
"integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8="
|
|
1129
|
-
"dev": true
|
|
1087
|
+
"integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8="
|
|
1130
1088
|
}
|
|
1131
1089
|
}
|
|
1132
1090
|
},
|
|
1133
1091
|
"ms": {
|
|
1134
1092
|
"version": "0.7.1",
|
|
1135
1093
|
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
|
|
1136
|
-
"integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg="
|
|
1137
|
-
"dev": true
|
|
1094
|
+
"integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg="
|
|
1138
1095
|
},
|
|
1139
1096
|
"muri": {
|
|
1140
1097
|
"version": "1.1.0",
|
|
1141
1098
|
"resolved": "https://registry.npmjs.org/muri/-/muri-1.1.0.tgz",
|
|
1142
|
-
"integrity": "sha1-o6bXTmiogPQzokmnSWnLtmXMCt0="
|
|
1143
|
-
"dev": true
|
|
1099
|
+
"integrity": "sha1-o6bXTmiogPQzokmnSWnLtmXMCt0="
|
|
1144
1100
|
},
|
|
1145
1101
|
"readable-stream": {
|
|
1146
1102
|
"version": "1.0.31",
|
|
1147
1103
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz",
|
|
1148
1104
|
"integrity": "sha1-jyUC4LyeOw2huUUgqrtOJgPsr64=",
|
|
1149
|
-
"dev": true,
|
|
1150
1105
|
"requires": {
|
|
1151
1106
|
"core-util-is": "~1.0.0",
|
|
1152
1107
|
"inherits": "~2.0.1",
|
|
@@ -1157,8 +1112,7 @@
|
|
|
1157
1112
|
"string_decoder": {
|
|
1158
1113
|
"version": "0.10.31",
|
|
1159
1114
|
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
|
1160
|
-
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
|
|
1161
|
-
"dev": true
|
|
1115
|
+
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
|
|
1162
1116
|
}
|
|
1163
1117
|
}
|
|
1164
1118
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhyasama/totem-models",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"author": "Jason Reynolds",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "Models for Totem platform",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@dhyasama/ffvc-crypto": "^1.0.0",
|
|
16
16
|
"@dhyasama/ffvc-geoip": "^1.0.0",
|
|
17
17
|
"@dhyasama/ffvc-s3": "^1.0.0",
|
|
18
|
-
"@dhyasama/ffvc-utilities": "^2.
|
|
18
|
+
"@dhyasama/ffvc-utilities": "^2.5.0",
|
|
19
19
|
"async": "^2.6.1",
|
|
20
20
|
"awesome-phonenumber": "^1.0.14",
|
|
21
21
|
"bcrypt": "^0.8.0",
|
package/test/Document.js
CHANGED
|
@@ -26,6 +26,15 @@ describe('Document', function() {
|
|
|
26
26
|
clearDB(done);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
+
before(function (done) {
|
|
30
|
+
Person.collection.dropIndexes(function (err, result) {
|
|
31
|
+
should.not.exist(err);
|
|
32
|
+
should.exist(result);
|
|
33
|
+
result.should.equal(true);
|
|
34
|
+
return done();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
29
38
|
before(function(done) {
|
|
30
39
|
|
|
31
40
|
interaction = new Interaction({
|
|
@@ -140,7 +149,8 @@ describe('Document', function() {
|
|
|
140
149
|
s3: {
|
|
141
150
|
bucket: 'totem',
|
|
142
151
|
key: 'docs'
|
|
143
|
-
}
|
|
152
|
+
},
|
|
153
|
+
type: 'other'
|
|
144
154
|
}, Interaction, interaction._id, function(err, result) {
|
|
145
155
|
|
|
146
156
|
should.not.exist(err);
|
|
@@ -166,7 +176,8 @@ describe('Document', function() {
|
|
|
166
176
|
s3: {
|
|
167
177
|
bucket: 'totem',
|
|
168
178
|
key: 'docs'
|
|
169
|
-
}
|
|
179
|
+
},
|
|
180
|
+
type: 'deals'
|
|
170
181
|
}, Message, message._id, function(err, result) {
|
|
171
182
|
|
|
172
183
|
should.not.exist(err);
|
|
@@ -192,7 +203,8 @@ describe('Document', function() {
|
|
|
192
203
|
s3: {
|
|
193
204
|
bucket: 'totem',
|
|
194
205
|
key: 'docs'
|
|
195
|
-
}
|
|
206
|
+
},
|
|
207
|
+
type: 'portfolio'
|
|
196
208
|
}, Organization, org._id, function(err, result) {
|
|
197
209
|
|
|
198
210
|
should.not.exist(err);
|
|
@@ -220,7 +232,8 @@ describe('Document', function() {
|
|
|
220
232
|
s3: {
|
|
221
233
|
bucket: 'totem',
|
|
222
234
|
key: 'docs'
|
|
223
|
-
}
|
|
235
|
+
},
|
|
236
|
+
type: 'other'
|
|
224
237
|
}, Person, person._id, function(err, result) {
|
|
225
238
|
|
|
226
239
|
should.not.exist(err);
|
package/test/Message.js
CHANGED
package/test/Organization.js
CHANGED
|
@@ -23,7 +23,7 @@ var someOtherLp;
|
|
|
23
23
|
var account;
|
|
24
24
|
var customer1, customer2;
|
|
25
25
|
|
|
26
|
-
describe
|
|
26
|
+
describe('Organization', function() {
|
|
27
27
|
|
|
28
28
|
var org1, org2, org3, org4, org5;
|
|
29
29
|
var mergeId = new mongoose.Types.ObjectId();
|
|
@@ -373,7 +373,7 @@ describe.only('Organization', function() {
|
|
|
373
373
|
|
|
374
374
|
});
|
|
375
375
|
|
|
376
|
-
describe
|
|
376
|
+
describe('General', function () {
|
|
377
377
|
|
|
378
378
|
it('it soft deletes an org', function (done) {
|
|
379
379
|
|
|
@@ -1133,7 +1133,7 @@ describe.only('Organization', function() {
|
|
|
1133
1133
|
|
|
1134
1134
|
var org;
|
|
1135
1135
|
|
|
1136
|
-
it
|
|
1136
|
+
it('gets deal statuses for a customer', function(done) {
|
|
1137
1137
|
|
|
1138
1138
|
var statuses = customer1.customer.deals.activeStatuses;
|
|
1139
1139
|
statuses.length.should.equal(3);
|
|
@@ -1176,7 +1176,7 @@ describe.only('Organization', function() {
|
|
|
1176
1176
|
|
|
1177
1177
|
});
|
|
1178
1178
|
|
|
1179
|
-
it
|
|
1179
|
+
it('adds a deal again', function(done) {
|
|
1180
1180
|
|
|
1181
1181
|
var threwError = false;
|
|
1182
1182
|
|
|
@@ -1195,7 +1195,7 @@ describe.only('Organization', function() {
|
|
|
1195
1195
|
|
|
1196
1196
|
});
|
|
1197
1197
|
|
|
1198
|
-
it
|
|
1198
|
+
it('adds a deal with an inactive state', function(done) {
|
|
1199
1199
|
|
|
1200
1200
|
var threwError = false;
|
|
1201
1201
|
|
|
@@ -1212,7 +1212,7 @@ describe.only('Organization', function() {
|
|
|
1212
1212
|
|
|
1213
1213
|
});
|
|
1214
1214
|
|
|
1215
|
-
it
|
|
1215
|
+
it('adds a deal for another customer', function(done) {
|
|
1216
1216
|
|
|
1217
1217
|
var org2 = new Organization();
|
|
1218
1218
|
org2.name = 'Newest Co';
|
|
@@ -1241,7 +1241,7 @@ describe.only('Organization', function() {
|
|
|
1241
1241
|
|
|
1242
1242
|
});
|
|
1243
1243
|
|
|
1244
|
-
it
|
|
1244
|
+
it('gets deals for non-customer process', function(done) {
|
|
1245
1245
|
|
|
1246
1246
|
var temp = config.CUSTOMER_ID;
|
|
1247
1247
|
config.CUSTOMER_ID = 'GLOBAL_PROCESS';
|
|
@@ -1289,7 +1289,7 @@ describe.only('Organization', function() {
|
|
|
1289
1289
|
|
|
1290
1290
|
});
|
|
1291
1291
|
|
|
1292
|
-
describe
|
|
1292
|
+
describe('State', function() {
|
|
1293
1293
|
|
|
1294
1294
|
it('gets ipo info', function(done) {
|
|
1295
1295
|
|
package/test/Person.js
CHANGED
|
@@ -52,12 +52,17 @@ describe('Person', function() {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
before(function (done) {
|
|
55
|
+
|
|
55
56
|
Person.collection.dropIndexes(function (err, result) {
|
|
57
|
+
|
|
56
58
|
should.not.exist(err);
|
|
57
59
|
should.exist(result);
|
|
58
60
|
result.should.equal(true);
|
|
61
|
+
|
|
59
62
|
return done();
|
|
63
|
+
|
|
60
64
|
});
|
|
65
|
+
|
|
61
66
|
});
|
|
62
67
|
|
|
63
68
|
before(function (done) {
|
|
@@ -208,6 +213,26 @@ describe('Person', function() {
|
|
|
208
213
|
|
|
209
214
|
}); // end adds a person
|
|
210
215
|
|
|
216
|
+
it.skip('tries to add another person with the same email', function(done) {
|
|
217
|
+
|
|
218
|
+
var p = new Person();
|
|
219
|
+
p.name.first = 'Jesty';
|
|
220
|
+
p.name.last = 'McJester';
|
|
221
|
+
p.slug = 'jesty-mcjester';
|
|
222
|
+
|
|
223
|
+
p.contact.email.push({
|
|
224
|
+
type: 'work',
|
|
225
|
+
email: 'dhyasama+test@gmail.com',
|
|
226
|
+
primary: true
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
Person.upsert(p, 'test', function(err, updatedPerson) {
|
|
230
|
+
should.exist(err);
|
|
231
|
+
done();
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
});
|
|
235
|
+
|
|
211
236
|
it('it relates 2 people', function(done) {
|
|
212
237
|
|
|
213
238
|
person2.relatePerson(person.id);
|