tango-app-api-audit 3.6.14 → 3.6.16
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
|
@@ -1264,10 +1264,10 @@ export async function summaryList( req, res ) {
|
|
|
1264
1264
|
if ( inputData.complianceScore && inputData.complianceScore?.length > null ) {
|
|
1265
1265
|
if ( inputData.keyType !== 'store' ) {
|
|
1266
1266
|
const rangeShould = inputData?.complianceScore?.map( ( r ) => {
|
|
1267
|
-
const [ gte,
|
|
1267
|
+
const [ gte, lte ] = r.split( '-' ).map( Number );
|
|
1268
1268
|
return {
|
|
1269
1269
|
range: {
|
|
1270
|
-
ComplianceScore: { gte,
|
|
1270
|
+
ComplianceScore: { gte, lte },
|
|
1271
1271
|
},
|
|
1272
1272
|
};
|
|
1273
1273
|
} );
|
|
@@ -1276,6 +1276,7 @@ export async function summaryList( req, res ) {
|
|
|
1276
1276
|
{
|
|
1277
1277
|
bool: {
|
|
1278
1278
|
should: rangeShould, // any one of the ranges should match
|
|
1279
|
+
minimum_should_match: 1,
|
|
1279
1280
|
},
|
|
1280
1281
|
},
|
|
1281
1282
|
);
|
|
@@ -1550,6 +1551,7 @@ export async function summaryList( req, res ) {
|
|
|
1550
1551
|
},
|
|
1551
1552
|
},
|
|
1552
1553
|
};
|
|
1554
|
+
logger.info( { getClusterQuery: getClusterQuery } );
|
|
1553
1555
|
const getResponse = await getOpenSearchData( openSearch.EyeTestInput, getClusterQuery );
|
|
1554
1556
|
if ( getResponse?.body?.aggregations ) {
|
|
1555
1557
|
delete temp[i].store;
|
|
@@ -1892,7 +1894,7 @@ export async function summaryList( req, res ) {
|
|
|
1892
1894
|
'Queue ID': element?._source?.queueId,
|
|
1893
1895
|
'Tango Score': `${element?._source?.totalSteps>0 ? Math.round( ( element?._source?.coveredStepsAI/ element?._source?.totalSteps )*100 ): 0} %`,
|
|
1894
1896
|
'Steps Covered By AI': element?._source?.coveredStepsAI || 0,
|
|
1895
|
-
'Human Score': [ 'Re-Audited', 'Audited' ].includes( element?._source?.auditStatus )?`${element?._source?.totalSteps>0 ? Math.round( ( element?._source?.auditedSteps/ element?._source?.totalSteps )*100 ): 0} %`:'NA',
|
|
1897
|
+
'Human Audited Score': [ 'Re-Audited', 'Audited' ].includes( element?._source?.auditStatus )?`${element?._source?.totalSteps>0 ? Math.round( ( element?._source?.auditedSteps/ element?._source?.totalSteps )*100 ): 0} %`:'NA',
|
|
1896
1898
|
'Steps Covered By Human': [ 'Re-Audited', 'Audited' ].includes( element?._source?.auditStatus )?element?._source?.auditedSteps :'NA',
|
|
1897
1899
|
'Trust Score': element?._source?.trustScore == null || element?._source?.trustScore ==undefined ? 'NA' : `${element?._source?.trustScore} %`,
|
|
1898
1900
|
'Visitor Type': element?._source?.visitorsType,
|
|
@@ -1915,7 +1917,7 @@ export async function summaryList( req, res ) {
|
|
|
1915
1917
|
'Store Name': element?._source?.storeName ||'Un Assigned',
|
|
1916
1918
|
'Engagement ID': element?._source?.engagementId,
|
|
1917
1919
|
'Tango Score': `${element?._source?.totalSteps>0 ? Math.round( ( element?._source?.coveredStepsAI/ element?._source?.totalSteps )*100 ): 0} %`,
|
|
1918
|
-
'Human Score': [ 'Re-Audited', 'Audited' ].includes( element?._source?.auditStatus )?`${element?._source?.totalSteps>0 ? Math.round( ( element?._source?.auditedSteps/ element?._source?.totalSteps )*100 ): 0} %`:'NA',
|
|
1920
|
+
'Human Audited Score': [ 'Re-Audited', 'Audited' ].includes( element?._source?.auditStatus )?`${element?._source?.totalSteps>0 ? Math.round( ( element?._source?.auditedSteps/ element?._source?.totalSteps )*100 ): 0} %`:'NA',
|
|
1919
1921
|
'Steps Covered By AI': element?._source?.coveredStepsAI || 0,
|
|
1920
1922
|
'Steps Covered By Human': [ 'Re-Audited', 'Audited' ].includes( element?._source?.auditStatus )?element?._source?.auditedSteps :'NA',
|
|
1921
1923
|
'Trust Score': element?._source?.trustScore == null || element?._source?.trustScore ==undefined ? 'NA' : `${element?._source?.trustScore} %`,
|
|
@@ -2117,18 +2119,18 @@ export async function summaryCard( req, res ) {
|
|
|
2117
2119
|
if ( inputData.complianceScore && inputData.complianceScore?.length > null ) {
|
|
2118
2120
|
if ( inputData.keyType !== 'store' ) {
|
|
2119
2121
|
const rangeShould = inputData?.complianceScore?.map( ( r ) => {
|
|
2120
|
-
const [ gte,
|
|
2122
|
+
const [ gte, lte ] = r.split( '-' ).map( Number );
|
|
2121
2123
|
return {
|
|
2122
2124
|
range: {
|
|
2123
|
-
ComplianceScore: { gte,
|
|
2125
|
+
ComplianceScore: { gte, lte },
|
|
2124
2126
|
},
|
|
2125
2127
|
};
|
|
2126
2128
|
} );
|
|
2127
|
-
logger.info( { rangeShould: rangeShould } );
|
|
2128
2129
|
mustQuery.push(
|
|
2129
2130
|
{
|
|
2130
2131
|
bool: {
|
|
2131
2132
|
should: rangeShould, // any one of the ranges should match
|
|
2133
|
+
minimum_should_match: 1,
|
|
2132
2134
|
},
|
|
2133
2135
|
},
|
|
2134
2136
|
);
|
|
@@ -2260,6 +2262,34 @@ export async function summaryCard( req, res ) {
|
|
|
2260
2262
|
},
|
|
2261
2263
|
},
|
|
2262
2264
|
|
|
2265
|
+
|
|
2266
|
+
'humanScore': {
|
|
2267
|
+
filter: {
|
|
2268
|
+
terms: {
|
|
2269
|
+
'auditStatus.keyword': [ 'Audited', 'ReAudited' ],
|
|
2270
|
+
},
|
|
2271
|
+
},
|
|
2272
|
+
aggs: {
|
|
2273
|
+
scoreValue: {
|
|
2274
|
+
avg: {
|
|
2275
|
+
script: {
|
|
2276
|
+
source: `
|
|
2277
|
+
if (doc['totalSteps'].size() > 0
|
|
2278
|
+
&& doc['auditedSteps'].size() > 0
|
|
2279
|
+
&& doc['totalSteps'].value > 0) {
|
|
2280
|
+
return (1.0 * doc['auditedSteps'].value / doc['totalSteps'].value) * 100.0;
|
|
2281
|
+
} else {
|
|
2282
|
+
return null;
|
|
2283
|
+
}
|
|
2284
|
+
`,
|
|
2285
|
+
lang: 'painless',
|
|
2286
|
+
},
|
|
2287
|
+
},
|
|
2288
|
+
},
|
|
2289
|
+
},
|
|
2290
|
+
},
|
|
2291
|
+
|
|
2292
|
+
|
|
2263
2293
|
'trustScore': {
|
|
2264
2294
|
filter: {
|
|
2265
2295
|
terms: { 'auditStatus.keyword': [ 'Audited', 'Re-Audited' ] },
|
|
@@ -2313,6 +2343,7 @@ export async function summaryCard( req, res ) {
|
|
|
2313
2343
|
completedFiles: 0,
|
|
2314
2344
|
completedRatio: 0,
|
|
2315
2345
|
tangoScore: 0,
|
|
2346
|
+
humanScore: 0,
|
|
2316
2347
|
tangoScoreTrend: 0,
|
|
2317
2348
|
trustScore: 0,
|
|
2318
2349
|
trend: false,
|
|
@@ -2323,6 +2354,7 @@ export async function summaryCard( req, res ) {
|
|
|
2323
2354
|
initialValue.completedFiles =temp?.completedFiles?.doc_count;
|
|
2324
2355
|
initialValue.completedRatio =Math.round( temp?.completedRatio?.value || 0 );
|
|
2325
2356
|
initialValue.tangoScore =Math.round( temp?.tangoScore?.value || 0 )+ ' %';
|
|
2357
|
+
initialValue.humanScore =Math.round( temp?.humanScore?.value || 0 )+ ' %';
|
|
2326
2358
|
initialValue.tangoScoreTrend =temp?.tangoScoreTrend?.value || 0;
|
|
2327
2359
|
initialValue.trustScore =temp?.trustScore?.avg_val?.value == null || temp?.trustScore?.avg_val?.value === undefined ? 'NA':Math.round( temp?.trustScore?.avg_val?.value );
|
|
2328
2360
|
initialValue.trend = initialValue.tangoScoreTrend < 0? false : true;
|