tango-app-api-analysis-zone 3.0.0-alpha.37 → 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
|
@@ -401,3 +401,39 @@ export async function isAllowedClient( req, res, next ) {
|
|
|
401
401
|
return res.sendError( error, 500 );
|
|
402
402
|
}
|
|
403
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;
|