tango-api-schema 1.0.19 → 1.0.21

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/schema/brand.model.js +429 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -4,18 +4,436 @@
4
4
  */
5
5
 
6
6
  // NPM Modules
7
- import mongoose from "mongoose";
8
- import uniqueValidator from "mongoose-unique-validator";
7
+ import mongoose from 'mongoose';
8
+ import uniqueValidator from 'mongoose-unique-validator';
9
9
 
10
10
  // schema
11
- const brandSchema = new mongoose.Schema(
12
- {},
13
- {
14
- strict: true,
15
- versionKey: false,
16
- }
17
- );
11
+ const brandSchema =
12
+ new mongoose.Schema(
13
+ {
14
+ brandName: {
15
+ type: String,
16
+ trim: true,
17
+ required: true,
18
+ unique: true,
19
+ },
20
+ brandIndex: {
21
+ type: Number,
22
+ },
23
+ client_id: {
24
+ type: String,
25
+ trim: true,
26
+ },
27
+ firstName: {
28
+ type: String,
29
+ trim: true,
30
+ },
31
+ lastName: {
32
+ type: String,
33
+ trim: true,
34
+ },
35
+ phone: {
36
+ type: String,
37
+ trim: true,
38
+ required: true,
39
+ unique: true,
40
+ },
41
+ email: {
42
+ type: String,
43
+ trim: true,
44
+ required: true,
45
+ unique: true,
46
+ },
47
+ active: {
48
+ type: Boolean,
49
+ default: true,
50
+ },
51
+ createdAt: {
52
+ type: Date,
53
+ default: Date.now,
54
+ },
55
+ updatedAt: {
56
+ type: Date,
57
+ default: Date.now,
58
+ },
59
+ userId: {
60
+ type: mongoose.Schema.Types.ObjectId,
61
+ ref: 'User',
62
+ },
63
+ dialCode: {
64
+ type: String,
65
+ trim: true,
66
+ },
67
+ name: {
68
+ type: String,
69
+ trim: true,
70
+ },
71
+ registeredCompanyName: {
72
+ type: String,
73
+ trim: true,
74
+ },
75
+ brandLogo: {
76
+ type: String,
77
+ trim: true,
78
+ },
79
+ brandConfigs: {
80
+ livetickets: { // live needs to create for a day
81
+ type: Boolean,
82
+ default: false,
83
+ },
84
+ infratickets: { // infratickets needs to create for a day
85
+ type: Boolean,
86
+ default: false,
87
+ },
88
+ liveconfig: { // live one - Every 1 hour, three - every three hour
89
+ type: String,
90
+ trim: true,
91
+ },
92
+ ReInstallation: { // number of days installtion ticket reasign to other user if user hold it for ReInstallation Date
93
+ type: Number,
94
+ default: 0,
95
+ },
96
+ infraLimit: { // Downtime limit for crating ticket
97
+ type: Number,
98
+ },
99
+ autoGenerateDays: { // if its 2 day downtime is past two days reach the infralimit then will need to create ticket
100
+ type: Number,
101
+ },
102
+ downtimeConsiderCameraCount: { // consider downtime calculation one or All camara
103
+ type: String,
104
+ },
105
+ storeOpenTime: {
106
+ type: String,
107
+ default: '10:00:00',
108
+ },
109
+ storeCloseTime: {
110
+ type: String,
111
+ default: '22:00:00',
112
+ },
113
+ infraAlert: {
114
+ condition: {
115
+ type: String,
116
+ default: '<',
117
+ },
118
+ value: {
119
+ type: String,
120
+ default: '1',
121
+ },
122
+ },
123
+ bouncedConfigTime: {
124
+ type: String,
125
+ default: '<=1',
126
+ },
127
+ missedOpportunityStartTime: {
128
+ type: String,
129
+ default: '>1',
130
+ },
131
+ missedOpportunityEndTime: {
132
+ type: String,
133
+ default: '<=5',
134
+ },
135
+ conversionConfigTime: {
136
+ type: String,
137
+ default: '>5',
138
+ },
139
+ missedOpportunityCalculate: {
140
+ type: String,
141
+ enum: [ 'engagers-conversion', 'group-conversion' ],
142
+ default: 'engagers-conversion',
143
+ },
144
+ conversionCalculate: {
145
+ type: String,
146
+ enum: [ 'footfall-count', 'engagers-count' ],
147
+ default: 'engagers-count',
148
+ },
149
+ billableCalculate: {
150
+ type: String,
151
+ enum: [ 'footfall-count', 'engagers-count' ],
152
+ default: 'engagers-count',
153
+ },
154
+ notifications: {
155
+ email: {
156
+ type: Boolean,
157
+ },
158
+ application: {
159
+ type: Boolean,
160
+ },
161
+ },
18
162
 
19
- brandSchema.plugin(uniqueValidator);
163
+ allowChanges: {
164
+ type: Boolean,
165
+ },
166
+ report_time: {
167
+ type: String,
168
+ },
169
+ normalized_data: {
170
+ type: Boolean,
171
+ default: true,
172
+ },
173
+ normalized_downtime: {
174
+ type: Number,
175
+ default: 300,
176
+ },
177
+ },
178
+ industry: {
179
+ type: String,
180
+ trim: true,
181
+ },
182
+ subIndustry: {
183
+ type: String,
184
+ trim: true,
185
+ },
186
+ storeType: {
187
+ type: String,
188
+ trim: true,
189
+ },
190
+ headQuarters: {
191
+ type: String,
192
+ trim: true,
193
+ },
194
+ numberofOutlets: {
195
+ type: String,
196
+ trim: true,
197
+ },
198
+ cameraCount: {
199
+ type: String,
200
+ trim: true,
201
+ },
202
+ productsavgPrice: {
203
+ type: String,
204
+ trim: true,
205
+ },
206
+ CINNumber: {
207
+ type: String,
208
+ trim: true,
209
+ },
210
+ registeredAddress: {
211
+ type: String,
212
+ trim: true,
213
+ },
214
+ first_user: {
215
+ type: Number,
216
+ default: 0,
217
+ },
218
+ payment_status: {
219
+ type: Boolean,
220
+ default: false,
221
+ },
222
+ uploadLimit: {
223
+ user: {
224
+ type: Number,
225
+ default: 10,
226
+ },
227
+ store: {
228
+ type: Number,
229
+ default: 10,
230
+ },
231
+ },
232
+ DownloadLimit: {
233
+ type: Number,
234
+ default: 0,
235
+ },
236
+ website: {
237
+ type: String,
238
+ },
239
+ apiKey: {
240
+ type: String,
241
+ default: null,
242
+ },
243
+ allowedIps: {
244
+ type: Array,
245
+ default: [ '*' ],
246
+ },
247
+ clientStatus: {
248
+ type: String,
249
+ enum: [ 'pending', 'live', 'hold', 'suspended', 'deactivated', 'rejected' ],
250
+ default: 'pending',
251
+ trim: true,
252
+ },
253
+ client_type: {
254
+ type: String,
255
+ enum: [ 'free', 'trial', 'paid' ],
256
+ trim: true,
257
+ default: 'trial',
258
+ },
259
+ expired_date: {
260
+ type: Date,
261
+ },
262
+ framesRate: {
263
+ type: Number,
264
+ },
265
+ configBannerFlag: {
266
+ type: Boolean,
267
+ default: true,
268
+ },
269
+ controlroom: {
270
+ type: Boolean,
271
+ default: false,
272
+ },
273
+ trade: {
274
+ type: String,
275
+ },
276
+ country: {
277
+ type: String,
278
+ },
279
+ activeMenu: {
280
+ type: Array,
281
+ default: [ 'birdsEye', 'tangoTraffic', 'tangoZone', 'controlRoom', 'tangoRevOp', 'tangoStoreOps', 'infraHealth', 'reports', 'Support', 'footFallDirectory', 'permissions' ],
282
+ },
283
+ isdeletedbrand: {
284
+ type: Boolean,
285
+ default: false,
286
+ },
287
+ planType: {
288
+ type: String,
289
+ enum: [ 'monthly', 'half_yearly', 'annual' ],
290
+ default: 'monthly',
291
+ },
292
+ storeCount: {
293
+ type: String,
294
+ },
295
+ squareFeet: {
296
+ type: String,
297
+ },
298
+ subscription: {
299
+ type: String,
300
+ enum: [ '', 'free', 'free_trial', 'premium', 'enterprise' ],
301
+ default: '',
302
+ },
303
+ subscription_start_date: {
304
+ type: Date,
305
+ },
306
+ subscription_status: {
307
+ type: Boolean,
308
+ default: false,
309
+ },
310
+ store_added_status: { // if it is true after add a store against brand
311
+ type: Boolean,
312
+ default: false,
313
+ },
314
+ callBackTime: {
315
+ type: String,
316
+ },
317
+ message: {
318
+ type: String,
319
+ trim: true,
320
+ },
321
+ subscribed_features: {
322
+ tango_traffic: {
323
+ type: Boolean,
324
+ default: true,
325
+ },
326
+ tango_zone: {
327
+ type: Boolean,
328
+ default: false,
329
+ },
330
+ tango_revop: {
331
+ type: Boolean,
332
+ default: false,
333
+ },
334
+ tango_storeops: {
335
+ type: Boolean,
336
+ default: false,
337
+ },
338
+ controlroom: {
339
+ type: Boolean,
340
+ default: false,
341
+ },
342
+ live_data: {
343
+ type: Boolean,
344
+ default: false,
345
+ },
346
+ normalization_features: {
347
+ type: Boolean,
348
+ default: false,
349
+ },
350
+ actual_features: {
351
+ type: Boolean,
352
+ default: false,
353
+ },
354
+ },
355
+ terms_conditions: {
356
+ type: Boolean,
357
+ default: false,
358
+ },
359
+ otp_verified: {
360
+ type: Boolean,
361
+ default: false,
362
+ },
363
+ free_paused_date: {
364
+ type: Date,
365
+ },
366
+ price: {
367
+ type: Number,
368
+ },
369
+ currency_type: {
370
+ type: String,
371
+ },
372
+ upgrade_request: {
373
+ type: Object,
374
+ },
375
+ upgrade_request_status: {
376
+ type: Boolean,
377
+ default: false,
378
+ },
379
+ trial_status: {
380
+ type: Boolean,
381
+ default: false,
382
+ },
383
+ trial_expired: {
384
+ type: Boolean,
385
+ default: false,
386
+ },
387
+ trial_extend: {
388
+ type: Boolean,
389
+ default: false,
390
+ },
391
+ trial_paused: {
392
+ type: Boolean,
393
+ default: false,
394
+ },
395
+ lead_id: {
396
+ type: String,
397
+ trim: true,
398
+ },
399
+ reportConfigs: {
400
+ type: Object,
401
+ },
402
+ brandConfigs_updated_date: {
403
+ type: Date,
404
+ },
405
+
406
+ auditConfigs: {
407
+ count: {
408
+ type: Number,
409
+ default: 200,
410
+ },
411
+ audit: {
412
+ type: Boolean,
413
+ default: true,
414
+ },
415
+ default: {
416
+ type: Boolean,
417
+ default: true,
418
+ },
419
+ queueName: {
420
+ type: String,
421
+ default: '',
422
+ },
423
+ ratio: {
424
+ type: mongoose.Types.Decimal128,
425
+ default: 0.75,
426
+ },
427
+
428
+ },
429
+ },
430
+ {
431
+ strict: true,
432
+ versionKey: false,
433
+ },
434
+ );
435
+
436
+ brandSchema.plugin( uniqueValidator );
437
+
438
+ export default mongoose.model( 'Brand', brandSchema );
20
439
 
21
- export default mongoose.model("Brand", brandSchema);