tango-app-api-analysis-zone 3.0.0-alpha.28 → 3.0.0-alpha.29

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.28",
3
+ "version": "3.0.0-alpha.29",
4
4
  "description": "zone Analysis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -251,6 +251,26 @@ export const zoneHeatmapDatasV1 = async ( req, res ) => {
251
251
  }
252
252
  };
253
253
 
254
+ export const zoneSegmentationV1 = async ( req, res ) => {
255
+ try {
256
+ let reqestData = req.body;
257
+ let LamdaURL = 'https://7ijmuxyqsv7rdz6pkz6fhk6ka40cipbh.lambda-url.ap-south-1.on.aws/';
258
+ let resultData = await LamdaServiceCall( LamdaURL, reqestData );
259
+ if ( resultData ) {
260
+ if ( resultData.status_code == '200' ) {
261
+ return res.sendSuccess( resultData );
262
+ } else {
263
+ return res.sendError( 'No Content', 204 );
264
+ }
265
+ } else {
266
+ return res.sendError( 'No Content', 204 );
267
+ }
268
+ } catch ( error ) {
269
+ logger.error( { error: error, message: req.query, function: 'zoneSegmentationV1' } );
270
+ return res.sendError( { error: error }, 500 );
271
+ }
272
+ };
273
+
254
274
  export async function isAllowedClient( req, res, next ) {
255
275
  try {
256
276
  let reqestData = req.body;
@@ -214,4 +214,11 @@ export const validateCustomerJourneyTableV2Params = {
214
214
  body: validatCustomerJourneyTableV2Schema,
215
215
  };
216
216
 
217
+ export const validateZoneSegmentationSchema = joi.object( {
218
+ ...baseSchema,
219
+ } );
220
+ export const validateZoneSegmentationParams = {
221
+ body: validateZoneSegmentationSchema,
222
+ };
223
+
217
224
 
@@ -23,6 +23,7 @@ import {
23
23
  zoneConcentrationSummaryTableV1,
24
24
  zoneHeatmapAvailableDatesV1,
25
25
  zoneHeatmapDatasV1,
26
+ zoneSegmentationV1,
26
27
  isAllowedClient,
27
28
  } from '../controllers/analysisZoneV1.controllers.js';
28
29
 
@@ -69,6 +70,11 @@ analysisZoneRouter
69
70
  userType: [ 'tango', 'client' ], access: [
70
71
  { featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
71
72
  ],
72
- } ), validate( validationDtos.validateZoneHeatmapDatasParams ), zoneHeatmapDatasV1 );
73
+ } ), validate( validationDtos.validateZoneHeatmapDatasParams ), zoneHeatmapDatasV1 )
74
+ .post( '/zoneSegmentation_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
75
+ userType: [ 'tango', 'client' ], access: [
76
+ { featureName: 'analytics', name: 'tangoZone', permissions: [ 'isView' ] },
77
+ ],
78
+ } ), validate( validationDtos.validateZoneSegmentationParams ), zoneSegmentationV1 );
73
79
 
74
80
  export default analysisZoneRouter;