tango-api-schema 2.0.1 → 2.0.3

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/index.js CHANGED
@@ -1,7 +1,13 @@
1
- import leadModel from "./schema/lead.model.js";
2
- import otpModel from "./schema/otp.model.js";
3
-
4
- export default {
5
- leadModel,
6
- otpModel
7
- };
1
+ import leadModel from "./schema/lead.model.js";
2
+ import otpModel from "./schema/otp.model.js";
3
+ import storeModel from "./schema/store.model.js";
4
+ import countryCodesModel from './schema/countryCodes.model.js';
5
+ import clientModel from "./schema/client.model.js";
6
+
7
+ export default {
8
+ leadModel,
9
+ otpModel,
10
+ storeModel,
11
+ countryCodesModel,
12
+ clientModel
13
+ };
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
- {
2
- "name": "tango-api-schema",
3
- "version": "2.0.1",
4
- "description": "tangoEye model schema",
5
- "main": "index.js",
6
- "type": "module",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "start": "node index.js"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://praveen22raj@bitbucket.org/tangoeye-retail/tango-api-schema.git"
14
- },
15
- "author": "praveenraj",
16
- "license": "ISC",
17
- "bugs": {
18
- "url": "https://bitbucket.org/tangoeye-retail/tango-api-schema/issues"
19
- },
20
- "homepage": "https://bitbucket.org/tangoeye-retail/tango-api-schema#readme",
21
- "dependencies": {
22
- "express": "^4.18.2",
23
- "mongoose": "^7.5.3",
24
- "mongoose-unique-validator": "^4.0.0",
25
- "nodemon": "^3.0.1"
26
- }
27
- }
1
+ {
2
+ "name": "tango-api-schema",
3
+ "version": "2.0.3",
4
+ "description": "tangoEye model schema",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "start": "node index.js"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://praveen22raj@bitbucket.org/tangoeye-retail/tango-api-schema.git"
14
+ },
15
+ "author": "praveenraj",
16
+ "license": "ISC",
17
+ "bugs": {
18
+ "url": "https://bitbucket.org/tangoeye-retail/tango-api-schema/issues"
19
+ },
20
+ "homepage": "https://bitbucket.org/tangoeye-retail/tango-api-schema#readme",
21
+ "dependencies": {
22
+ "express": "^4.18.2",
23
+ "mongoose": "^7.5.3",
24
+ "mongoose-unique-validator": "^4.0.0",
25
+ "nodemon": "^3.0.1"
26
+ }
27
+ }
@@ -0,0 +1,295 @@
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const client = new mongoose.Schema(
5
+ {
6
+ clientName: {
7
+ type: String,
8
+ trim: true,
9
+ required: true,
10
+ unique: true,
11
+ },
12
+ clientId: {
13
+ type: String,
14
+ trim: true,
15
+ required: true,
16
+ unique: true,
17
+ },
18
+ tangoId: {
19
+ type: Number,
20
+ require: true,
21
+ },
22
+ planDetails: {
23
+ totalStores: {
24
+ type: Number,
25
+ require: true,
26
+ },
27
+ storeSize: {
28
+ type: String,
29
+ require: true,
30
+ },
31
+ totalCamera: {
32
+ type: Number,
33
+ require: true,
34
+ },
35
+ subscriptionPeriod: {
36
+ type: String,
37
+ enum: [ 'monthly', 'quarterly', 'annual' ],
38
+ },
39
+ subscriptionType: {
40
+ type: String,
41
+ enum: [ 'free', 'premium', 'enterprice' ],
42
+ },
43
+ paymentStatus: {
44
+ type: String,
45
+ },
46
+ product: [
47
+ {
48
+ productName: {
49
+ type: String,
50
+ },
51
+ trail: {
52
+ type: Boolean,
53
+ },
54
+ initDate: {
55
+ type: Date,
56
+ },
57
+ CompletedDate: {
58
+ type: Date,
59
+ },
60
+ },
61
+ ],
62
+
63
+ },
64
+ status: {
65
+ type: String,
66
+ enum: [ 'active', 'deactive', 'hold' ],
67
+ },
68
+ profileDetails: {
69
+ registeredCompanyName: {
70
+ type: String,
71
+ },
72
+ industry: {
73
+ type: String,
74
+ },
75
+ clientType: {
76
+ type: String,
77
+ },
78
+ corporateEmail: {
79
+ type: String,
80
+ require: true,
81
+ },
82
+ countryCode: {
83
+ type: String,
84
+ require: true,
85
+ },
86
+ mobileNumber: {
87
+ type: String,
88
+ require: true,
89
+ },
90
+ registeredAddress: {
91
+ type: String,
92
+ },
93
+ headQuarters: {
94
+ type: String,
95
+ },
96
+ website: {
97
+ type: String,
98
+ },
99
+
100
+ },
101
+ billingDetails: {
102
+ tradeName: {
103
+ type: String,
104
+ },
105
+ gstNumber: {
106
+ type: String,
107
+ },
108
+ authorityName: {
109
+ type: String,
110
+ },
111
+ authorityEmail: {
112
+ type: String,
113
+ },
114
+ billingAddress: {
115
+ type: String,
116
+ },
117
+ },
118
+ signatoryDetail: {
119
+ name: {
120
+ type: String,
121
+ },
122
+ email: {
123
+ type: String,
124
+ },
125
+ number: {
126
+ type: String,
127
+ },
128
+ designation: {
129
+ type: String,
130
+ },
131
+ },
132
+ ticketConfigs: {
133
+ installationReAssign: {
134
+ type: Number,
135
+ },
136
+ isInfraTickets: {
137
+ type: Boolean,
138
+ default: true,
139
+ },
140
+ infraReAssign: {
141
+ type: Number,
142
+ },
143
+ infraDownTime: {
144
+ type: Number,
145
+ },
146
+ isLiveTickets: {
147
+ type: Boolean,
148
+ default: false,
149
+ },
150
+ downTimeType: {
151
+ type: Number, // 0 for one camera and 1 for multi cameras
152
+ },
153
+ downTimeHour: {
154
+ type: Number,
155
+ },
156
+ accuracyPercentage: {
157
+ type: Number, // in less than
158
+ },
159
+ reTrain: {
160
+ type: Number, // calculate no of past days
161
+ },
162
+
163
+ },
164
+ reportConfigs: {
165
+ report: {
166
+ type: Boolean,
167
+ },
168
+ reportName: {
169
+ type: String,
170
+ },
171
+ },
172
+ assignedUsers: {
173
+ csm: {
174
+ type: Object,
175
+ },
176
+ ops: {
177
+ type: Array,
178
+ },
179
+ },
180
+ ssoLogin: {
181
+ isEnable: {
182
+ type: Boolean,
183
+ default: false,
184
+ },
185
+ domaiName: {
186
+ type: Array,
187
+ },
188
+ },
189
+ featureConfigs: {
190
+ open: {
191
+ type: String,
192
+ },
193
+ close: {
194
+ type: String,
195
+ },
196
+ infraAlert: {
197
+ condition: {
198
+ type: String,
199
+ },
200
+ value: {
201
+ type: Number,
202
+ },
203
+ },
204
+ bouncedLimit: {
205
+ condition: {
206
+ type: String,
207
+ },
208
+ value: {
209
+ type: Number,
210
+ },
211
+ },
212
+ missedOpportunity: {
213
+ condition: {
214
+ type: String,
215
+ },
216
+ value: {
217
+ type: Number,
218
+ },
219
+ },
220
+ conversion: {
221
+ condition: {
222
+ type: String,
223
+ },
224
+ value: {
225
+ type: Number,
226
+ },
227
+ },
228
+ billableCalculation: {
229
+ type: String,
230
+ },
231
+ missedOpportunityCalculation: {
232
+ type: String,
233
+ },
234
+ conversionCalculation: {
235
+ type: String,
236
+ },
237
+ isNormalized: {
238
+ type: Boolean,
239
+ default: false,
240
+ },
241
+ isPasserByData: {
242
+ type: Boolean,
243
+ default: false,
244
+ },
245
+ isFootfallDirectory: {
246
+ type: Boolean,
247
+ default: false,
248
+ },
249
+ },
250
+ document: {
251
+ addressProof: {
252
+ path: {
253
+ type: String,
254
+
255
+ },
256
+ },
257
+ gst: {
258
+ number: {
259
+ type: String,
260
+ },
261
+ path: {
262
+ type: String,
263
+
264
+ },
265
+ },
266
+ pan: {
267
+ number: {
268
+ type: String,
269
+ },
270
+ path: {
271
+ type: String,
272
+
273
+ },
274
+ },
275
+ cin: {
276
+ number: {
277
+ type: String,
278
+ },
279
+ path: {
280
+ type: String,
281
+
282
+ },
283
+ },
284
+
285
+ },
286
+ },
287
+ {
288
+ strict: true,
289
+ versionKey: false,
290
+ timestamps: true,
291
+ },
292
+ );
293
+
294
+ client.plugin( mongooseUniqueValidator );
295
+ export default mongoose.model( 'client', client );
@@ -0,0 +1,28 @@
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const countryCodes = new mongoose.Schema(
5
+ {
6
+ countryName: {
7
+ type: String,
8
+ required: true,
9
+ unique: true,
10
+ },
11
+ countryAlpha2Code: {
12
+ type: String,
13
+ required: true,
14
+ },
15
+ countryCode: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ },
20
+ {
21
+ strict: true,
22
+ versionKey: false,
23
+ timestamps: true,
24
+ },
25
+ );
26
+
27
+ countryCodes.plugin( mongooseUniqueValidator );
28
+ export default mongoose.model( 'countryCodes', countryCodes );
@@ -1,76 +1,76 @@
1
- import mongoose from 'mongoose';
2
- import mongooseUniqueValidator from 'mongoose-unique-validator';
3
-
4
- const lead = new mongoose.Schema(
5
- {
6
- clientName: {
7
- type: String,
8
- trim: true,
9
- required: true,
10
- unique: true,
11
- },
12
- firstName: {
13
- type: String,
14
- required: true,
15
- },
16
- lastName: {
17
- type: String,
18
- },
19
- corporateEmail: {
20
- type: String,
21
- required: true,
22
- unique: true,
23
- },
24
- countryCode: {
25
- type: String,
26
- required: true,
27
- },
28
- mobileNumber: {
29
- type: Number,
30
- required: true,
31
- },
32
- password: {
33
- type: String,
34
- required: true,
35
- },
36
- planDetails: {
37
- totalStores: {
38
- type: String,
39
- required: true,
40
- },
41
- storeSize: {
42
- type: String,
43
- required: true,
44
- },
45
- totalCamera: {
46
- type: Number,
47
- required: true,
48
- },
49
- subscriptionPeriod: {
50
- type: String,
51
- enum: [ 'monthly', 'quarterly', 'annual' ],
52
- },
53
- subscriptionType: {
54
- type: String,
55
- enum: [ 'free', 'premium', 'enterprise' ],
56
- },
57
- product: {
58
- type: Array,
59
- },
60
-
61
- },
62
- status: {
63
- type: String,
64
- enum: [ 'pending', 'rejected', 'approved' ],
65
- default: 'pending',
66
- },
67
- },
68
- {
69
- strict: true,
70
- versionKey: false,
71
- timestamps: true,
72
- },
73
- );
74
-
75
- lead.plugin( mongooseUniqueValidator );
76
- export default mongoose.model( 'lead', lead );
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const lead = new mongoose.Schema(
5
+ {
6
+ clientName: {
7
+ type: String,
8
+ trim: true,
9
+ required: true,
10
+ unique: true,
11
+ },
12
+ firstName: {
13
+ type: String,
14
+ required: true,
15
+ },
16
+ lastName: {
17
+ type: String,
18
+ },
19
+ corporateEmail: {
20
+ type: String,
21
+ required: true,
22
+ unique: true,
23
+ },
24
+ countryCode: {
25
+ type: String,
26
+ required: true,
27
+ },
28
+ mobileNumber: {
29
+ type: Number,
30
+ required: true,
31
+ },
32
+ password: {
33
+ type: String,
34
+ required: true,
35
+ },
36
+ planDetails: {
37
+ totalStores: {
38
+ type: String,
39
+ required: true,
40
+ },
41
+ storeSize: {
42
+ type: String,
43
+ required: true,
44
+ },
45
+ totalCamera: {
46
+ type: Number,
47
+ required: true,
48
+ },
49
+ subscriptionPeriod: {
50
+ type: String,
51
+ enum: [ 'monthly', 'quarterly', 'annual' ],
52
+ },
53
+ subscriptionType: {
54
+ type: String,
55
+ enum: [ 'free', 'premium', 'enterprise' ],
56
+ },
57
+ product: {
58
+ type: Array,
59
+ },
60
+
61
+ },
62
+ status: {
63
+ type: String,
64
+ enum: [ 'pending', 'rejected', 'approved' ],
65
+ default: 'pending',
66
+ },
67
+ },
68
+ {
69
+ strict: true,
70
+ versionKey: false,
71
+ timestamps: true,
72
+ },
73
+ );
74
+
75
+ lead.plugin( mongooseUniqueValidator );
76
+ export default mongoose.model( 'lead', lead );
@@ -1,29 +1,29 @@
1
- import uniqueValidator from 'mongoose-unique-validator';
2
- import mongoose from 'mongoose';
3
-
4
- // schema
5
- const collection = new mongoose.Schema( {
6
- email: {
7
- type: String,
8
- trim: true,
9
- unique: true,
10
- },
11
- otp: {
12
- type: Number,
13
- },
14
- type: {
15
- type: String,
16
- enum: [ 'signup' ],
17
- },
18
- },
19
- {
20
- timestamps: true,
21
- strict: true,
22
- versionKey: false,
23
- } );
24
-
25
- collection.plugin( uniqueValidator );
26
- collection.index( { createdAt: 1 }, { expires: '1d' } );
27
- collection.index( { type: 1, email: 1 } );
28
-
1
+ import uniqueValidator from 'mongoose-unique-validator';
2
+ import mongoose from 'mongoose';
3
+
4
+ // schema
5
+ const collection = new mongoose.Schema( {
6
+ email: {
7
+ type: String,
8
+ trim: true,
9
+ unique: true,
10
+ },
11
+ otp: {
12
+ type: Number,
13
+ },
14
+ type: {
15
+ type: String,
16
+ enum: [ 'signup' ],
17
+ },
18
+ },
19
+ {
20
+ timestamps: true,
21
+ strict: true,
22
+ versionKey: false,
23
+ } );
24
+
25
+ collection.plugin( uniqueValidator );
26
+ collection.index( { createdAt: 1 }, { expires: '1d' } );
27
+ collection.index( { type: 1, email: 1 } );
28
+
29
29
  export default mongoose.model( 'otp', collection );
