tango-app-api-audit 3.5.38 → 3.5.40

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.5.38",
3
+ "version": "3.5.40",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1706,6 +1706,7 @@ export async function summaryList( req, res ) {
1706
1706
  temp[i].RMEmail =RMEmail;
1707
1707
  const trustScore = temp[i].trustScore;
1708
1708
  temp[i].trustScore = ( trustScore == null || trustScore == undefined ) ? 'NA' :`${trustScore + ' %'}`;
1709
+ temp[i]._id = item?._id;
1709
1710
  }
1710
1711
  }
1711
1712
 
@@ -1940,15 +1941,17 @@ export async function summaryCard( req, res ) {
1940
1941
  tangoScore: 0,
1941
1942
  tangoScoreTrend: 0,
1942
1943
  trustScore: 0,
1944
+ trend: false,
1943
1945
  };
1944
1946
  if ( getOutput?.body?.aggregations?.all_docs?.wrapper?.buckets?.filtered ) {
1945
1947
  const temp= getOutput?.body?.aggregations?.all_docs?.wrapper?.buckets?.filtered;
1946
1948
  initialValue.totalFiles =temp?.totalFiles?.value;
1947
1949
  initialValue.completedFiles =temp?.completedFiles?.doc_count;
1948
1950
  initialValue.completedRatio =temp?.completedRatio?.value || 0;
1949
- initialValue.tangoScore =temp?.tangoScore?.value || 0;
1951
+ initialValue.tangoScore =Math.round( temp?.tangoScore?.value || 0 );
1950
1952
  initialValue.tangoScoreTrend =temp?.tangoScoreTrend?.value || 0;
1951
- initialValue.trustScore =temp?.trustScore?.avg_val?.value == null ? 'NA':temp?.trustScore?.avg_val?.value;
1953
+ initialValue.trustScore =temp?.trustScore?.avg_val?.value == null || temp?.trustScore?.avg_val?.value === undefined ? 'NA':Math.round( temp?.trustScore?.avg_val?.value );
1954
+ initialValue.trend = initialValue.tangoScoreTrend < 0? false : true;
1952
1955
  }
1953
1956
  const result = initialValue;
1954
1957
 
@@ -2063,7 +2066,7 @@ export async function emailAlertLog( req, res ) {
2063
2066
 
2064
2067
 
2065
2068
  logger.info( { inputData: inputData, getData: response } );
2066
- return res.sendSuccess( { result: response } );
2069
+ return res.sendSuccess( { result: response, count: response.length } );
2067
2070
  } catch ( error ) {
2068
2071
  const err = error.message || 'Internal Server Error';
2069
2072
  logger.error( { message: error, data: req.body, function: 'eyetestAudit-controller-emailAlertLog' } );