tango-app-api-analysis-zone 3.0.0-alpha.30 → 3.0.0-alpha.32

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-analysis-zone",
3
- "version": "3.0.0-alpha.30",
3
+ "version": "3.0.0-alpha.32",
4
4
  "description": "zone Analysis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -259,6 +259,20 @@ export const zoneSegmentationV1 = async ( req, res ) => {
259
259
  let resultData = await LamdaServiceCall( LamdaURL, reqestData );
260
260
  if ( resultData ) {
261
261
  if ( resultData.status_code == '200' ) {
262
+ if ( reqestData.export ) {
263
+ if ( resultData.segmentationAnalysis.length>0 ) {
264
+ const exportdata = [];
265
+ resultData.segmentationAnalysis.forEach( ( element ) => {
266
+ exportdata.push( {
267
+ 'Entrance': element.category,
268
+ 'Entrance wise footfall': element.value,
269
+ } );
270
+ } );
271
+ return await download( exportdata, res );
272
+ } else {
273
+ return res.sendError( 'No Content', 204 );
274
+ }
275
+ }
262
276
  return res.sendSuccess( resultData );
263
277
  } else {
264
278
  return res.sendError( 'No Content', 204 );
@@ -216,6 +216,7 @@ export const validateCustomerJourneyTableV2Params = {
216
216
 
217
217
  export const validateZoneSegmentationSchema = joi.object( {
218
218
  ...baseSchema,
219
+ export: joi.boolean().required(),
219
220
  } );
220
221
  export const validateZoneSegmentationParams = {
221
222
  body: validateZoneSegmentationSchema,