tango-app-api-analysis-traffic 3.0.0-alpha.33 → 3.0.0-alpha.34

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-traffic",
3
- "version": "3.0.0-alpha.33",
3
+ "version": "3.0.0-alpha.34",
4
4
  "description": "Traffic Analysis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -62,6 +62,33 @@ export const cardsFunnelV1 = async ( req, res ) => {
62
62
  }
63
63
  };
64
64
 
65
+ export const funnelV1 = async ( req, res ) => {
66
+ try {
67
+ let reqestData = req.body;
68
+ let getClientData = await getClientConfig( reqestData.clientId );
69
+ if ( !getClientData ) {
70
+ return res.sendError( 'Invalid Client Id', 400 );
71
+ }
72
+ reqestData.featureConfigs = getClientData.featureConfigs;
73
+ reqestData.currency = getClientData.paymentInvoice?.currencyType || 'inr';
74
+ reqestData.revenue = getClientData.averageTransactionValue || '0';
75
+ let LamdaURL = 'https://k3mv4jr6w7er4tn3ku2kkdgdha0ovyog.lambda-url.ap-south-1.on.aws/';
76
+ let resultData = await LamdaServiceCall( LamdaURL, reqestData );
77
+ if ( resultData ) {
78
+ if ( resultData.status_code == '200' ) {
79
+ return res.sendSuccess( resultData );
80
+ } else {
81
+ return res.sendError( 'No Content', 204 );
82
+ }
83
+ } else {
84
+ return res.sendError( 'No Content', 204 );
85
+ }
86
+ } catch ( error ) {
87
+ logger.error( { error: error, message: req.query, function: 'funnelV1' } );
88
+ return res.sendError( { error: error }, 500 );
89
+ }
90
+ };
91
+
65
92
  export const cardsGraphsV1 = async ( req, res ) => {
66
93
  try {
67
94
  let reqestData = req.body;
@@ -53,6 +53,7 @@ import {
53
53
  headerGroupsV1,
54
54
  getMySubscription,
55
55
  getStoreMapData,
56
+ funnelV1,
56
57
  } from '../controllers/tangoTrafficV1.controllers.js';
57
58
 
58
59
 
@@ -84,6 +85,11 @@ analysisTrafficRouter
84
85
  { featureName: 'analytics', name: 'tangoTraffic', permissions: [ 'isView' ] },
85
86
  ],
86
87
  } ), validate( validationDtos.validateCardFunnelParams ), cardsFunnelV1 )
88
+ .post( '/funnel_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
89
+ userType: [ 'tango', 'client' ], access: [
90
+ { featureName: 'analytics', name: 'tangoTraffic', permissions: [ 'isView' ] },
91
+ ],
92
+ } ), validate( validationDtos.validateCardFunnelParams ), funnelV1 )
87
93
  .post( '/cardsGraphs_v1', isAllowedSessionHandler, isAllowedClient, authorize( {
88
94
  userType: [ 'tango', 'client' ], access: [
89
95
  { featureName: 'analytics', name: 'tangoTraffic', permissions: [ 'isView' ] },