tango-app-api-analysis-zone 3.7.1-alpha.3 → 3.7.1-alpha.5

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.7.1-alpha.3",
3
+ "version": "3.7.1-alpha.5",
4
4
  "description": "zone Analysis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -812,6 +812,27 @@ export const ZonewiseCustomerFunnelExport = async ( req, res ) => {
812
812
 
813
813
 
814
814
  // new Pantprojects api for Zone FF V2
815
+ export const getZoneAPIFFV2 = async ( req, res ) => {
816
+ try {
817
+ let reqestData = req.body;
818
+ let LamdaURL = 'https://kxz75vd4lsgpf4ykytgmyllmoa0xwixt.lambda-url.ap-south-1.on.aws/';
819
+ let resultData = await LamdaServiceCall( LamdaURL, reqestData );
820
+ if ( resultData ) {
821
+ // if ( resultData. == '200' ) {
822
+ // console.log( 'resultData =>', resultData );
823
+ return res.sendSuccess( resultData );
824
+ // } else {
825
+ // return res.sendError( 'No Content', 204 );
826
+ // }
827
+ } else {
828
+ return res.sendError( 'No Content', 204 );
829
+ }
830
+ } catch ( error ) {
831
+ logger.error( { error: error, message: req.query, function: 'getZoneAPIFFV2' } );
832
+ return res.sendError( { error: error }, 500 );
833
+ }
834
+ };
835
+
815
836
  export const getNewZoneFFV2 = async ( req, res ) => {
816
837
  try {
817
838
  let reqestData = req.body;
@@ -832,7 +853,6 @@ export const getNewZoneFFV2 = async ( req, res ) => {
832
853
  return res.sendError( { error: error }, 500 );
833
854
  }
834
855
  };
835
-
836
856
  export const getSelectedZoneFFV2 = async ( req, res ) => {
837
857
  try {
838
858
  let reqestData = req.body;
@@ -855,14 +875,20 @@ export const getSelectedZoneFFV2 = async ( req, res ) => {
855
875
  // Conditionally add zone values if present
856
876
  if ( element.zone1FF !== undefined && element.zone1FF !== null ) {
857
877
  row['Zone 1 FF'] = element.zone1FF;
858
- row['Zone 1 Conc %'] = element.zone1Percentage !== undefined ? `${element.zone1Percentage}%` : '--';
859
878
  }
860
879
  if ( element.zone2FF !== undefined && element.zone2FF !== null ) {
861
880
  row['Zone 2 FF'] = element.zone2FF;
862
- row['Zone 2 Conc %'] = element.zone2Percentage !== undefined ? `${element.zone2Percentage}%` : '--';
863
881
  }
864
882
  if ( element.zone3FF !== undefined && element.zone3FF !== null ) {
865
883
  row['Zone 3 FF'] = element.zone3FF;
884
+ }
885
+ if ( element.zone1Percentage !== undefined && element.zone1Percentage !== null ) {
886
+ row['Zone 1 Conc %'] = element.zone1Percentage !== undefined ?`${element.zone1Percentage}%` : '--';
887
+ }
888
+ if ( element.zone2Percentage !== undefined && element.zone2Percentage !== null ) {
889
+ row['Zone 2 Conc %'] = element.zone2Percentage !== undefined ? `${element.zone2Percentage}%` : '--';
890
+ }
891
+ if ( element.zone3Percentage !== undefined && element.zone3Percentage !== null ) {
866
892
  row['Zone 3 Conc %'] = element.zone3Percentage !== undefined ? `${element.zone3Percentage}%` : '--';
867
893
  }
868
894
 
@@ -41,6 +41,7 @@ import {
41
41
  ZonewiseCustomerFunnelExport,
42
42
  getNewZoneFFV2,
43
43
  getSelectedZoneFFV2,
44
+ getZoneAPIFFV2,
44
45
  } from '../controllers/analysisZoneV1.controllers.js';
45
46
 
46
47
  analysisZoneRouter
@@ -165,5 +166,6 @@ analysisZoneRouter
165
166
 
166
167
 
167
168
  .post( '/getNewZoneFF_v2', getNewZoneFFV2 )
168
- .post( '/getSelectedZoneFF_v2', getSelectedZoneFFV2 );
169
+ .post( '/getSelectedZoneFF_v2', getSelectedZoneFFV2 )
170
+ .post( '/getZoneAPI_v2', getZoneAPIFFV2 );
169
171
  export default analysisZoneRouter;