tango-app-api-analysis-traffic 3.8.13 → 3.8.14

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/.eslintrc.cjs CHANGED
@@ -36,7 +36,7 @@ module.exports = {
36
36
  'no-unused-vars': 'error',
37
37
  'new-cap': [ 'error', { 'newIsCap': true, 'capIsNew': false } ],
38
38
  'prefer-const': 'off',
39
- // 'no-console': 'error',
39
+ 'no-console': 'error',
40
40
  },
41
41
  };
42
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-analysis-traffic",
3
- "version": "3.8.13",
3
+ "version": "3.8.14",
4
4
  "description": "Traffic Analysis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -63,7 +63,6 @@ export async function addBills( req, res ) {
63
63
  let resData = [];
64
64
  const openSearch = JSON.parse( process.env.OPENSEARCH );
65
65
  const inputData = req.tempInserData;
66
- console.log( '🚀 ~ addBills ~ inputData:', inputData.length );
67
66
  // return;
68
67
  for ( let i = 0; i < inputData?.length; i++ ) {
69
68
  await updateOneNobBilling( inputData[i]?.query, inputData[i]?.data );
@@ -166,7 +165,6 @@ export async function getNobData( req, res ) {
166
165
  };
167
166
 
168
167
  const getNobData = await getOpenSearchData( openSearch.nob, nobQuery );
169
- console.log( '🚀 ~ getNobData ~ openSearch.nob:', openSearch.nob );
170
168
  const nobData = getNobData?.body?.hits?.hits;
171
169
  if ( !nobData || nobData?.length == 0 ) {
172
170
  if ( inputData.searchValue && inputData.searchValue !== '' || inputData.offset > 1 ) {
@@ -593,7 +593,6 @@ export async function expireReviewStatus( req, res ) {
593
593
 
594
594
  cutoffDate.setUTCHours( 23, 59, 59, 0 );
595
595
 
596
- console.log( cutoffDate );
597
596
  if ( Number.isNaN( cutoffDate.getTime() ) ) {
598
597
  return res.sendError( 'Invalid thresholdDate', 400 );
599
598
  }
@@ -1010,14 +1009,7 @@ export async function storeProcessedData( req, res ) {
1010
1009
  const footfallDirRes = await getOpenSearchData( openSearch.footfallDirectory, footfallDirQuery );
1011
1010
  const hit = footfallDirRes?.body?.hits?.hits?.[0];
1012
1011
  receivedfootfall = hit._source.footfallCount;
1013
- if ( hit?._source?.mappingInfo && Array.isArray( hit._source.mappingInfo ) ) {
1014
- for ( let i = 0; i < hit._source.mappingInfo.length; i++ ) {
1015
- if ( hit._source.mappingInfo[i].type === 'tagging' ) {
1016
- ticketStatus = hit._source.mappingInfo[i].status;
1017
- break;
1018
- }
1019
- }
1020
- }
1012
+ ticketStatus = hit?._source?.status;
1021
1013
  } catch ( err ) {
1022
1014
  logger.warn( { message: 'Could not get ticket status from footfallDirectory', error: err } );
1023
1015
  }
@@ -1044,7 +1036,6 @@ export async function storeProcessedData( req, res ) {
1044
1036
  raisedStatusEnabled,
1045
1037
  footfallticketCount: statusArray.includes( ticketStatus )?receivedfootfall:processedData?.footfall_count,
1046
1038
  } );
1047
- console.log( '🚀 ~ storeProcessedData ~ ticketStatus:', ticketStatus );
1048
1039
 
1049
1040
  if ( raisedStatusEnabled === 'block' ) {
1050
1041
  // Calculate the number of days from currentDate + 1 to the end of the month
@@ -1274,6 +1265,9 @@ export async function footFallImages( req, res ) {
1274
1265
  // temp.length? temp[0].status = 'open': null;
1275
1266
 
1276
1267
  if ( resultData.status_code == '200' ) {
1268
+ if ( !req?.store?.footfallDirectoryConfigs?.contactEmail ||( req?.store?.footfallDirectoryConfigs && req?.store?.footfallDirectoryConfigs?.contactEmail && req?.store?.footfallDirectoryConfigs?.contactEmail === '' ) ) {
1269
+ req.store.footfallDirectoryConfigs.contactEmail = getFinal?.contactEmail || '';
1270
+ }
1277
1271
  return res.sendSuccess( { ...resultData, ticketStatus: temp?.length > 0 && ticketDetails? temp : null, config: req?.store?.footfallDirectoryConfigs } );
1278
1272
  } else {
1279
1273
  return res.sendError( 'No Content', 204 );
@@ -1,7 +1,6 @@
1
1
  import nobBillingModel from 'tango-api-schema/schema/nobBilling.model.js';
2
2
 
3
3
  export async function updateOneNobBilling( query, record ) {
4
- console.log( '🚀 ~ updateOneNobBilling ~ record:', record );
5
4
  return await nobBillingModel.updateOne( query, { $set: record }, { upsert: true } );
6
5
  }
7
6
 
@@ -284,6 +284,14 @@ export async function mappingConfig( req, res, next ) {
284
284
  },
285
285
  },
286
286
  ],
287
+ must_not: [
288
+ {
289
+ term: {
290
+ 'parent': inputData?.tempId || '', // Exclude current tempId if it's a duplicate tagging (to avoid counting the same image twice)
291
+ },
292
+ },
293
+ ],
294
+
287
295
  },
288
296
  },
289
297
  };