tango-app-api-audit 3.5.40 → 3.5.41
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
|
@@ -1178,6 +1178,26 @@ export async function summaryList( req, res ) {
|
|
|
1178
1178
|
return res.sendError( 'No data found', 204 );
|
|
1179
1179
|
}
|
|
1180
1180
|
|
|
1181
|
+
if ( inputData?.category ) {
|
|
1182
|
+
switch ( inputData?.category ) {
|
|
1183
|
+
case 'fake':
|
|
1184
|
+
filter.push( {
|
|
1185
|
+
term: {
|
|
1186
|
+
'comment.keyword': 'Possible Fake Video',
|
|
1187
|
+
},
|
|
1188
|
+
} );
|
|
1189
|
+
break;
|
|
1190
|
+
case 'genuine':
|
|
1191
|
+
filter.push( {
|
|
1192
|
+
term: {
|
|
1193
|
+
'comment.keyword': '',
|
|
1194
|
+
},
|
|
1195
|
+
} );
|
|
1196
|
+
break;
|
|
1197
|
+
default: return res.sendError( 'Give valid Category', 400 );
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1181
1201
|
|
|
1182
1202
|
if ( inputData.keyType === 'rm' || inputData.keyType === 'cluster' ) {
|
|
1183
1203
|
let sort ={
|
|
@@ -1359,22 +1379,16 @@ export async function summaryList( req, res ) {
|
|
|
1359
1379
|
const temp =[];
|
|
1360
1380
|
for ( const [ i, cluster ] of getCluster.entries() ) {
|
|
1361
1381
|
temp.push( cluster );
|
|
1382
|
+
|
|
1362
1383
|
const getClusterQuery= {
|
|
1363
1384
|
'size': 0,
|
|
1364
1385
|
'query': {
|
|
1365
1386
|
'bool': {
|
|
1366
1387
|
'must': [
|
|
1367
|
-
|
|
1368
|
-
{ 'term': { 'type.keyword': inputData?.type } },
|
|
1388
|
+
...filter,
|
|
1369
1389
|
{
|
|
1370
|
-
'
|
|
1371
|
-
'date': {
|
|
1372
|
-
'gte': inputData?.fromDate,
|
|
1373
|
-
'lte': inputData?.toDate,
|
|
1374
|
-
},
|
|
1375
|
-
},
|
|
1390
|
+
'terms': { 'storeId.keyword': cluster?.store },
|
|
1376
1391
|
},
|
|
1377
|
-
|
|
1378
1392
|
],
|
|
1379
1393
|
},
|
|
1380
1394
|
},
|
|
@@ -1405,7 +1419,7 @@ export async function summaryList( req, res ) {
|
|
|
1405
1419
|
temp[i].totalFiles = getResponse?.body?.aggregations?.total_count?.value || 0,
|
|
1406
1420
|
temp[i].completedFiles=getResponse?.body?.aggregations?.audited_trustScore?.totalCount?.value || 0;
|
|
1407
1421
|
temp[i].complianceScore = `${ Math.round( getResponse?.body?.aggregations?.avg_complianceScore?.value || 0 )} %`;
|
|
1408
|
-
temp[i].trustScore
|
|
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 + ' %'}`;
|
|
1409
1423
|
}
|
|
1410
1424
|
}
|
|
1411
1425
|
|