tango-api-schema 2.0.2 → 2.0.4
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 +13 -9
- package/package.json +27 -27
- package/schema/client.model.js +294 -0
- package/schema/countryCodes.model.js +28 -0
- package/schema/edgeAppVersion.model.js +27 -0
- package/schema/lead.model.js +75 -76
- package/schema/otp.model.js +28 -28
- package/schema/store.model.js +125 -107
- package/schema/user.model.js +74 -0
package/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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.
|
|
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.4",
|
|
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,294 @@
|
|
|
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
|
+
enum:['apparel','footwear','skincare','foodandbeverage','techstartup','grooming','leather','furniture','mattress',' customerelectronics','jewellery','interiordesign','ev','fintech','perfume','fashionaccessories','innerwear','nutrition','fashionandlifestyle','eyewear']
|
|
75
|
+
},
|
|
76
|
+
clientType: {
|
|
77
|
+
type: String,
|
|
78
|
+
enum:['partnership', 'proprietorship', 'pvtltd', 'person']
|
|
79
|
+
},
|
|
80
|
+
registeredAddress: {
|
|
81
|
+
type: String,
|
|
82
|
+
},
|
|
83
|
+
headQuarters: {
|
|
84
|
+
type: String,
|
|
85
|
+
},
|
|
86
|
+
website: {
|
|
87
|
+
type: String,
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
},
|
|
91
|
+
billingDetails: {
|
|
92
|
+
tradeName: {
|
|
93
|
+
type: String,
|
|
94
|
+
},
|
|
95
|
+
gstNumber: {
|
|
96
|
+
type: String,
|
|
97
|
+
},
|
|
98
|
+
authorityName: {
|
|
99
|
+
type: String,
|
|
100
|
+
},
|
|
101
|
+
authorityEmail: {
|
|
102
|
+
type: String,
|
|
103
|
+
},
|
|
104
|
+
billingAddress: {
|
|
105
|
+
type: String,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
signatoryDetail: {
|
|
109
|
+
name: {
|
|
110
|
+
type: String,
|
|
111
|
+
},
|
|
112
|
+
email: {
|
|
113
|
+
type: String,
|
|
114
|
+
},
|
|
115
|
+
number: {
|
|
116
|
+
type: String,
|
|
117
|
+
},
|
|
118
|
+
designation: {
|
|
119
|
+
type: String,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
ticketConfigs: {
|
|
123
|
+
installationReAssign: {
|
|
124
|
+
type: Number,
|
|
125
|
+
default:0
|
|
126
|
+
},
|
|
127
|
+
downTimeType: {
|
|
128
|
+
type: Number, // 0 for one camera and 1 for multi cameras
|
|
129
|
+
enum:[0,1]
|
|
130
|
+
},
|
|
131
|
+
infraDownTime: {
|
|
132
|
+
type: Number,
|
|
133
|
+
default:60,
|
|
134
|
+
enum:[60,120,180,240,300,360,420,480,540,600,660,720]
|
|
135
|
+
},
|
|
136
|
+
MinFilesCount:{
|
|
137
|
+
type: Number,
|
|
138
|
+
default:0
|
|
139
|
+
},
|
|
140
|
+
rcaTicketAssign:{// root cause anlysis
|
|
141
|
+
type: Number,
|
|
142
|
+
enum:[1,2,3,4,5,6,8,9,10,11,12]
|
|
143
|
+
},
|
|
144
|
+
refreshAlert:{
|
|
145
|
+
type: Number,
|
|
146
|
+
default:1,
|
|
147
|
+
enum:[0,1,2,3,4,5,6,8,9,10]
|
|
148
|
+
},
|
|
149
|
+
statusCheckAlert:{
|
|
150
|
+
type: Number,
|
|
151
|
+
default:1,
|
|
152
|
+
enum:[1,2,3,4,5,6,8,9,10,11,12]
|
|
153
|
+
},
|
|
154
|
+
accuracyPercentage: {
|
|
155
|
+
type: Number, // in less than
|
|
156
|
+
},
|
|
157
|
+
reTrain: {
|
|
158
|
+
type: Number, // calculate no of past days
|
|
159
|
+
enum:[1,2,3,4,5,6,8,9,10,11,12]
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
},
|
|
163
|
+
reportConfigs: {
|
|
164
|
+
report: {
|
|
165
|
+
type: Boolean,
|
|
166
|
+
},
|
|
167
|
+
reportName: {
|
|
168
|
+
type: String,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
assignedUsers: {
|
|
172
|
+
csm: {
|
|
173
|
+
type: Object,
|
|
174
|
+
},
|
|
175
|
+
ops: {
|
|
176
|
+
type: Array,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
ssoLogin: {
|
|
180
|
+
isEnable: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default: false,
|
|
183
|
+
},
|
|
184
|
+
domaiName: {
|
|
185
|
+
type: Array,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
featureConfigs: {
|
|
189
|
+
open: {
|
|
190
|
+
type: String,
|
|
191
|
+
},
|
|
192
|
+
close: {
|
|
193
|
+
type: String,
|
|
194
|
+
},
|
|
195
|
+
infraAlert: {
|
|
196
|
+
condition: {
|
|
197
|
+
type: String,
|
|
198
|
+
},
|
|
199
|
+
value: {
|
|
200
|
+
type: Number,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
bouncedLimit: {
|
|
204
|
+
condition: {
|
|
205
|
+
type: String,
|
|
206
|
+
},
|
|
207
|
+
value: {
|
|
208
|
+
type: Number,
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
missedOpportunity: {
|
|
212
|
+
condition: {
|
|
213
|
+
type: String,
|
|
214
|
+
},
|
|
215
|
+
value: {
|
|
216
|
+
type: Number,
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
conversion: {
|
|
220
|
+
condition: {
|
|
221
|
+
type: String,
|
|
222
|
+
},
|
|
223
|
+
value: {
|
|
224
|
+
type: Number,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
billableCalculation: {
|
|
228
|
+
type: String,
|
|
229
|
+
},
|
|
230
|
+
missedOpportunityCalculation: {
|
|
231
|
+
type: String,
|
|
232
|
+
},
|
|
233
|
+
conversionCalculation: {
|
|
234
|
+
type: String,
|
|
235
|
+
},
|
|
236
|
+
isNormalized: {
|
|
237
|
+
type: Boolean,
|
|
238
|
+
default: false,
|
|
239
|
+
},
|
|
240
|
+
isPasserByData: {
|
|
241
|
+
type: Boolean,
|
|
242
|
+
default: false,
|
|
243
|
+
},
|
|
244
|
+
isFootfallDirectory: {
|
|
245
|
+
type: Boolean,
|
|
246
|
+
default: false,
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
document: {
|
|
250
|
+
addressProof: {
|
|
251
|
+
path: {
|
|
252
|
+
type: String,
|
|
253
|
+
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
gst: {
|
|
257
|
+
number: {
|
|
258
|
+
type: String,
|
|
259
|
+
},
|
|
260
|
+
path: {
|
|
261
|
+
type: String,
|
|
262
|
+
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
pan: {
|
|
266
|
+
number: {
|
|
267
|
+
type: String,
|
|
268
|
+
},
|
|
269
|
+
path: {
|
|
270
|
+
type: String,
|
|
271
|
+
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
cin: {
|
|
275
|
+
number: {
|
|
276
|
+
type: String,
|
|
277
|
+
},
|
|
278
|
+
path: {
|
|
279
|
+
type: String,
|
|
280
|
+
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
strict: true,
|
|
288
|
+
versionKey: false,
|
|
289
|
+
timestamps: true,
|
|
290
|
+
},
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
client.plugin( mongooseUniqueValidator );
|
|
294
|
+
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 , 'countryCodes');
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import mongooseUniqueValidator from 'mongoose-unique-validator';
|
|
3
|
+
|
|
4
|
+
const edgeAppVersion = new mongoose.Schema(
|
|
5
|
+
{
|
|
6
|
+
appVersion: {
|
|
7
|
+
type: String,
|
|
8
|
+
unique: true,
|
|
9
|
+
},
|
|
10
|
+
isActive: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: true,
|
|
13
|
+
},
|
|
14
|
+
isDefault: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
strict: true,
|
|
21
|
+
versionKey: false,
|
|
22
|
+
timestamps: true,
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
edgeAppVersion.plugin( mongooseUniqueValidator );
|
|
27
|
+
export default mongoose.model( 'edgeappVersion', edgeAppVersion, 'edgeappVersion' );
|
package/schema/lead.model.js
CHANGED
|
@@ -1,76 +1,75 @@
|
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
+
},
|
|
27
|
+
mobileNumber: {
|
|
28
|
+
type: Number,
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
password: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
planDetails: {
|
|
36
|
+
totalStores: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
storeSize: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
totalCamera: {
|
|
45
|
+
type: Number,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
subscriptionPeriod: {
|
|
49
|
+
type: String,
|
|
50
|
+
enum: [ 'monthly', 'quarterly', 'annual' ],
|
|
51
|
+
},
|
|
52
|
+
subscriptionType: {
|
|
53
|
+
type: String,
|
|
54
|
+
enum: [ 'free', 'premium', 'enterprise' ],
|
|
55
|
+
},
|
|
56
|
+
product: {
|
|
57
|
+
type: Array,
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
},
|
|
61
|
+
status: {
|
|
62
|
+
type: String,
|
|
63
|
+
enum: [ 'pending', 'rejected', 'approved' ],
|
|
64
|
+
default: 'pending',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
strict: true,
|
|
69
|
+
versionKey: false,
|
|
70
|
+
timestamps: true,
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
lead.plugin( mongooseUniqueValidator );
|
|
75
|
+
export default mongoose.model( 'lead', lead );
|
package/schema/otp.model.js
CHANGED
|
@@ -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 );
|
package/schema/store.model.js
CHANGED
|
@@ -1,108 +1,126 @@
|
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
type: String,
|
|
83
|
-
required: true,
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
type: String,
|
|
87
|
-
required: true,
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
type: String,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
+
status: {
|
|
69
|
+
type: String,
|
|
70
|
+
enum: ['active','suspend','deactive']
|
|
71
|
+
},
|
|
72
|
+
edge: {
|
|
73
|
+
camDetails: {
|
|
74
|
+
cameras: {
|
|
75
|
+
type: String,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
spocDetails: [
|
|
80
|
+
{
|
|
81
|
+
name: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: true,
|
|
84
|
+
},
|
|
85
|
+
email: {
|
|
86
|
+
type: String,
|
|
87
|
+
required: true,
|
|
88
|
+
},
|
|
89
|
+
contact: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: true,
|
|
92
|
+
},
|
|
93
|
+
designation: {
|
|
94
|
+
type: String,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
storeConnectionId: {
|
|
99
|
+
type: String,
|
|
100
|
+
},
|
|
101
|
+
auditConfigs:{
|
|
102
|
+
count: {
|
|
103
|
+
type: Number,
|
|
104
|
+
default: 200,
|
|
105
|
+
},
|
|
106
|
+
iteration: {
|
|
107
|
+
type: Number,
|
|
108
|
+
default: 1,
|
|
109
|
+
},
|
|
110
|
+
ratio: {
|
|
111
|
+
type: mongoose.Schema.Types.Number,
|
|
112
|
+
default: 0.75,
|
|
113
|
+
},
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
strict: true,
|
|
118
|
+
versionKey: false,
|
|
119
|
+
timestamps: true,
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
store.index( { storeId: 1, clientId: 1, appId: 1 } );
|
|
124
|
+
store.plugin( mongooseUniqueValidator );
|
|
125
|
+
|
|
108
126
|
export default mongoose.model( 'store', store );
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import mongooseUniqueValidator from 'mongoose-unique-validator';
|
|
3
|
+
|
|
4
|
+
const user = new mongoose.Schema(
|
|
5
|
+
{
|
|
6
|
+
userName: {
|
|
7
|
+
type: String,
|
|
8
|
+
},
|
|
9
|
+
email: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
unique: true,
|
|
13
|
+
},
|
|
14
|
+
countryCode: {
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
mobileNumber: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
role: {
|
|
22
|
+
type: String,
|
|
23
|
+
enum: [ 'superAdmin', 'Admin', 'user' ],
|
|
24
|
+
default: 'user',
|
|
25
|
+
},
|
|
26
|
+
isActive: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
Assigned: {
|
|
31
|
+
type: {
|
|
32
|
+
type: String,
|
|
33
|
+
enum: [ 'store', 'group' ],
|
|
34
|
+
},
|
|
35
|
+
list: {
|
|
36
|
+
type: Array,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
permission: [
|
|
40
|
+
{
|
|
41
|
+
featureName: {
|
|
42
|
+
type: String,
|
|
43
|
+
},
|
|
44
|
+
product: [
|
|
45
|
+
{
|
|
46
|
+
name: {
|
|
47
|
+
type: String,
|
|
48
|
+
},
|
|
49
|
+
isView: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
},
|
|
52
|
+
isEdit: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
},
|
|
55
|
+
isDownload: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
},
|
|
58
|
+
isDelete: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
strict: true,
|
|
68
|
+
versionKey: false,
|
|
69
|
+
timestamps: true,
|
|
70
|
+
},
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
user.plugin( mongooseUniqueValidator );
|
|
74
|
+
export default mongoose.model( 'user', user );
|