tango-app-api-analysis-traffic 3.0.0-alpha.36 → 3.0.0-alpha.37

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.36",
3
+ "version": "3.0.0-alpha.37",
4
4
  "description": "Traffic Analysis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  "mongodb": "^6.8.0",
23
23
  "nodemon": "^3.1.4",
24
24
  "tango-api-schema": "^2.0.131",
25
- "tango-app-api-middleware": "^3.1.43-alpha.6",
25
+ "tango-app-api-middleware": "^3.1.43-alpha.8",
26
26
  "winston": "^3.13.1",
27
27
  "winston-daily-rotate-file": "^5.0.0"
28
28
  },
@@ -898,6 +898,7 @@ async function getClusterStoresIds( userClientId, storeIds, getRole, getUserType
898
898
  $and: [
899
899
  { clientId: { $eq: userClientId } },
900
900
  { 'stores.storeId': { $in: storeIds } },
901
+ { 'Teamlead.email': req.user.email },
901
902
  ],
902
903
  },
903
904
  },
@@ -1534,6 +1535,8 @@ async function getclusterList( userClientId, req ) {
1534
1535
  if ( req.body.assignedStores&&req.body.assignedStores.length>0 ) {
1535
1536
  filter.push( { 'stores.storeId': { $in: req.body.assignedStores } } );
1536
1537
  }
1538
+ console.log( req.user.email );
1539
+ filter.push( { 'Teamlead.email': req.user.email } );
1537
1540
 
1538
1541
  let clusterQuery = [
1539
1542
  {
@@ -1884,7 +1887,7 @@ export const getStoreMapData = async ( req, res ) => {
1884
1887
  reqestData.fromDate = dayjs( fromDate ).format( 'YYYY-MM-DD' );
1885
1888
  let footfallLamdaURL = 'https://3ircml3r6dm7fbiif3ti2wwdee0zqhyb.lambda-url.ap-south-1.on.aws/';
1886
1889
  let footfallResultData = await LamdaServiceCall( footfallLamdaURL, reqestData );
1887
- if ( footfallResultData && footfallResultData.avgData.length>0 ) {
1890
+ if ( footfallResultData && footfallResultData.avgData&&footfallResultData.avgData.length>0 ) {
1888
1891
  avgData.avgFootfall = footfallResultData.avgData[0].avgFootfall;
1889
1892
  avgData.avgWeekdayFootfall = footfallResultData.avgData[0].avgWeekdayFootfall;
1890
1893
  avgData.avgWeekendFootfall = footfallResultData.avgData[0].avgWeekendFootfall;