tango-app-api-analysis-zone 3.0.0-alpha.36 → 3.0.0-alpha.38
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/package.json
CHANGED
|
@@ -332,16 +332,17 @@ export const zoneInteractionTable459 = async ( req, res ) => {
|
|
|
332
332
|
if ( resultData ) {
|
|
333
333
|
if ( resultData.status_code == '200' ) {
|
|
334
334
|
if ( reqestData.export ) {
|
|
335
|
-
if ( resultData.
|
|
335
|
+
if ( resultData.data.length>0 ) {
|
|
336
336
|
const exportdata = [];
|
|
337
|
-
resultData.
|
|
337
|
+
resultData.data.forEach( ( element ) => {
|
|
338
338
|
exportdata.push( {
|
|
339
|
-
'Zone Name': element.zone_name || '--',
|
|
340
339
|
'Store Id': element.store_id || '--',
|
|
341
|
-
'
|
|
340
|
+
'Date': element.date || '--',
|
|
341
|
+
'Zone Name': element.zone_name || '--',
|
|
342
342
|
'Hour': element.hour || '--',
|
|
343
|
-
'Min Time Spent': element.min_time_spent || '--',
|
|
344
343
|
'Footfall': element.Footfall || '--',
|
|
344
|
+
'Avg Time Spent': element.avg_time_spent || '--',
|
|
345
|
+
'Min Time Spent': element.min_time_spent || '--',
|
|
345
346
|
'Max Time Spent': element.max_time_spent || '--',
|
|
346
347
|
} );
|
|
347
348
|
} );
|
|
@@ -400,3 +401,39 @@ export async function isAllowedClient( req, res, next ) {
|
|
|
400
401
|
return res.sendError( error, 500 );
|
|
401
402
|
}
|
|
402
403
|
}
|
|
404
|
+
|
|
405
|
+
export const zoneInteractionTableExport430 = async ( req, res ) => {
|
|
406
|
+
try {
|
|
407
|
+
let reqestData = req.body;
|
|
408
|
+
let LamdaURL = 'https://m64m6wfgvbbfmaxc3urblk5cx40fwkyh.lambda-url.ap-south-1.on.aws/';
|
|
409
|
+
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
410
|
+
if ( resultData ) {
|
|
411
|
+
if ( resultData.status_code == '200' ) {
|
|
412
|
+
if ( reqestData.export ) {
|
|
413
|
+
if ( resultData.data.length>0 ) {
|
|
414
|
+
const exportdata = [];
|
|
415
|
+
resultData.data.forEach( ( element ) => {
|
|
416
|
+
exportdata.push( {
|
|
417
|
+
'Store Id': element.store_id || '--',
|
|
418
|
+
'Date': element.date || '--',
|
|
419
|
+
'Customer Spend More Then 10 MIN': element.customer_count_over10min || '--',
|
|
420
|
+
'Billing Conversion': element.billing_conversion || '--',
|
|
421
|
+
} );
|
|
422
|
+
} );
|
|
423
|
+
return await download( exportdata, res );
|
|
424
|
+
} else {
|
|
425
|
+
return res.sendError( 'No Content', 204 );
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return res.sendSuccess( resultData );
|
|
429
|
+
} else {
|
|
430
|
+
return res.sendError( 'No Content', 204 );
|
|
431
|
+
}
|
|
432
|
+
} else {
|
|
433
|
+
return res.sendError( 'No Content', 204 );
|
|
434
|
+
}
|
|
435
|
+
} catch ( error ) {
|
|
436
|
+
logger.error( { error: error, message: req.query, function: 'zoneInteractionTable430' } );
|
|
437
|
+
return res.sendError( { error: error }, 500 );
|
|
438
|
+
}
|
|
439
|
+
};
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
zoneSegmentationV1,
|
|
27
27
|
zoneInteractionTable430,
|
|
28
28
|
zoneInteractionTable459,
|
|
29
|
+
zoneInteractionTableExport430,
|
|
29
30
|
isAllowedClient,
|
|
30
31
|
} from '../controllers/analysisZoneV1.controllers.js';
|
|
31
32
|
|
|
@@ -87,6 +88,11 @@ analysisZoneRouter
|
|
|
87
88
|
userType: [ 'tango', 'client' ], access: [
|
|
88
89
|
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
89
90
|
],
|
|
90
|
-
} ), validate( validationDtos.validatezoneInteractionTable459Params ), zoneInteractionTable459 )
|
|
91
|
+
} ), validate( validationDtos.validatezoneInteractionTable459Params ), zoneInteractionTable459 )
|
|
92
|
+
.post( '/zoneInteractionTableExport_430', isAllowedSessionHandler, isAllowedClient, accessVerification( {
|
|
93
|
+
userType: [ 'tango', 'client' ], access: [
|
|
94
|
+
{ featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
|
|
95
|
+
],
|
|
96
|
+
} ), validate( validationDtos.validatezoneInteractionTable430Params ), zoneInteractionTableExport430 );
|
|
91
97
|
|
|
92
98
|
export default analysisZoneRouter;
|