tango-app-api-audit 3.5.41 → 3.5.42

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.41",
3
+ "version": "3.5.42",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -255,9 +255,9 @@ export async function getList( req, res ) {
255
255
  'Store ID': element?._source?.storeId || 'Un Assigned',
256
256
  'Store Name': element?._source?.storeName ||'Un Assigned',
257
257
  'Engagement ID': element?._source?.engagementId,
258
- 'Compliance Score': element?._source?.totalSteps>0 ? Math.round( ( element?._source?.coveredStepsAI/ element?._source?.totalSteps )*100 ): 0,
258
+ 'Compliance Score': element?._source?.totalSteps>0 ? Math.round( ( element?._source?.coveredStepsAI/ element?._source?.totalSteps )*100 )+' %': '0 %',
259
259
  'Steps Covered By AI': element?._source?.coveredStepsAI || 0,
260
- 'Trust Score': element?._source?.trustScore ||0,
260
+ 'Trust Score': `${element?._source?.trustScore || 0} %`,
261
261
  'Test Duration': duration || '',
262
262
  'Audit Status': element?._source?.auditStatus || '',
263
263
  'Audited By': userName?.userName || '',
@@ -280,7 +280,8 @@ export async function getList( req, res ) {
280
280
  const testDuration = searchValue[i]?._source?.testDuration;
281
281
  const minutes = Math.floor( testDuration / 60 );
282
282
  const seconds = testDuration % 60;
283
- searchValue[i]._source.complianceScore = searchValue[i]?._source?.totalSteps>0 ? Math.round( ( searchValue[i]?._source?.coveredStepsAI/ searchValue[i]?._source?.totalSteps )*100 ): 0;
283
+ searchValue[i]._source.complianceScore = searchValue[i]?._source?.totalSteps>0 ? Math.round( ( searchValue[i]?._source?.coveredStepsAI/ searchValue[i]?._source?.totalSteps )*100 ) + ' %': '0 %';
284
+ searchValue[i]._source.trustScore = searchValue[i]._source.trustScore !== null && searchValue[i]._source.trustScore !== undefined? Math( searchValue[i]._source.trustScore ) + ' %': 'NA';
284
285
  searchValue[i]._source.min = minutes;
285
286
  searchValue[i]._source.sec = seconds;
286
287
  searchValue[i]._source.auditedBy = userName?.userName || '';
@@ -1379,7 +1380,6 @@ export async function summaryList( req, res ) {
1379
1380
  const temp =[];
1380
1381
  for ( const [ i, cluster ] of getCluster.entries() ) {
1381
1382
  temp.push( cluster );
1382
-
1383
1383
  const getClusterQuery= {
1384
1384
  'size': 0,
1385
1385
  'query': {
@@ -1419,7 +1419,7 @@ export async function summaryList( req, res ) {
1419
1419
  temp[i].totalFiles = getResponse?.body?.aggregations?.total_count?.value || 0,
1420
1420
  temp[i].completedFiles=getResponse?.body?.aggregations?.audited_trustScore?.totalCount?.value || 0;
1421
1421
  temp[i].complianceScore = `${ Math.round( getResponse?.body?.aggregations?.avg_complianceScore?.value || 0 )} %`;
1422
- temp[i].trustScore = getResponse?.body?.aggregations?.audited_trustScore?.avg_trustScore?.value ==null || getResponse?.body?.aggregations?.audited_trustScore?.avg_trustScore?.value == undefined ?'NA':`${getResponse?.body?.aggregations?.audited_trustScore?.avg_trustScore?.value + ' %'}`;
1422
+ temp[i].trustScore = getResponse?.body?.aggregations?.audited_trustScore?.avg_trustScore?.value ==null || getResponse?.body?.aggregations?.audited_trustScore?.avg_trustScore?.value == undefined ?'NA':`${Math.round( getResponse?.body?.aggregations?.audited_trustScore?.avg_trustScore?.value ) + ' %'}`;
1423
1423
  }
1424
1424
  }
1425
1425
 
@@ -1673,7 +1673,7 @@ export async function summaryList( req, res ) {
1673
1673
  'Engagement ID': element?._source?.engagementId,
1674
1674
  'Tango Score': `${element?._source?.totalSteps>0 ? Math.round( ( element?._source?.coveredStepsAI/ element?._source?.totalSteps )*100 ): 0} %`,
1675
1675
  'Steps Covered By AI': element?._source?.coveredStepsAI || 0,
1676
- 'Trust Score': `${element?._source?.trustScore ||0}`,
1676
+ 'Trust Score': `${element?._source?.trustScore ||0} %`,
1677
1677
  'Test Duration': duration || '',
1678
1678
  'Audit Status': element?._source?.auditStatus || '',
1679
1679
  'Audited By': userName?.userName || '',