tango-app-api-audit 3.6.19 → 3.6.20

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-audit",
3
- "version": "3.6.19",
3
+ "version": "3.6.20",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1243,7 +1243,7 @@ export async function summaryList( req, res ) {
1243
1243
  const sortBy = inputData?.sortBy ? [ 'coveredStepsAI', 'trustScore', 'date', 'ComplianceScore', 'auditedSteps' ].includes( inputData.sortBy ) ? inputData.sortBy :`${inputData.sortBy}.keyword` : 'storeName.keyword';
1244
1244
  const order = inputData?.sortOrder || -1;
1245
1245
 
1246
- // declare filter and assign range values from inputData
1246
+ // declare filter and assign range values from inputData
1247
1247
  let filter= [
1248
1248
  {
1249
1249
  'range': {
@@ -1265,7 +1265,7 @@ export async function summaryList( req, res ) {
1265
1265
  } );
1266
1266
  }
1267
1267
 
1268
- // filter by Visitors Type if key has minimum one element
1268
+ // filter by Visitors Type if key has minimum one element
1269
1269
  if ( inputData?.demographics && inputData?.demographics?.length > 0 ) {
1270
1270
  filter.push( {
1271
1271
  'terms': {
@@ -1303,8 +1303,7 @@ export async function summaryList( req, res ) {
1303
1303
  },
1304
1304
 
1305
1305
  } );
1306
- }
1307
- else {
1306
+ } else {
1308
1307
  return res.sendError( 'No data found', 204 );
1309
1308
  }
1310
1309
 
@@ -1315,8 +1314,7 @@ export async function summaryList( req, res ) {
1315
1314
 
1316
1315
  // filter by complianceScore/tango score if key has minimum one element
1317
1316
  if ( inputData.complianceScore && inputData.complianceScore?.length > 0 ) {
1318
-
1319
- // If the key type is not 'store', split the compliance score ranges
1317
+ // If the key type is not 'store', split the compliance score ranges
1320
1318
  if ( inputData.keyType !== 'store' ) {
1321
1319
  const rangeShould = inputData?.complianceScore?.map( ( r ) => {
1322
1320
  const [ gte, lte ] = r.split( '-' ).map( Number );
@@ -1326,7 +1324,7 @@ export async function summaryList( req, res ) {
1326
1324
  },
1327
1325
  };
1328
1326
  } );
1329
- // Add the range conditions to mustQuery (any one of the ranges should match)
1327
+ // Add the range conditions to mustQuery (any one of the ranges should match)
1330
1328
  mustQuery.push(
1331
1329
  {
1332
1330
  bool: {
@@ -1335,9 +1333,7 @@ export async function summaryList( req, res ) {
1335
1333
  },
1336
1334
  },
1337
1335
  );
1338
- }
1339
- // If-else condition: use 'terms' filter to match records by Compliance Score / Tango Score
1340
- else {
1336
+ } else { // If-else condition: use 'terms' filter to match records by Compliance Score / Tango Score
1341
1337
  const values = Array.isArray( inputData.complianceScore ) ?
1342
1338
  inputData.complianceScore.map( Number ) :
1343
1339
  [ Number( inputData.complianceScore ) ];
@@ -2570,14 +2566,18 @@ export async function emailAlertLog( req, res ) {
2570
2566
  let response =[];
2571
2567
  for ( let item of getData?.body?.hits?.hits ) {
2572
2568
  response.push( {
2573
- RMEmail: item?._source?.RMEmail,
2569
+ RMEmail: item?._source?.RMEmail || '',
2570
+ RMName: item?._source?.RMName || '',
2574
2571
  cluster: item?._source?.cluster,
2575
2572
  optumId: item?._source?.optumId,
2573
+ optomEmailId: item?._source?.optomEmailId,
2576
2574
  storeName: item?._source?.storeName,
2577
2575
  complianceScore: item?._source?.complianceScore,
2576
+ humanScore: item?._source?.humanScore,
2578
2577
  trustScore: item?._source?.trustScore,
2579
2578
  auditedId: item?._source?.auditedId,
2580
2579
  queueId: item?._source?.queueId,
2580
+ auditedBy: item?._source?.auditedBy,
2581
2581
 
2582
2582
  } );
2583
2583
  }