tango-app-api-analysis-zone 3.1.13 → 3.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-analysis-zone",
3
- "version": "3.1.13",
3
+ "version": "3.4.0",
4
4
  "description": "zone Analysis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -532,12 +532,13 @@ export const zoneInteractionTable430Export = async ( req, res ) => {
532
532
  'Passer By': element.passer_by || '--',
533
533
  'Footfall': element.footfall || '--',
534
534
  'Drop In Rate': element.drop_in_rate +'%',
535
- 'Customer Attended ': element.customer_attended || '--',
535
+ 'Greetings Count': element.greeting_count || '--',
536
+ 'Greetings Rate': ( ( element.greeting_count / element.footfall ) * 100 ).toFixed( 1 ) + '%' || '--',
537
+ 'Customer Interacted': element.customer_attended || '--',
536
538
  'Interation Rate ': element.interaction_rate +'%',
539
+ 'Avg Time To Interact': element.avg_interaction_time || '--',
537
540
  'Billing Conversion': element.footfall_overamin_inzone || '--',
538
541
  'Billing Conversion Rate': element.billing_conversion_rate +'%',
539
- 'Greetings Count': element.greeting_count || '--',
540
- 'Avg Interaction Time': element.avg_interaction_time || '--',
541
542
  } );
542
543
  } );
543
544
  return await download( exportdata, res );
@@ -672,3 +673,23 @@ export const zonePasserByTable430Export = async ( req, res ) => {
672
673
  }
673
674
  };
674
675
 
676
+ export const interactionTableV1 = async ( req, res ) => {
677
+ try {
678
+ let reqestData = req.body;
679
+ let LamdaURL = 'https://ciwoce4ore3iyx5x5eicp2lpii0yutva.lambda-url.ap-south-1.on.aws/';
680
+ let resultData = await LamdaServiceCall( LamdaURL, reqestData );
681
+ if ( resultData ) {
682
+ if ( resultData.status_code == '200' ) {
683
+ return res.sendSuccess( resultData );
684
+ } else {
685
+ return res.sendError( 'No Content', 204 );
686
+ }
687
+ } else {
688
+ return res.sendError( 'No Content', 204 );
689
+ }
690
+ } catch ( error ) {
691
+ logger.error( { error: error, message: req.query, function: 'interactionTableV1' } );
692
+ return res.sendError( { error: error }, 500 );
693
+ }
694
+ };
695
+
@@ -35,6 +35,7 @@ import {
35
35
  zoneSegmentationTableExport,
36
36
  zonePasserByTableV1,
37
37
  zonePasserByTable430Export,
38
+ interactionTableV1,
38
39
  } from '../controllers/analysisZoneV1.controllers.js';
39
40
 
40
41
  analysisZoneRouter
@@ -135,5 +136,10 @@ analysisZoneRouter
135
136
  userType: [ 'tango', 'client' ], access: [
136
137
  { featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
137
138
  ],
138
- } ), validate( validationDtos.validatezoneSegmaentationTableParams ), zonePasserByTable430Export );
139
+ } ), validate( validationDtos.validatezoneSegmaentationTableParams ), zonePasserByTable430Export )
140
+ .post( '/interactionTable_v1', isAllowedSessionHandler, isAllowedClient, accessVerification( {
141
+ userType: [ 'tango', 'client' ], access: [
142
+ { featureName: 'TangoEye', name: 'ZoneTag', permissions: [] },
143
+ ],
144
+ } ), validate( validationDtos.validatezoneSegmaentationTableParams ), interactionTableV1 );
139
145
  export default analysisZoneRouter;