tango-app-api-analysis-traffic 3.0.0-alpha.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/.eslintrc.cjs +41 -0
- package/README.md +29 -0
- package/app.js +40 -0
- package/index.js +6 -0
- package/package.json +36 -0
- package/src/controllers/tangoTraffic.controllers.js +2002 -0
- package/src/routes/traffic.routes.js +55 -0
- package/src/services/stores.service.js +9 -0
|
@@ -0,0 +1,2002 @@
|
|
|
1
|
+
import { logger } from 'tango-app-api-middleware';
|
|
2
|
+
import {
|
|
3
|
+
aggregateStore,
|
|
4
|
+
} from '../services/stores.service.js';
|
|
5
|
+
|
|
6
|
+
export const welcome = async ( req, res ) => {
|
|
7
|
+
try {
|
|
8
|
+
let result = {
|
|
9
|
+
'Message': 'Welcome',
|
|
10
|
+
};
|
|
11
|
+
return res.sendSuccess( result );
|
|
12
|
+
} catch ( error ) {
|
|
13
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
14
|
+
return res.sendError( { error: error }, 500 );
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const cardsFunnel = async ( req, res ) => {
|
|
19
|
+
try {
|
|
20
|
+
let reqestData = req.body;
|
|
21
|
+
// //Get Revenue form Client Collection and post to api
|
|
22
|
+
// reqestData.currency = 'INR';
|
|
23
|
+
// reqestData.revenue = '23000';
|
|
24
|
+
// let LamdaURL = 'https://55mojecvuvtphucgsalx5jtyki0untzp.lambda-url.ap-south-1.on.aws/';
|
|
25
|
+
// let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
26
|
+
// if ( resultData ) {
|
|
27
|
+
// const insideBrackets = resultData.status_code.match( /\[([^\]]+)\]/ )[1];
|
|
28
|
+
// if ( insideBrackets == 200 ) {
|
|
29
|
+
// let result = {};
|
|
30
|
+
// result.card = resultData.card;
|
|
31
|
+
// result.funnelChart = resultData.funnelChart;
|
|
32
|
+
// return res.sendSuccess( result );
|
|
33
|
+
// } else {
|
|
34
|
+
// return res.sendError( 'No Content', 204 );
|
|
35
|
+
// }
|
|
36
|
+
// } else {
|
|
37
|
+
// return res.sendError( 'No Content', 204 );
|
|
38
|
+
// }
|
|
39
|
+
|
|
40
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
41
|
+
if ( checkNoData ) {
|
|
42
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
46
|
+
if ( checkInvalidRequest ) {
|
|
47
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
51
|
+
if ( checkServerError ) {
|
|
52
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let result = {
|
|
56
|
+
'card': {
|
|
57
|
+
'footfall': { 'count': 100, 'rate': 89.5 },
|
|
58
|
+
'conversion': { 'count': 100, 'rate': 89.5 },
|
|
59
|
+
'bounced': { 'count': 100, 'rate': 89.5 },
|
|
60
|
+
'engagers': { 'count': 100, 'rate': 89.5 },
|
|
61
|
+
'missedopportunities': { 'count': 100, 'rate': 89.5 },
|
|
62
|
+
'revenue': {
|
|
63
|
+
'currency': 'INR', // ["INR","Dollar"]
|
|
64
|
+
'value': 30000,
|
|
65
|
+
},
|
|
66
|
+
'avgDwellTime': 89.5,
|
|
67
|
+
'avgDownTime': 89.5,
|
|
68
|
+
'potentialBuyers': {
|
|
69
|
+
'count': 40,
|
|
70
|
+
'rate': 40.0,
|
|
71
|
+
'potentialBuyersSingle': {
|
|
72
|
+
'count': 89,
|
|
73
|
+
'rate': 89.5,
|
|
74
|
+
'ageGroup': '20-30',
|
|
75
|
+
},
|
|
76
|
+
'potentialBuyersGroup': {
|
|
77
|
+
'count': 89,
|
|
78
|
+
'rate': 89.5,
|
|
79
|
+
'ageGroup': '20-30',
|
|
80
|
+
},
|
|
81
|
+
'potentialBuyersPersons': {
|
|
82
|
+
'count': 89,
|
|
83
|
+
'rate': 89.5,
|
|
84
|
+
'ageGroup': '20-30',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
'funnelChart': [
|
|
89
|
+
{ 'value': 100, 'category': 'Passer By', 'count': 11 }, // If Show only it's Single store
|
|
90
|
+
{ 'value': 100, 'category': 'Footfall', 'count': 11 },
|
|
91
|
+
{ 'value': 50, 'category': 'Engagers', 'count': 1 },
|
|
92
|
+
{ 'value': 40, 'category': 'Potential Buyers', 'count': 1 },
|
|
93
|
+
{ 'value': 30, 'category': 'Conversion', 'count': 1 },
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
return res.sendSuccess( result );
|
|
97
|
+
} catch ( error ) {
|
|
98
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
99
|
+
return res.sendError( { error: error }, 500 );
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const cardsGraphs = async ( req, res ) => {
|
|
104
|
+
try {
|
|
105
|
+
let reqestData = req.body;
|
|
106
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
107
|
+
if ( checkNoData ) {
|
|
108
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
112
|
+
if ( checkInvalidRequest ) {
|
|
113
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
117
|
+
if ( checkServerError ) {
|
|
118
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let result = {
|
|
122
|
+
'footfall': {
|
|
123
|
+
'PreviousData': 4,
|
|
124
|
+
'PreviousVariation': true, // ["true","false"]
|
|
125
|
+
'data': [
|
|
126
|
+
{ 'date': '2024-07-01', 'value': 20 },
|
|
127
|
+
{ 'date': '2024-07-02', 'value': 10 },
|
|
128
|
+
{ 'date': '2024-07-03', 'value': 30 },
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
'bounced': {
|
|
132
|
+
'PreviousData': 5,
|
|
133
|
+
'PreviousVariation': false,
|
|
134
|
+
'data': [
|
|
135
|
+
{ 'date': '2024-07-01', 'value': 20 },
|
|
136
|
+
{ 'date': '2024-07-02', 'value': 10 },
|
|
137
|
+
{ 'date': '2024-07-03', 'value': 30 },
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
'engagers': {
|
|
141
|
+
'PreviousData': 40,
|
|
142
|
+
'PreviousVariation': true,
|
|
143
|
+
'data': [
|
|
144
|
+
{ 'date': '2024-07-01', 'value': 20 },
|
|
145
|
+
{ 'date': '2024-07-02', 'value': 10 },
|
|
146
|
+
{ 'date': '2024-07-03', 'value': 30 },
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
'potentialBuyers': {
|
|
150
|
+
'PreviousData': 50,
|
|
151
|
+
'PreviousVariation': false,
|
|
152
|
+
'data': [
|
|
153
|
+
{ 'date': '2024-07-01', 'value': 20 },
|
|
154
|
+
{ 'date': '2024-07-02', 'value': 10 },
|
|
155
|
+
{ 'date': '2024-07-03', 'value': 30 },
|
|
156
|
+
],
|
|
157
|
+
'potentialBuyersSingle': {
|
|
158
|
+
'PreviousData': 4,
|
|
159
|
+
'PreviousVariation': true,
|
|
160
|
+
},
|
|
161
|
+
'potentialBuyersGroup': {
|
|
162
|
+
'PreviousData': 70,
|
|
163
|
+
'PreviousVariation': false,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
'conversion': {
|
|
167
|
+
'footfall': {
|
|
168
|
+
'count': 100,
|
|
169
|
+
'rate': 89.5,
|
|
170
|
+
'PreviousData': 48,
|
|
171
|
+
'PreviousVariation': true,
|
|
172
|
+
},
|
|
173
|
+
'engagers': {
|
|
174
|
+
'count': 100,
|
|
175
|
+
'rate': 89.5,
|
|
176
|
+
'PreviousData': 6,
|
|
177
|
+
'PreviousVariation': false,
|
|
178
|
+
},
|
|
179
|
+
'potentialBuyers': {
|
|
180
|
+
'count': 100,
|
|
181
|
+
'rate': 89.5,
|
|
182
|
+
'PreviousData': 84,
|
|
183
|
+
'PreviousVariation': true,
|
|
184
|
+
},
|
|
185
|
+
'nob': {
|
|
186
|
+
'count': 100,
|
|
187
|
+
'rate': 89.5,
|
|
188
|
+
'PreviousData': 70,
|
|
189
|
+
'PreviousVariation': false,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
'missedopportunities': {
|
|
193
|
+
'PreviousData': 4,
|
|
194
|
+
'PreviousVariation': true,
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
return res.sendSuccess( result );
|
|
198
|
+
} catch ( error ) {
|
|
199
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
200
|
+
return res.sendError( { error: error }, 500 );
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export const recapVideo = async ( req, res ) => {
|
|
205
|
+
try {
|
|
206
|
+
// let reqestData = req.body;
|
|
207
|
+
// let LamdaURL = 'https://u7xzph4jkl72sbefz2xx5rjw540rocck.lambda-url.ap-south-1.on.aws/';
|
|
208
|
+
// let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
209
|
+
// if ( resultData ) {
|
|
210
|
+
// const insideBrackets = resultData.status_code.match( /\[([^\]]+)\]/ )[1];
|
|
211
|
+
// if ( insideBrackets == 200 ) {
|
|
212
|
+
// let result = {};
|
|
213
|
+
// result.downTime = resultData.downTime || '0';
|
|
214
|
+
// result.dateString = resultData.dateSring || reqestData.toDate;
|
|
215
|
+
// result.health = resultData.health || 'GOOD';
|
|
216
|
+
// result.recapVideoData = resultData.recapVideoData || [];
|
|
217
|
+
// return res.sendSuccess( result );
|
|
218
|
+
// } else {
|
|
219
|
+
// return res.sendError( 'No Content', 204 );
|
|
220
|
+
// }
|
|
221
|
+
// } else {
|
|
222
|
+
// return res.sendError( 'No Content', 204 );
|
|
223
|
+
// }
|
|
224
|
+
let result = {
|
|
225
|
+
'downTime': 22,
|
|
226
|
+
'health': 'GOOD',
|
|
227
|
+
'recapVideoData': [
|
|
228
|
+
{ 'thumbImage': 'https://123', 'videoURL': 'https://123' },
|
|
229
|
+
{ 'thumbImage': 'https://123', 'videoURL': 'https://123' },
|
|
230
|
+
],
|
|
231
|
+
};
|
|
232
|
+
return res.sendSuccess( result );
|
|
233
|
+
} catch ( error ) {
|
|
234
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
235
|
+
return res.sendError( { error: error }, 500 );
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export const densityDwell = async ( req, res ) => {
|
|
240
|
+
try {
|
|
241
|
+
let reqestData = req.body;
|
|
242
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
243
|
+
if ( checkNoData ) {
|
|
244
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
248
|
+
if ( checkInvalidRequest ) {
|
|
249
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
253
|
+
if ( checkServerError ) {
|
|
254
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
let result = {
|
|
258
|
+
'densityDwellCard': {
|
|
259
|
+
'busiestDay': 'Sunday',
|
|
260
|
+
'busiestTime': '05-06 PM',
|
|
261
|
+
'avgDwellTime': 22,
|
|
262
|
+
'maleRate': 50,
|
|
263
|
+
'femaleRate': 50,
|
|
264
|
+
},
|
|
265
|
+
'trafficDencity': {
|
|
266
|
+
'00:00': [
|
|
267
|
+
{
|
|
268
|
+
'time': '00:00',
|
|
269
|
+
'day': 'Sun',
|
|
270
|
+
'footfallCount': 10,
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
'time': '00:00',
|
|
274
|
+
'day': 'Mon',
|
|
275
|
+
'footfallCount': 10,
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
'time': '00:00',
|
|
279
|
+
'day': 'Tue',
|
|
280
|
+
'footfallCount': 10,
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
'time': '00:00',
|
|
284
|
+
'day': 'Wed',
|
|
285
|
+
'footfallCount': 10,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
'time': '00:00',
|
|
289
|
+
'day': 'Thu',
|
|
290
|
+
'footfallCount': 10,
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
'time': '00:00',
|
|
294
|
+
'day': 'Fri',
|
|
295
|
+
'footfallCount': 10,
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
'time': '00:00',
|
|
299
|
+
'day': 'Sat',
|
|
300
|
+
'footfallCount': 10,
|
|
301
|
+
},
|
|
302
|
+
],
|
|
303
|
+
'01:00': [
|
|
304
|
+
{
|
|
305
|
+
'time': '01:00',
|
|
306
|
+
'day': 'Sun',
|
|
307
|
+
'footfallCount': 10,
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
'time': '01:00',
|
|
311
|
+
'day': 'Mon',
|
|
312
|
+
'footfallCount': 10,
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
'time': '01:00',
|
|
316
|
+
'day': 'Tue',
|
|
317
|
+
'footfallCount': 10,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
'time': '01:00',
|
|
321
|
+
'day': 'Wed',
|
|
322
|
+
'footfallCount': 10,
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
'time': '01:00',
|
|
326
|
+
'day': 'Thu',
|
|
327
|
+
'footfallCount': 10,
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
'time': '01:00',
|
|
331
|
+
'day': 'Fri',
|
|
332
|
+
'footfallCount': 10,
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
'time': '01:00',
|
|
336
|
+
'day': 'Sat',
|
|
337
|
+
'footfallCount': 10,
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
'02:00': [
|
|
341
|
+
{
|
|
342
|
+
'time': '02:00',
|
|
343
|
+
'day': 'Sun',
|
|
344
|
+
'footfallCount': 10,
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
'time': '02:00',
|
|
348
|
+
'day': 'Mon',
|
|
349
|
+
'footfallCount': 10,
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
'time': '02:00',
|
|
353
|
+
'day': 'Tue',
|
|
354
|
+
'footfallCount': 10,
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
'time': '02:00',
|
|
358
|
+
'day': 'Wed',
|
|
359
|
+
'footfallCount': 10,
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
'time': '02:00',
|
|
363
|
+
'day': 'Thu',
|
|
364
|
+
'footfallCount': 10,
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
'time': '02:00',
|
|
368
|
+
'day': 'Fri',
|
|
369
|
+
'footfallCount': 10,
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
'time': '02:00',
|
|
373
|
+
'day': 'Sat',
|
|
374
|
+
'footfallCount': 10,
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
'03:00': [
|
|
378
|
+
{
|
|
379
|
+
'time': '03:00',
|
|
380
|
+
'day': 'Sun',
|
|
381
|
+
'footfallCount': 10,
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
'time': '03:00',
|
|
385
|
+
'day': 'Mon',
|
|
386
|
+
'footfallCount': 10,
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
'time': '03:00',
|
|
390
|
+
'day': 'Tue',
|
|
391
|
+
'footfallCount': 10,
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
'time': '03:00',
|
|
395
|
+
'day': 'Wed',
|
|
396
|
+
'footfallCount': 10,
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
'time': '03:00',
|
|
400
|
+
'day': 'Thu',
|
|
401
|
+
'footfallCount': 10,
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
'time': '03:00',
|
|
405
|
+
'day': 'Fri',
|
|
406
|
+
'footfallCount': 10,
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
'time': '03:00',
|
|
410
|
+
'day': 'Sat',
|
|
411
|
+
'footfallCount': 10,
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
'04:00': [
|
|
415
|
+
{
|
|
416
|
+
'time': '04:00',
|
|
417
|
+
'day': 'Sun',
|
|
418
|
+
'footfallCount': 10,
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
'time': '04:00',
|
|
422
|
+
'day': 'Mon',
|
|
423
|
+
'footfallCount': 10,
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
'time': '04:00',
|
|
427
|
+
'day': 'Tue',
|
|
428
|
+
'footfallCount': 10,
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
'time': '04:00',
|
|
432
|
+
'day': 'Wed',
|
|
433
|
+
'footfallCount': 10,
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
'time': '04:00',
|
|
437
|
+
'day': 'Thu',
|
|
438
|
+
'footfallCount': 10,
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
'time': '04:00',
|
|
442
|
+
'day': 'Fri',
|
|
443
|
+
'footfallCount': 10,
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
'time': '04:00',
|
|
447
|
+
'day': 'Sat',
|
|
448
|
+
'footfallCount': 10,
|
|
449
|
+
},
|
|
450
|
+
],
|
|
451
|
+
'05:00': [
|
|
452
|
+
{
|
|
453
|
+
'time': '05:00',
|
|
454
|
+
'day': 'Sun',
|
|
455
|
+
'footfallCount': 10,
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
'time': '05:00',
|
|
459
|
+
'day': 'Mon',
|
|
460
|
+
'footfallCount': 10,
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
'time': '05:00',
|
|
464
|
+
'day': 'Tue',
|
|
465
|
+
'footfallCount': 10,
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
'time': '05:00',
|
|
469
|
+
'day': 'Wed',
|
|
470
|
+
'footfallCount': 10,
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
'time': '05:00',
|
|
474
|
+
'day': 'Thu',
|
|
475
|
+
'footfallCount': 10,
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
'time': '05:00',
|
|
479
|
+
'day': 'Fri',
|
|
480
|
+
'footfallCount': 10,
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
'time': '05:00',
|
|
484
|
+
'day': 'Sat',
|
|
485
|
+
'footfallCount': 10,
|
|
486
|
+
},
|
|
487
|
+
],
|
|
488
|
+
'06:00': [
|
|
489
|
+
{
|
|
490
|
+
'time': '06:00',
|
|
491
|
+
'day': 'Sun',
|
|
492
|
+
'footfallCount': 10,
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
'time': '06:00',
|
|
496
|
+
'day': 'Mon',
|
|
497
|
+
'footfallCount': 10,
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
'time': '06:00',
|
|
501
|
+
'day': 'Tue',
|
|
502
|
+
'footfallCount': 10,
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
'time': '06:00',
|
|
506
|
+
'day': 'Wed',
|
|
507
|
+
'footfallCount': 10,
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
'time': '06:00',
|
|
511
|
+
'day': 'Thu',
|
|
512
|
+
'footfallCount': 10,
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
'time': '06:00',
|
|
516
|
+
'day': 'Fri',
|
|
517
|
+
'footfallCount': 10,
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
'time': '06:00',
|
|
521
|
+
'day': 'Sat',
|
|
522
|
+
'footfallCount': 10,
|
|
523
|
+
},
|
|
524
|
+
],
|
|
525
|
+
'07:00': [
|
|
526
|
+
{
|
|
527
|
+
'time': '07:00',
|
|
528
|
+
'day': 'Sun',
|
|
529
|
+
'footfallCount': 10,
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
'time': '07:00',
|
|
533
|
+
'day': 'Mon',
|
|
534
|
+
'footfallCount': 10,
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
'time': '07:00',
|
|
538
|
+
'day': 'Tue',
|
|
539
|
+
'footfallCount': 10,
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
'time': '07:00',
|
|
543
|
+
'day': 'Wed',
|
|
544
|
+
'footfallCount': 10,
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
'time': '07:00',
|
|
548
|
+
'day': 'Thu',
|
|
549
|
+
'footfallCount': 10,
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
'time': '07:00',
|
|
553
|
+
'day': 'Fri',
|
|
554
|
+
'footfallCount': 10,
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
'time': '07:00',
|
|
558
|
+
'day': 'Sat',
|
|
559
|
+
'footfallCount': 10,
|
|
560
|
+
},
|
|
561
|
+
],
|
|
562
|
+
'08:00': [
|
|
563
|
+
{
|
|
564
|
+
'time': '08:00',
|
|
565
|
+
'day': 'Sun',
|
|
566
|
+
'footfallCount': 10,
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
'time': '08:00',
|
|
570
|
+
'day': 'Mon',
|
|
571
|
+
'footfallCount': 10,
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
'time': '08:00',
|
|
575
|
+
'day': 'Tue',
|
|
576
|
+
'footfallCount': 10,
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
'time': '08:00',
|
|
580
|
+
'day': 'Wed',
|
|
581
|
+
'footfallCount': 10,
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
'time': '08:00',
|
|
585
|
+
'day': 'Thu',
|
|
586
|
+
'footfallCount': 10,
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
'time': '08:00',
|
|
590
|
+
'day': 'Fri',
|
|
591
|
+
'footfallCount': 10,
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
'time': '08:00',
|
|
595
|
+
'day': 'Sat',
|
|
596
|
+
'footfallCount': 10,
|
|
597
|
+
},
|
|
598
|
+
],
|
|
599
|
+
'09:00': [
|
|
600
|
+
{
|
|
601
|
+
'time': '09:00',
|
|
602
|
+
'day': 'Sun',
|
|
603
|
+
'footfallCount': 10,
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
'time': '09:00',
|
|
607
|
+
'day': 'Mon',
|
|
608
|
+
'footfallCount': 10,
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
'time': '09:00',
|
|
612
|
+
'day': 'Tue',
|
|
613
|
+
'footfallCount': 10,
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
'time': '09:00',
|
|
617
|
+
'day': 'Wed',
|
|
618
|
+
'footfallCount': 10,
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
'time': '09:00',
|
|
622
|
+
'day': 'Thu',
|
|
623
|
+
'footfallCount': 10,
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
'time': '09:00',
|
|
627
|
+
'day': 'Fri',
|
|
628
|
+
'footfallCount': 10,
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
'time': '09:00',
|
|
632
|
+
'day': 'Sat',
|
|
633
|
+
'footfallCount': 10,
|
|
634
|
+
},
|
|
635
|
+
],
|
|
636
|
+
'10:00': [
|
|
637
|
+
{
|
|
638
|
+
'time': '10:00',
|
|
639
|
+
'day': 'Sun',
|
|
640
|
+
'footfallCount': 10,
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
'time': '10:00',
|
|
644
|
+
'day': 'Mon',
|
|
645
|
+
'footfallCount': 10,
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
'time': '10:00',
|
|
649
|
+
'day': 'Tue',
|
|
650
|
+
'footfallCount': 10,
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
'time': '10:00',
|
|
654
|
+
'day': 'Wed',
|
|
655
|
+
'footfallCount': 10,
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
'time': '10:00',
|
|
659
|
+
'day': 'Thu',
|
|
660
|
+
'footfallCount': 10,
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
'time': '10:00',
|
|
664
|
+
'day': 'Fri',
|
|
665
|
+
'footfallCount': 10,
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
'time': '10:00',
|
|
669
|
+
'day': 'Sat',
|
|
670
|
+
'footfallCount': 10,
|
|
671
|
+
},
|
|
672
|
+
],
|
|
673
|
+
'11:00': [
|
|
674
|
+
{
|
|
675
|
+
'time': '11:00',
|
|
676
|
+
'day': 'Sun',
|
|
677
|
+
'footfallCount': 10,
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
'time': '11:00',
|
|
681
|
+
'day': 'Mon',
|
|
682
|
+
'footfallCount': 10,
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
'time': '11:00',
|
|
686
|
+
'day': 'Tue',
|
|
687
|
+
'footfallCount': 10,
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
'time': '11:00',
|
|
691
|
+
'day': 'Wed',
|
|
692
|
+
'footfallCount': 10,
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
'time': '11:00',
|
|
696
|
+
'day': 'Thu',
|
|
697
|
+
'footfallCount': 10,
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
'time': '11:00',
|
|
701
|
+
'day': 'Fri',
|
|
702
|
+
'footfallCount': 10,
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
'time': '11:00',
|
|
706
|
+
'day': 'Sat',
|
|
707
|
+
'footfallCount': 10,
|
|
708
|
+
},
|
|
709
|
+
],
|
|
710
|
+
'12:00': [
|
|
711
|
+
{
|
|
712
|
+
'time': '12:00',
|
|
713
|
+
'day': 'Sun',
|
|
714
|
+
'footfallCount': 10,
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
'time': '12:00',
|
|
718
|
+
'day': 'Mon',
|
|
719
|
+
'footfallCount': 10,
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
'time': '12:00',
|
|
723
|
+
'day': 'Tue',
|
|
724
|
+
'footfallCount': 10,
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
'time': '12:00',
|
|
728
|
+
'day': 'Wed',
|
|
729
|
+
'footfallCount': 10,
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
'time': '12:00',
|
|
733
|
+
'day': 'Thu',
|
|
734
|
+
'footfallCount': 10,
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
'time': '12:00',
|
|
738
|
+
'day': 'Fri',
|
|
739
|
+
'footfallCount': 10,
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
'time': '12:00',
|
|
743
|
+
'day': 'Sat',
|
|
744
|
+
'footfallCount': 10,
|
|
745
|
+
},
|
|
746
|
+
],
|
|
747
|
+
'13:00': [
|
|
748
|
+
{
|
|
749
|
+
'time': '13:00',
|
|
750
|
+
'day': 'Sun',
|
|
751
|
+
'footfallCount': 10,
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
'time': '13:00',
|
|
755
|
+
'day': 'Mon',
|
|
756
|
+
'footfallCount': 10,
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
'time': '13:00',
|
|
760
|
+
'day': 'Tue',
|
|
761
|
+
'footfallCount': 10,
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
'time': '13:00',
|
|
765
|
+
'day': 'Wed',
|
|
766
|
+
'footfallCount': 10,
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
'time': '13:00',
|
|
770
|
+
'day': 'Thu',
|
|
771
|
+
'footfallCount': 10,
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
'time': '13:00',
|
|
775
|
+
'day': 'Fri',
|
|
776
|
+
'footfallCount': 10,
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
'time': '13:00',
|
|
780
|
+
'day': 'Sat',
|
|
781
|
+
'footfallCount': 10,
|
|
782
|
+
},
|
|
783
|
+
],
|
|
784
|
+
'14:00': [
|
|
785
|
+
{
|
|
786
|
+
'time': '14:00',
|
|
787
|
+
'day': 'Sun',
|
|
788
|
+
'footfallCount': 10,
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
'time': '14:00',
|
|
792
|
+
'day': 'Mon',
|
|
793
|
+
'footfallCount': 10,
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
'time': '14:00',
|
|
797
|
+
'day': 'Tue',
|
|
798
|
+
'footfallCount': 10,
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
'time': '14:00',
|
|
802
|
+
'day': 'Wed',
|
|
803
|
+
'footfallCount': 10,
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
'time': '14:00',
|
|
807
|
+
'day': 'Thu',
|
|
808
|
+
'footfallCount': 10,
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
'time': '14:00',
|
|
812
|
+
'day': 'Fri',
|
|
813
|
+
'footfallCount': 10,
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
'time': '14:00',
|
|
817
|
+
'day': 'Sat',
|
|
818
|
+
'footfallCount': 10,
|
|
819
|
+
},
|
|
820
|
+
],
|
|
821
|
+
'15:00': [
|
|
822
|
+
{
|
|
823
|
+
'time': '15:00',
|
|
824
|
+
'day': 'Sun',
|
|
825
|
+
'footfallCount': 10,
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
'time': '15:00',
|
|
829
|
+
'day': 'Mon',
|
|
830
|
+
'footfallCount': 10,
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
'time': '15:00',
|
|
834
|
+
'day': 'Tue',
|
|
835
|
+
'footfallCount': 10,
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
'time': '15:00',
|
|
839
|
+
'day': 'Wed',
|
|
840
|
+
'footfallCount': 10,
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
'time': '15:00',
|
|
844
|
+
'day': 'Thu',
|
|
845
|
+
'footfallCount': 10,
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
'time': '15:00',
|
|
849
|
+
'day': 'Fri',
|
|
850
|
+
'footfallCount': 10,
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
'time': '15:00',
|
|
854
|
+
'day': 'Sat',
|
|
855
|
+
'footfallCount': 10,
|
|
856
|
+
},
|
|
857
|
+
],
|
|
858
|
+
'16:00': [
|
|
859
|
+
{
|
|
860
|
+
'time': '16:00',
|
|
861
|
+
'day': 'Sun',
|
|
862
|
+
'footfallCount': 10,
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
'time': '16:00',
|
|
866
|
+
'day': 'Mon',
|
|
867
|
+
'footfallCount': 10,
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
'time': '16:00',
|
|
871
|
+
'day': 'Tue',
|
|
872
|
+
'footfallCount': 10,
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
'time': '16:00',
|
|
876
|
+
'day': 'Wed',
|
|
877
|
+
'footfallCount': 10,
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
'time': '16:00',
|
|
881
|
+
'day': 'Thu',
|
|
882
|
+
'footfallCount': 10,
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
'time': '16:00',
|
|
886
|
+
'day': 'Fri',
|
|
887
|
+
'footfallCount': 10,
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
'time': '16:00',
|
|
891
|
+
'day': 'Sat',
|
|
892
|
+
'footfallCount': 10,
|
|
893
|
+
},
|
|
894
|
+
],
|
|
895
|
+
'17:00': [
|
|
896
|
+
{
|
|
897
|
+
'time': '17:00',
|
|
898
|
+
'day': 'Sun',
|
|
899
|
+
'footfallCount': 10,
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
'time': '17:00',
|
|
903
|
+
'day': 'Mon',
|
|
904
|
+
'footfallCount': 10,
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
'time': '17:00',
|
|
908
|
+
'day': 'Tue',
|
|
909
|
+
'footfallCount': 10,
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
'time': '17:00',
|
|
913
|
+
'day': 'Wed',
|
|
914
|
+
'footfallCount': 10,
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
'time': '17:00',
|
|
918
|
+
'day': 'Thu',
|
|
919
|
+
'footfallCount': 10,
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
'time': '17:00',
|
|
923
|
+
'day': 'Fri',
|
|
924
|
+
'footfallCount': 10,
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
'time': '17:00',
|
|
928
|
+
'day': 'Sat',
|
|
929
|
+
'footfallCount': 10,
|
|
930
|
+
},
|
|
931
|
+
],
|
|
932
|
+
'18:00': [
|
|
933
|
+
{
|
|
934
|
+
'time': '18:00',
|
|
935
|
+
'day': 'Sun',
|
|
936
|
+
'footfallCount': 10,
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
'time': '18:00',
|
|
940
|
+
'day': 'Mon',
|
|
941
|
+
'footfallCount': 10,
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
'time': '18:00',
|
|
945
|
+
'day': 'Tue',
|
|
946
|
+
'footfallCount': 10,
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
'time': '18:00',
|
|
950
|
+
'day': 'Wed',
|
|
951
|
+
'footfallCount': 10,
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
'time': '18:00',
|
|
955
|
+
'day': 'Thu',
|
|
956
|
+
'footfallCount': 10,
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
'time': '18:00',
|
|
960
|
+
'day': 'Fri',
|
|
961
|
+
'footfallCount': 10,
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
'time': '18:00',
|
|
965
|
+
'day': 'Sat',
|
|
966
|
+
'footfallCount': 10,
|
|
967
|
+
},
|
|
968
|
+
],
|
|
969
|
+
'19:00': [
|
|
970
|
+
{
|
|
971
|
+
'time': '19:00',
|
|
972
|
+
'day': 'Sun',
|
|
973
|
+
'footfallCount': 10,
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
'time': '19:00',
|
|
977
|
+
'day': 'Mon',
|
|
978
|
+
'footfallCount': 10,
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
'time': '19:00',
|
|
982
|
+
'day': 'Tue',
|
|
983
|
+
'footfallCount': 10,
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
'time': '19:00',
|
|
987
|
+
'day': 'Wed',
|
|
988
|
+
'footfallCount': 10,
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
'time': '19:00',
|
|
992
|
+
'day': 'Thu',
|
|
993
|
+
'footfallCount': 10,
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
'time': '19:00',
|
|
997
|
+
'day': 'Fri',
|
|
998
|
+
'footfallCount': 10,
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
'time': '19:00',
|
|
1002
|
+
'day': 'Sat',
|
|
1003
|
+
'footfallCount': 10,
|
|
1004
|
+
},
|
|
1005
|
+
],
|
|
1006
|
+
'20:00': [
|
|
1007
|
+
{
|
|
1008
|
+
'time': '20:00',
|
|
1009
|
+
'day': 'Sun',
|
|
1010
|
+
'footfallCount': 10,
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
'time': '20:00',
|
|
1014
|
+
'day': 'Mon',
|
|
1015
|
+
'footfallCount': 10,
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
'time': '20:00',
|
|
1019
|
+
'day': 'Tue',
|
|
1020
|
+
'footfallCount': 10,
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
'time': '20:00',
|
|
1024
|
+
'day': 'Wed',
|
|
1025
|
+
'footfallCount': 10,
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
'time': '20:00',
|
|
1029
|
+
'day': 'Thu',
|
|
1030
|
+
'footfallCount': 10,
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
'time': '20:00',
|
|
1034
|
+
'day': 'Fri',
|
|
1035
|
+
'footfallCount': 10,
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
'time': '20:00',
|
|
1039
|
+
'day': 'Sat',
|
|
1040
|
+
'footfallCount': 10,
|
|
1041
|
+
},
|
|
1042
|
+
],
|
|
1043
|
+
'21:00': [
|
|
1044
|
+
{
|
|
1045
|
+
'time': '21:00',
|
|
1046
|
+
'day': 'Sun',
|
|
1047
|
+
'footfallCount': 10,
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
'time': '21:00',
|
|
1051
|
+
'day': 'Mon',
|
|
1052
|
+
'footfallCount': 10,
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
'time': '21:00',
|
|
1056
|
+
'day': 'Tue',
|
|
1057
|
+
'footfallCount': 10,
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
'time': '21:00',
|
|
1061
|
+
'day': 'Wed',
|
|
1062
|
+
'footfallCount': 10,
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
'time': '21:00',
|
|
1066
|
+
'day': 'Thu',
|
|
1067
|
+
'footfallCount': 10,
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
'time': '21:00',
|
|
1071
|
+
'day': 'Fri',
|
|
1072
|
+
'footfallCount': 10,
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
'time': '21:00',
|
|
1076
|
+
'day': 'Sat',
|
|
1077
|
+
'footfallCount': 10,
|
|
1078
|
+
},
|
|
1079
|
+
],
|
|
1080
|
+
'22:00': [
|
|
1081
|
+
{
|
|
1082
|
+
'time': '22:00',
|
|
1083
|
+
'day': 'Sun',
|
|
1084
|
+
'footfallCount': 10,
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
'time': '22:00',
|
|
1088
|
+
'day': 'Mon',
|
|
1089
|
+
'footfallCount': 10,
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
'time': '22:00',
|
|
1093
|
+
'day': 'Tue',
|
|
1094
|
+
'footfallCount': 10,
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
'time': '22:00',
|
|
1098
|
+
'day': 'Wed',
|
|
1099
|
+
'footfallCount': 10,
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
'time': '22:00',
|
|
1103
|
+
'day': 'Thu',
|
|
1104
|
+
'footfallCount': 10,
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
'time': '22:00',
|
|
1108
|
+
'day': 'Fri',
|
|
1109
|
+
'footfallCount': 10,
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
'time': '22:00',
|
|
1113
|
+
'day': 'Sat',
|
|
1114
|
+
'footfallCount': 10,
|
|
1115
|
+
},
|
|
1116
|
+
],
|
|
1117
|
+
'23:00': [
|
|
1118
|
+
{
|
|
1119
|
+
'time': '23:00',
|
|
1120
|
+
'day': 'Sun',
|
|
1121
|
+
'footfallCount': 10,
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
'time': '23:00',
|
|
1125
|
+
'day': 'Mon',
|
|
1126
|
+
'footfallCount': 10,
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
'time': '23:00',
|
|
1130
|
+
'day': 'Tue',
|
|
1131
|
+
'footfallCount': 10,
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
'time': '23:00',
|
|
1135
|
+
'day': 'Wed',
|
|
1136
|
+
'footfallCount': 10,
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
'time': '23:00',
|
|
1140
|
+
'day': 'Thu',
|
|
1141
|
+
'footfallCount': 10,
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
'time': '23:00',
|
|
1145
|
+
'day': 'Fri',
|
|
1146
|
+
'footfallCount': 10,
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
'time': '23:00',
|
|
1150
|
+
'day': 'Sat',
|
|
1151
|
+
'footfallCount': 10,
|
|
1152
|
+
},
|
|
1153
|
+
],
|
|
1154
|
+
},
|
|
1155
|
+
'dwellTimeSplit': [
|
|
1156
|
+
{ 'dwell_time': '1-5', 'maleCount': 40, 'femaleCount': 50 },
|
|
1157
|
+
{ 'dwell_time': '10-15', 'maleCount': 50, 'femaleCount': 20 },
|
|
1158
|
+
{ 'dwell_time': '15-20', 'maleCount': 50, 'femaleCount': 79 },
|
|
1159
|
+
{ 'dwell_time': '20+', 'maleCount': 30, 'femaleCount': 50 },
|
|
1160
|
+
],
|
|
1161
|
+
};
|
|
1162
|
+
return res.sendSuccess( result );
|
|
1163
|
+
} catch ( error ) {
|
|
1164
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1165
|
+
return res.sendError( { error: error }, 500 );
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
|
|
1169
|
+
export const overallCards = async ( req, res ) => {
|
|
1170
|
+
try {
|
|
1171
|
+
let reqestData = req.body;
|
|
1172
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1173
|
+
if ( checkNoData ) {
|
|
1174
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1178
|
+
if ( checkInvalidRequest ) {
|
|
1179
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1183
|
+
if ( checkServerError ) {
|
|
1184
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
let allCards = {
|
|
1188
|
+
'footfallCard': {
|
|
1189
|
+
'footfallCount': 600,
|
|
1190
|
+
'singleCount': 411,
|
|
1191
|
+
'groupCount': 177,
|
|
1192
|
+
'ageGroup': '31-40',
|
|
1193
|
+
'maleRate': 59,
|
|
1194
|
+
'femaleRate': 41,
|
|
1195
|
+
},
|
|
1196
|
+
'conversionCard': {
|
|
1197
|
+
'conversionCount': 600,
|
|
1198
|
+
'conversionRate': 60,
|
|
1199
|
+
'minRate': 10,
|
|
1200
|
+
'averageRate': 20,
|
|
1201
|
+
'maxRate': 50,
|
|
1202
|
+
},
|
|
1203
|
+
'engagersCard': {
|
|
1204
|
+
'engagersCount': 600,
|
|
1205
|
+
'engagersRate': 40,
|
|
1206
|
+
'avgDwellTime': 10,
|
|
1207
|
+
'highEngagementZone': 'zoon-1',
|
|
1208
|
+
'lowEngagementZone': 'zoon-2',
|
|
1209
|
+
},
|
|
1210
|
+
'bouncedCard': {
|
|
1211
|
+
'bouncedCount': 600,
|
|
1212
|
+
'bouncedRate': 20,
|
|
1213
|
+
'peakBouncedHour': '03-04 PM',
|
|
1214
|
+
'mostCommonAge': '31-45',
|
|
1215
|
+
'maleRate': 20,
|
|
1216
|
+
'femaleRate': 30,
|
|
1217
|
+
},
|
|
1218
|
+
'potentialBuyersCard': {
|
|
1219
|
+
'potentialBuyersCount': 600,
|
|
1220
|
+
'potentialBuyersRate': 70,
|
|
1221
|
+
'singleCount': 25,
|
|
1222
|
+
'groupCount': 37,
|
|
1223
|
+
'mostCommonAge': '31-45',
|
|
1224
|
+
'maleRate': 30,
|
|
1225
|
+
'femaleRate': 60,
|
|
1226
|
+
},
|
|
1227
|
+
'missedOpportunityCard': {
|
|
1228
|
+
'missedOpportunityCount': 600,
|
|
1229
|
+
'missedOpportunityRate': 80,
|
|
1230
|
+
'potentialRevenueLoss': 2000,
|
|
1231
|
+
'lowConversionZone': 'zone-1',
|
|
1232
|
+
'mostCommonAge': '31-45',
|
|
1233
|
+
'maleRate': 30,
|
|
1234
|
+
'femaleRate': 40,
|
|
1235
|
+
},
|
|
1236
|
+
};
|
|
1237
|
+
let result = {};
|
|
1238
|
+
switch ( reqestData.processType ) {
|
|
1239
|
+
case 'footfall':
|
|
1240
|
+
result.footfallCard = allCards.footfallCard;
|
|
1241
|
+
break;
|
|
1242
|
+
case 'conversion':
|
|
1243
|
+
result.conversionCard = allCards.conversionCard;
|
|
1244
|
+
break;
|
|
1245
|
+
case 'engager':
|
|
1246
|
+
result.engagersCard = allCards.engagersCard;
|
|
1247
|
+
break;
|
|
1248
|
+
case 'bounced':
|
|
1249
|
+
result.bouncedCard = allCards.bouncedCard;
|
|
1250
|
+
break;
|
|
1251
|
+
case 'potentialBuyer':
|
|
1252
|
+
result.potentialBuyersCard = allCards.potentialBuyersCard;
|
|
1253
|
+
break;
|
|
1254
|
+
case 'missedOpportunity':
|
|
1255
|
+
result.missedOpportunityCard = allCards.missedOpportunityCard;
|
|
1256
|
+
break;
|
|
1257
|
+
|
|
1258
|
+
default:
|
|
1259
|
+
break;
|
|
1260
|
+
}
|
|
1261
|
+
return res.sendSuccess( result );
|
|
1262
|
+
} catch ( error ) {
|
|
1263
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1264
|
+
return res.sendError( { error: error }, 500 );
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
|
|
1268
|
+
export const overallHourlyChart = async ( req, res ) => {
|
|
1269
|
+
try {
|
|
1270
|
+
let reqestData = req.body;
|
|
1271
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1272
|
+
if ( checkNoData ) {
|
|
1273
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1277
|
+
if ( checkInvalidRequest ) {
|
|
1278
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1282
|
+
if ( checkServerError ) {
|
|
1283
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
let result = {
|
|
1287
|
+
'hourlyData': [
|
|
1288
|
+
{ 'time': '00:00', 'count': 10, 'rate': 10 },
|
|
1289
|
+
{ 'time': '02:00', 'count': 10, 'rate': 10 },
|
|
1290
|
+
{ 'time': '04:00', 'count': 10, 'rate': 10 },
|
|
1291
|
+
{ 'time': '06:00', 'count': 10, 'rate': 10 },
|
|
1292
|
+
{ 'time': '08:00', 'count': 10, 'rate': 10 },
|
|
1293
|
+
{ 'time': '10:00', 'count': 10, 'rate': 10 },
|
|
1294
|
+
{ 'time': '12:00', 'count': 10, 'rate': 10 },
|
|
1295
|
+
{ 'time': '14:00', 'count': 10, 'rate': 10 },
|
|
1296
|
+
{ 'time': '16:00', 'count': 10, 'rate': 10 },
|
|
1297
|
+
{ 'time': '18:00', 'count': 10, 'rate': 10 },
|
|
1298
|
+
{ 'time': '20:00', 'count': 10, 'rate': 10 },
|
|
1299
|
+
{ 'time': '22:00', 'count': 10, 'rate': 10 },
|
|
1300
|
+
],
|
|
1301
|
+
};
|
|
1302
|
+
return res.sendSuccess( result );
|
|
1303
|
+
} catch ( error ) {
|
|
1304
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1305
|
+
return res.sendError( { error: error }, 500 );
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
export const overallChart = async ( req, res ) => {
|
|
1310
|
+
try {
|
|
1311
|
+
let reqestData = req.body;
|
|
1312
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1313
|
+
if ( checkNoData ) {
|
|
1314
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1318
|
+
if ( checkInvalidRequest ) {
|
|
1319
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1323
|
+
if ( checkServerError ) {
|
|
1324
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
let result = {
|
|
1328
|
+
'totalCount': 300,
|
|
1329
|
+
'storeData': [
|
|
1330
|
+
{ 'storeName': 'LKST100', 'count': 10 },
|
|
1331
|
+
{ 'storeName': 'LKST101', 'count': 10 },
|
|
1332
|
+
{ 'storeName': 'LKST102', 'count': 10 },
|
|
1333
|
+
{ 'storeName': 'LKST103', 'count': 10 },
|
|
1334
|
+
{ 'storeName': 'LKST104', 'count': 10 },
|
|
1335
|
+
{ 'storeName': 'LKST105', 'count': 10 },
|
|
1336
|
+
],
|
|
1337
|
+
};
|
|
1338
|
+
return res.sendSuccess( result );
|
|
1339
|
+
} catch ( error ) {
|
|
1340
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1341
|
+
return res.sendError( { error: error }, 500 );
|
|
1342
|
+
}
|
|
1343
|
+
};
|
|
1344
|
+
|
|
1345
|
+
export const singleStoreChart = async ( req, res ) => {
|
|
1346
|
+
try {
|
|
1347
|
+
let reqestData = req.body;
|
|
1348
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1349
|
+
if ( checkNoData ) {
|
|
1350
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1354
|
+
if ( checkInvalidRequest ) {
|
|
1355
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1359
|
+
if ( checkServerError ) {
|
|
1360
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
let result = {
|
|
1364
|
+
'totalCount': 300,
|
|
1365
|
+
'storeName': 'LKST100',
|
|
1366
|
+
'storeData': [
|
|
1367
|
+
{ 'date': '2024-07-01', 'count': 10 },
|
|
1368
|
+
{ 'date': '2024-07-02', 'count': 10 },
|
|
1369
|
+
{ 'date': '2024-07-03', 'count': 10 },
|
|
1370
|
+
{ 'date': '2024-07-04', 'count': 10 },
|
|
1371
|
+
{ 'date': '2024-07-05', 'count': 10 },
|
|
1372
|
+
{ 'date': '2024-07-06', 'count': 10 },
|
|
1373
|
+
],
|
|
1374
|
+
};
|
|
1375
|
+
return res.sendSuccess( result );
|
|
1376
|
+
} catch ( error ) {
|
|
1377
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1378
|
+
return res.sendError( { error: error }, 500 );
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1382
|
+
export const demographicChart = async ( req, res ) => {
|
|
1383
|
+
try {
|
|
1384
|
+
let reqestData = req.body;
|
|
1385
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1386
|
+
if ( checkNoData ) {
|
|
1387
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1391
|
+
if ( checkInvalidRequest ) {
|
|
1392
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1396
|
+
if ( checkServerError ) {
|
|
1397
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
let result = {
|
|
1401
|
+
'demographicData': [
|
|
1402
|
+
{ 'age': 'Bellow 12', 'count': 10, 'maleCount': 10, 'femaleCount': 10 },
|
|
1403
|
+
{ 'age': '13-19', 'count': 10, 'maleCount': 10, 'femaleCount': 10 },
|
|
1404
|
+
{ 'age': '20-30', 'count': 10, 'maleCount': 10, 'femaleCount': 10 },
|
|
1405
|
+
{ 'age': '31-45', 'count': 10, 'maleCount': 10, 'femaleCount': 10 },
|
|
1406
|
+
{ 'age': '46-59', 'count': 10, 'maleCount': 10, 'femaleCount': 10 },
|
|
1407
|
+
{ 'age': 'Above 60', 'count': 10, 'maleCount': 10, 'femaleCount': 10 },
|
|
1408
|
+
],
|
|
1409
|
+
};
|
|
1410
|
+
return res.sendSuccess( result );
|
|
1411
|
+
} catch ( error ) {
|
|
1412
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1413
|
+
return res.sendError( { error: error }, 500 );
|
|
1414
|
+
}
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1417
|
+
export const buyerChart = async ( req, res ) => {
|
|
1418
|
+
try {
|
|
1419
|
+
let reqestData = req.body;
|
|
1420
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1421
|
+
if ( checkNoData ) {
|
|
1422
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1426
|
+
if ( checkInvalidRequest ) {
|
|
1427
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1431
|
+
if ( checkServerError ) {
|
|
1432
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
let result = {
|
|
1436
|
+
'buyerData': [
|
|
1437
|
+
{ 'age': 'Bellow 12', 'singleCount': 10, 'groupCount': 10 },
|
|
1438
|
+
{ 'age': '13-19', 'singleCount': 10, 'groupCount': 10 },
|
|
1439
|
+
{ 'age': '20-30', 'singleCount': 10, 'groupCount': 10 },
|
|
1440
|
+
{ 'age': '31-45', 'singleCount': 10, 'groupCount': 10 },
|
|
1441
|
+
{ 'age': '46-59', 'singleCount': 10, 'groupCount': 10 },
|
|
1442
|
+
{ 'age': 'Above 60', 'singleCount': 10, 'groupCount': 10 },
|
|
1443
|
+
],
|
|
1444
|
+
};
|
|
1445
|
+
return res.sendSuccess( result );
|
|
1446
|
+
} catch ( error ) {
|
|
1447
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1448
|
+
return res.sendError( { error: error }, 500 );
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
export const footfallDirectoryFolders = async ( req, res ) => {
|
|
1453
|
+
try {
|
|
1454
|
+
let reqestData = req.body;
|
|
1455
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1456
|
+
if ( checkNoData ) {
|
|
1457
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1461
|
+
if ( checkInvalidRequest ) {
|
|
1462
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1466
|
+
if ( checkServerError ) {
|
|
1467
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
let result = {
|
|
1471
|
+
'footfallData': [
|
|
1472
|
+
{ 'folderName': '11AM-12PM', 'count': 3 },
|
|
1473
|
+
{ 'folderName': '12PM-01PM', 'count': 4 },
|
|
1474
|
+
{ 'folderName': '01PM-02PM', 'count': 5 },
|
|
1475
|
+
],
|
|
1476
|
+
};
|
|
1477
|
+
return res.sendSuccess( result );
|
|
1478
|
+
} catch ( error ) {
|
|
1479
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1480
|
+
return res.sendError( { error: error }, 500 );
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
|
|
1484
|
+
export const footfallDirectory = async ( req, res ) => {
|
|
1485
|
+
try {
|
|
1486
|
+
let reqestData = req.body;
|
|
1487
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1488
|
+
if ( checkNoData ) {
|
|
1489
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1493
|
+
if ( checkInvalidRequest ) {
|
|
1494
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1498
|
+
if ( checkServerError ) {
|
|
1499
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
let result = {
|
|
1503
|
+
'footfallData': [
|
|
1504
|
+
{
|
|
1505
|
+
'tempId': '308',
|
|
1506
|
+
'timeSpent': {
|
|
1507
|
+
'entryTime': '14:00:55',
|
|
1508
|
+
'exitTime': '14:10:55',
|
|
1509
|
+
'totalTimeSpent': '01:00:00',
|
|
1510
|
+
'avgDwellTime': '01:00:00',
|
|
1511
|
+
},
|
|
1512
|
+
'zoneVisited': [
|
|
1513
|
+
'zone1', 'zone2', 'zone3',
|
|
1514
|
+
],
|
|
1515
|
+
'images': {
|
|
1516
|
+
'entryTimeImage': 'path',
|
|
1517
|
+
'exitTimeImage': 'path',
|
|
1518
|
+
'staffEngagementImage': 'path',
|
|
1519
|
+
},
|
|
1520
|
+
'staffEngagement': {
|
|
1521
|
+
'timeTakenToAssist': '00:20:00',
|
|
1522
|
+
'timeSpentWithStaff': '00:20:00',
|
|
1523
|
+
},
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
'tempId': '408',
|
|
1527
|
+
'timeSpent': {
|
|
1528
|
+
'entryTime': '14:00:55',
|
|
1529
|
+
'exitTime': '14:10:55',
|
|
1530
|
+
'totalTimeSpent': '01:00:00',
|
|
1531
|
+
'avgDwellTime': '01:00:00',
|
|
1532
|
+
},
|
|
1533
|
+
'zoneVisited': [
|
|
1534
|
+
'zone1', 'zone2', 'zone3',
|
|
1535
|
+
],
|
|
1536
|
+
'images': {
|
|
1537
|
+
'entryTimeImage': 'path',
|
|
1538
|
+
'exitTimeImage': 'path',
|
|
1539
|
+
'staffEngagementImage': 'path',
|
|
1540
|
+
},
|
|
1541
|
+
'staffEngagement': {
|
|
1542
|
+
'timeTakenToAssist': '00:20:00',
|
|
1543
|
+
'timeSpentWithStaff': '00:20:00',
|
|
1544
|
+
},
|
|
1545
|
+
},
|
|
1546
|
+
],
|
|
1547
|
+
};
|
|
1548
|
+
return res.sendSuccess( result );
|
|
1549
|
+
} catch ( error ) {
|
|
1550
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1551
|
+
return res.sendError( { error: error }, 500 );
|
|
1552
|
+
}
|
|
1553
|
+
};
|
|
1554
|
+
|
|
1555
|
+
export const summaryTable = async ( req, res ) => {
|
|
1556
|
+
try {
|
|
1557
|
+
let reqestData = req.body;
|
|
1558
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1559
|
+
if ( checkNoData ) {
|
|
1560
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1564
|
+
if ( checkInvalidRequest ) {
|
|
1565
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1569
|
+
if ( checkServerError ) {
|
|
1570
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
let result = {
|
|
1574
|
+
'totalCount': 300,
|
|
1575
|
+
'summaryData': [
|
|
1576
|
+
{
|
|
1577
|
+
'storeName': 'LKST400',
|
|
1578
|
+
'date': '2024-01-01', // Single Store
|
|
1579
|
+
'storeId': '11-10',
|
|
1580
|
+
'footfallCount': 400,
|
|
1581
|
+
'bouncedCount': 40,
|
|
1582
|
+
'engagersCount': 60,
|
|
1583
|
+
'missedOpportunityCount': 70,
|
|
1584
|
+
'potentialBuyersCount': 80,
|
|
1585
|
+
'conversionRate': 70.5,
|
|
1586
|
+
'avgDwellTime': 50,
|
|
1587
|
+
'avgInfraDowntime': 70,
|
|
1588
|
+
'bellow12': 30,
|
|
1589
|
+
'13-19': 50,
|
|
1590
|
+
'20-30': 40,
|
|
1591
|
+
'31-45': 20,
|
|
1592
|
+
'46-59': 30,
|
|
1593
|
+
'60 above': 60,
|
|
1594
|
+
'male': 40,
|
|
1595
|
+
'female': 50,
|
|
1596
|
+
},
|
|
1597
|
+
],
|
|
1598
|
+
};
|
|
1599
|
+
return res.sendSuccess( result );
|
|
1600
|
+
} catch ( error ) {
|
|
1601
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1602
|
+
return res.sendError( { error: error }, 500 );
|
|
1603
|
+
}
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
export const footfallTrend = async ( req, res ) => {
|
|
1607
|
+
try {
|
|
1608
|
+
let reqestData = req.body;
|
|
1609
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1610
|
+
if ( checkNoData ) {
|
|
1611
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1615
|
+
if ( checkInvalidRequest ) {
|
|
1616
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1620
|
+
if ( checkServerError ) {
|
|
1621
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
let result = {
|
|
1625
|
+
'totalCount': 2000,
|
|
1626
|
+
'footfallTrendData': [
|
|
1627
|
+
{
|
|
1628
|
+
'storeName': 'LKST100', // / Multi Store
|
|
1629
|
+
'date': '2024-10-03', // /single store
|
|
1630
|
+
'footfallRate': 89.5,
|
|
1631
|
+
'conversionRate': 89.5,
|
|
1632
|
+
'bouncedRate': 89.5,
|
|
1633
|
+
'engagersRate': 89.5,
|
|
1634
|
+
'missedopportunitiesRate': 89.5,
|
|
1635
|
+
'avgDwellTime': 89.5,
|
|
1636
|
+
'avgDownTime': 89.5,
|
|
1637
|
+
'potentialBuyersRate': 70,
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
'storeName': 'LKST200', // / Multi Store
|
|
1641
|
+
'date': '2024-10-03', // /single store
|
|
1642
|
+
'footfallRate': 89.5,
|
|
1643
|
+
'conversionRate': 89.5,
|
|
1644
|
+
'bouncedRate': 89.5,
|
|
1645
|
+
'engagersRate': 89.5,
|
|
1646
|
+
'missedopportunitiesRate': 89.5,
|
|
1647
|
+
'avgDwellTime': 89.5,
|
|
1648
|
+
'avgDownTime': 89.5,
|
|
1649
|
+
'potentialBuyersRate': 70,
|
|
1650
|
+
},
|
|
1651
|
+
|
|
1652
|
+
// //if ForecastData
|
|
1653
|
+
{
|
|
1654
|
+
'storeName': 'LKST200', // / Multi Store
|
|
1655
|
+
'date': '2024-10-03', // /single store
|
|
1656
|
+
'footfallRate': 89.5,
|
|
1657
|
+
'conversionRate': 89.5,
|
|
1658
|
+
'bouncedRate': 89.5,
|
|
1659
|
+
'engagersRate': 89.5,
|
|
1660
|
+
'missedopportunitiesRate': 89.5,
|
|
1661
|
+
'avgDwellTime': 89.5,
|
|
1662
|
+
'avgDownTime': 89.5,
|
|
1663
|
+
'potentialBuyersRate': 70,
|
|
1664
|
+
// //Static Value////
|
|
1665
|
+
'columnSettings': {
|
|
1666
|
+
'fillOpacity': 0.5,
|
|
1667
|
+
'strokeWidth': 2,
|
|
1668
|
+
'strokeDasharray': [ 5, 5 ],
|
|
1669
|
+
},
|
|
1670
|
+
},
|
|
1671
|
+
],
|
|
1672
|
+
};
|
|
1673
|
+
return res.sendSuccess( result );
|
|
1674
|
+
} catch ( error ) {
|
|
1675
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1676
|
+
return res.sendError( { error: error }, 500 );
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
|
|
1681
|
+
export const storesMap = async ( req, res ) => {
|
|
1682
|
+
try {
|
|
1683
|
+
let reqestData = req.body;
|
|
1684
|
+
const storeList = [
|
|
1685
|
+
{
|
|
1686
|
+
$match: {
|
|
1687
|
+
clientId: { $eq: '11' },
|
|
1688
|
+
storeId: { $in: reqestData.storeId },
|
|
1689
|
+
$and: [
|
|
1690
|
+
{ 'storeProfile.latitude': { $exists: true } },
|
|
1691
|
+
{ 'storeProfile.latitude': { $gt: 0 } },
|
|
1692
|
+
{ 'storeProfile.latitude': { $exists: true } },
|
|
1693
|
+
{ 'storeProfile.latitude': { $gt: 0 } },
|
|
1694
|
+
],
|
|
1695
|
+
},
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
$sort: {
|
|
1699
|
+
createdAt: -1,
|
|
1700
|
+
},
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
$project: {
|
|
1704
|
+
'_id': 0,
|
|
1705
|
+
'storeId': 1,
|
|
1706
|
+
'storeName': 1,
|
|
1707
|
+
'appId': 1,
|
|
1708
|
+
'storeProfile': 1,
|
|
1709
|
+
'spocDetails': { $arrayElemAt: [ '$spocDetails', 0 ] },
|
|
1710
|
+
'businessType': 1,
|
|
1711
|
+
'storeType': 1,
|
|
1712
|
+
'avgFootfall': '100',
|
|
1713
|
+
'avgWeekdayFootfall': '30',
|
|
1714
|
+
'avgWeekendFootfall': '60',
|
|
1715
|
+
'hourlyFootfall': '60',
|
|
1716
|
+
'openTime': '10:31 AM',
|
|
1717
|
+
'closeTime': '10:31 PM',
|
|
1718
|
+
},
|
|
1719
|
+
},
|
|
1720
|
+
];
|
|
1721
|
+
const getStores = await aggregateStore( storeList );
|
|
1722
|
+
// Call Lamba and Get Footfall Count for each stores
|
|
1723
|
+
|
|
1724
|
+
if ( !getStores ) {
|
|
1725
|
+
return res.sendError( 'No Content', 204 );
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
return res.sendSuccess( getStores );
|
|
1729
|
+
} catch ( error ) {
|
|
1730
|
+
console.log( 'error =>', error );
|
|
1731
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1732
|
+
return res.sendError( { error: error }, 500 );
|
|
1733
|
+
}
|
|
1734
|
+
};
|
|
1735
|
+
|
|
1736
|
+
export const performanceMatrix = async ( req, res ) => {
|
|
1737
|
+
try {
|
|
1738
|
+
let reqestData = req.body;
|
|
1739
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1740
|
+
if ( checkNoData ) {
|
|
1741
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1745
|
+
if ( checkInvalidRequest ) {
|
|
1746
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1750
|
+
if ( checkServerError ) {
|
|
1751
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
let result = {
|
|
1755
|
+
'downTime': 22,
|
|
1756
|
+
'health': 'GOOD',
|
|
1757
|
+
'recapVideoData': [
|
|
1758
|
+
{ 'thumbImage': 'https://123', 'videoURL': 'https://123' },
|
|
1759
|
+
{ 'thumbImage': 'https://123', 'videoURL': 'https://123' },
|
|
1760
|
+
],
|
|
1761
|
+
};
|
|
1762
|
+
return res.sendSuccess( result );
|
|
1763
|
+
} catch ( error ) {
|
|
1764
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1765
|
+
return res.sendError( { error: error }, 500 );
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
export const zoneDwellTimeSplit = async ( req, res ) => {
|
|
1770
|
+
try {
|
|
1771
|
+
let reqestData = req.body;
|
|
1772
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1773
|
+
if ( checkNoData ) {
|
|
1774
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1778
|
+
if ( checkInvalidRequest ) {
|
|
1779
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1783
|
+
if ( checkServerError ) {
|
|
1784
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
let result = {
|
|
1788
|
+
'zoneDwellTimeSplitData': [
|
|
1789
|
+
{
|
|
1790
|
+
'zoneName': 'Front',
|
|
1791
|
+
'concentrationRate': '30',
|
|
1792
|
+
'dwellTime': '30',
|
|
1793
|
+
},
|
|
1794
|
+
{
|
|
1795
|
+
'zoneName': 'Mid',
|
|
1796
|
+
'concentrationRate': '30',
|
|
1797
|
+
'dwellTime': '30',
|
|
1798
|
+
},
|
|
1799
|
+
{
|
|
1800
|
+
'zoneName': 'Back',
|
|
1801
|
+
'concentrationRate': '30',
|
|
1802
|
+
'dwellTime': '30',
|
|
1803
|
+
},
|
|
1804
|
+
],
|
|
1805
|
+
};
|
|
1806
|
+
return res.sendSuccess( result );
|
|
1807
|
+
} catch ( error ) {
|
|
1808
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1809
|
+
return res.sendError( { error: error }, 500 );
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
|
|
1813
|
+
export const storeOperation = async ( req, res ) => {
|
|
1814
|
+
try {
|
|
1815
|
+
let reqestData = req.body;
|
|
1816
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1817
|
+
if ( checkNoData ) {
|
|
1818
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1822
|
+
if ( checkInvalidRequest ) {
|
|
1823
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1827
|
+
if ( checkServerError ) {
|
|
1828
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
let result = {
|
|
1832
|
+
'storeOperationData': [
|
|
1833
|
+
{
|
|
1834
|
+
'overall': {
|
|
1835
|
+
'avgOpenTime': '10:00 AM',
|
|
1836
|
+
'avgCloseTime': '10:00 PM',
|
|
1837
|
+
},
|
|
1838
|
+
'topLateOpen': {
|
|
1839
|
+
'storeName': 'udaipur',
|
|
1840
|
+
'avgStoreOpenTime': '11:00 AM',
|
|
1841
|
+
},
|
|
1842
|
+
'topEarlyClose': {
|
|
1843
|
+
'storeName': 'Agra',
|
|
1844
|
+
'avgStoreCloseTime': '08:00 PM',
|
|
1845
|
+
},
|
|
1846
|
+
},
|
|
1847
|
+
],
|
|
1848
|
+
};
|
|
1849
|
+
return res.sendSuccess( result );
|
|
1850
|
+
} catch ( error ) {
|
|
1851
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1852
|
+
return res.sendError( { error: error }, 500 );
|
|
1853
|
+
}
|
|
1854
|
+
};
|
|
1855
|
+
|
|
1856
|
+
export const headerLocations = async ( req, res ) => {
|
|
1857
|
+
try {
|
|
1858
|
+
let reqestData = req.body;
|
|
1859
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1860
|
+
if ( checkNoData ) {
|
|
1861
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1865
|
+
if ( checkInvalidRequest ) {
|
|
1866
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1870
|
+
if ( checkServerError ) {
|
|
1871
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
let result = {
|
|
1875
|
+
'locationData': [
|
|
1876
|
+
{ 'city': 'chennai' },
|
|
1877
|
+
{ 'city': 'chennai-1' },
|
|
1878
|
+
{ 'city': 'chennai-2' },
|
|
1879
|
+
],
|
|
1880
|
+
};
|
|
1881
|
+
return res.sendSuccess( result );
|
|
1882
|
+
} catch ( error ) {
|
|
1883
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1884
|
+
return res.sendError( { error: error }, 500 );
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
|
|
1888
|
+
export const headerGroups = async ( req, res ) => {
|
|
1889
|
+
try {
|
|
1890
|
+
let reqestData = req.body;
|
|
1891
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1892
|
+
if ( checkNoData ) {
|
|
1893
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1897
|
+
if ( checkInvalidRequest ) {
|
|
1898
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1902
|
+
if ( checkServerError ) {
|
|
1903
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
let result = {
|
|
1907
|
+
'groupData': [
|
|
1908
|
+
{ 'groupName': 'group-1' },
|
|
1909
|
+
{ 'groupName': 'group-2' },
|
|
1910
|
+
{ 'groupName': 'group-3' },
|
|
1911
|
+
],
|
|
1912
|
+
};
|
|
1913
|
+
return res.sendSuccess( result );
|
|
1914
|
+
} catch ( error ) {
|
|
1915
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1916
|
+
return res.sendError( { error: error }, 500 );
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
|
|
1920
|
+
export const headerStores = async ( req, res ) => {
|
|
1921
|
+
try {
|
|
1922
|
+
let reqestData = req.body;
|
|
1923
|
+
let checkNoData = await returnNoData( reqestData.storeId );
|
|
1924
|
+
if ( checkNoData ) {
|
|
1925
|
+
return res.sendError( { error: 'No Data Found' }, 204 );
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
let checkInvalidRequest = await returnInvalidRequest( reqestData.storeId );
|
|
1929
|
+
if ( checkInvalidRequest ) {
|
|
1930
|
+
return res.sendError( { error: 'Invalid Date' }, 400 );
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
let checkServerError = await returnServerError( reqestData.storeId );
|
|
1934
|
+
if ( checkServerError ) {
|
|
1935
|
+
return res.sendError( { error: 'Server Error' }, 500 );
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
let result = {
|
|
1939
|
+
'storesData': [
|
|
1940
|
+
{ 'storeId': '11-1', 'storeName': 'store-1' },
|
|
1941
|
+
{ 'storeId': '11-2', 'storeName': 'store-2' },
|
|
1942
|
+
{ 'storeId': '11-3', 'storeName': 'store-3' },
|
|
1943
|
+
],
|
|
1944
|
+
};
|
|
1945
|
+
return res.sendSuccess( result );
|
|
1946
|
+
} catch ( error ) {
|
|
1947
|
+
logger.error( { error: error, message: req.query, function: 'trafficCards' } );
|
|
1948
|
+
return res.sendError( { error: error }, 500 );
|
|
1949
|
+
}
|
|
1950
|
+
};
|
|
1951
|
+
|
|
1952
|
+
// async function LamdaServiceCall( url, data ) {
|
|
1953
|
+
// try {
|
|
1954
|
+
// const requestOptions = {
|
|
1955
|
+
// method: 'POST',
|
|
1956
|
+
// headers: {
|
|
1957
|
+
// 'Content-Type': 'application/json',
|
|
1958
|
+
// },
|
|
1959
|
+
// body: JSON.stringify( data ),
|
|
1960
|
+
// };
|
|
1961
|
+
// const response = await fetch( url, requestOptions );
|
|
1962
|
+
// if ( !response.ok ) {
|
|
1963
|
+
// throw new Error( `Response status: ${response.status}` );
|
|
1964
|
+
// return false;
|
|
1965
|
+
// }
|
|
1966
|
+
// const json = await response.json();
|
|
1967
|
+
// return json;
|
|
1968
|
+
// } catch ( error ) {
|
|
1969
|
+
// console.log( 'error =>', error );
|
|
1970
|
+
// logger.error( { error: error, message: data, function: 'LamdaServiceCall' } );
|
|
1971
|
+
// }
|
|
1972
|
+
// }
|
|
1973
|
+
|
|
1974
|
+
async function returnNoData( requestData ) {
|
|
1975
|
+
try {
|
|
1976
|
+
if ( requestData && requestData.includes( '204' ) ) {
|
|
1977
|
+
return true;
|
|
1978
|
+
}
|
|
1979
|
+
} catch ( error ) {
|
|
1980
|
+
logger.error( { error: error, message: data, function: 'returnNoData' } );
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
async function returnInvalidRequest( requestData ) {
|
|
1985
|
+
try {
|
|
1986
|
+
if ( requestData && requestData.includes( '400' ) ) {
|
|
1987
|
+
return true;
|
|
1988
|
+
}
|
|
1989
|
+
} catch ( error ) {
|
|
1990
|
+
logger.error( { error: error, message: data, function: 'returnInvalidRequest' } );
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
async function returnServerError( requestData ) {
|
|
1995
|
+
try {
|
|
1996
|
+
if ( requestData && requestData.includes( '500' ) ) {
|
|
1997
|
+
return true;
|
|
1998
|
+
}
|
|
1999
|
+
} catch ( error ) {
|
|
2000
|
+
logger.error( { error: error, message: data, function: 'returnServerError' } );
|
|
2001
|
+
}
|
|
2002
|
+
}
|