@@ -0,0 +1,108 @@
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const store = new mongoose.Schema(
5
+ {
6
+ storeId: {
7
+ type: String,
8
+ trim: true,
9
+ required: true,
10
+ unique: true,
11
+ },
12
+ storeName: {
13
+ type: String,
14
+ require: true,
15
+ },
16
+ appId: {
17
+ type: String,
18
+ trim: true,
19
+ required: true,
20
+ unique: true,
21
+ },
22
+ clientId: {
23
+ type: String,
24
+ trim: true,
25
+ required: true,
26
+ },
27
+ businessType: {
28
+ type: String,
29
+ },
30
+ storeType: {
31
+ type: {
32
+ type: String,
33
+ },
34
+ name: {
35
+ type: String,
36
+ },
37
+ },
38
+
39
+ storeProfile: {
40
+ storeCode: {
41
+ type: String,
42
+ },
43
+ address: {
44
+ type: String,
45
+ },
46
+ country: {
47
+ type: String,
48
+ },
49
+ state: {
50
+ type: String,
51
+ },
52
+ city: {
53
+ type: String,
54
+ },
55
+ pincode: {
56
+ type: String,
57
+ },
58
+ timeZone: {
59
+ type: String,
60
+ },
61
+ open: {
62
+ type: String,
63
+ },
64
+ close: {
65
+ type: String,
66
+ },
67
+ },
68
+ edge: {
69
+ camDetails: {
70
+ cameras: {
71
+ type: String,
72
+ },
73
+ },
74
+ },
75
+ spocDetails: [
76
+ {
77
+ name: {
78
+ type: String,
79
+ required: true,
80
+ },
81
+ email: {
82
+ type: String,
83
+ required: true,
84
+ },
85
+ contact: {
86
+ type: String,
87
+ required: true,
88
+ },
89
+ designation: {
90
+ type: String,
91
+ },
92
+ },
93
+ ],
94
+ storeConnectionId: {
95
+ type: String,
96
+ },
97
+ },
98
+ {
99
+ strict: true,
100
+ versionKey: false,
101
+ timestamps: true,
102
+ },
103
+ );
104
+
105
+ store.index( { storeId: 1, clientId: 1, appId: 1 } );
106
+ store.plugin( mongooseUniqueValidator );
107
+
108
+ export default mongoose.model( 'store', store );