tango-app-api-audit 3.5.7-stage.2 → 3.5.8
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
|
@@ -611,7 +611,7 @@ export async function getAuditFile( req, res ) {
|
|
|
611
611
|
const image = img[3]?.split( '.' );
|
|
612
612
|
const indexes = msg.zone_id === 'track' ? msg.audit_type === 'ReAudit'? folderPath[i]?._source?.outputCluster ===50000? folderPath[i]?._source?.REIDCluster:folderPath[i]?._source?.outputCluster:folderPath[i]?._source?.REIDCluster: image[0]?.split( '_' );
|
|
613
613
|
fetchData.file_path = msg.zone_id === 'track' ?folderPath[i]?._source?.personPath:folderPath[i].Key;
|
|
614
|
-
const data =msg.zone_id === 'track' ? `${url.trackInput}${folderPath[i]?._source?.personPath}` :
|
|
614
|
+
const data =msg.zone_id === 'track' ? `${url.trackInput}${folderPath[i]?._source?.personPath}` :await signedUrl( fetchData );
|
|
615
615
|
const mapimg = {
|
|
616
616
|
img_path: data,
|
|
617
617
|
img_name: msg.zone_id === 'track' ?indexes: indexes[1],
|
|
@@ -1397,13 +1397,12 @@ export async function save( req, res ) {
|
|
|
1397
1397
|
params.Bucket = bucket.auditUploadBucket;
|
|
1398
1398
|
} else {
|
|
1399
1399
|
params.Bucket = bucket.masterJson;
|
|
1400
|
-
params.Key = `${inputData.storeId}/${inputData.zoneName}/${inputData.fileDate}/${bucket.srcMasterJsonFile}`;
|
|
1401
1400
|
}
|
|
1402
1401
|
const fileData = await getJsonFileData( params );
|
|
1403
1402
|
|
|
1404
1403
|
if ( fileData?.statusCode ) {
|
|
1405
1404
|
logger.error( {
|
|
1406
|
-
error: `ERROR IN
|
|
1405
|
+
error: `ERROR IN UPLOAD PATH: ${inputData.storeId}/${inputData.fileDate}/${bucket.masterJsonFile}`,
|
|
1407
1406
|
type: 'UPLOAD_ERROR',
|
|
1408
1407
|
} );
|
|
1409
1408
|
return res.sendError( fileData, 500 );
|
|
@@ -1755,7 +1754,7 @@ export async function save( req, res ) {
|
|
|
1755
1754
|
const ratio = ( ( storeAuditData.beforeCount - inputData.customerCount ) / storeAuditData.beforeCount );
|
|
1756
1755
|
if ( ratio < clientData[0].auditConfigs.ratio &&
|
|
1757
1756
|
inputData.auditType == 'Audit' &&
|
|
1758
|
-
inputData.moduleType == '
|
|
1757
|
+
inputData.moduleType == 'traffic'
|
|
1759
1758
|
) {
|
|
1760
1759
|
logger.info(
|
|
1761
1760
|
`Hit in Reaudit pushing queue Store Id=${inputData.storeId},File Date=${inputData.fileDate}, /n \nQueue Name = ${clientData[0].auditConfigs.queueName}`,
|
|
@@ -1879,37 +1878,36 @@ export async function save( req, res ) {
|
|
|
1879
1878
|
const getBody = await aggregateAuditStoreData( getQuery );
|
|
1880
1879
|
const streams = getBody? getBody?.sqs?.streams : null;
|
|
1881
1880
|
const sqsProduceQueue = inputData.moduleType === 'track'?
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1881
|
+
{
|
|
1882
|
+
QueueUrl: `${sqs.url}${sqs.trackOutput}`,
|
|
1883
|
+
MessageBody: JSON.stringify( {
|
|
1884
|
+
store_id: inputData.storeId,
|
|
1885
|
+
zone_id: [ 'traffic_zone' ],
|
|
1886
|
+
streams: streams || [],
|
|
1887
|
+
store_date: inputData.fileDate,
|
|
1888
|
+
bucket_name: 'tango-yolo-v2-output',
|
|
1889
|
+
time: '23:00',
|
|
1890
|
+
retry: 1,
|
|
1891
|
+
} ),
|
|
1892
|
+
MessageGroupId: 'my-group-1', // Required for FIFO queues
|
|
1893
|
+
MessageDeduplicationId: Date.now().toString(), // Or a UUID, if content-based deduplication is off
|
|
1894
|
+
}:
|
|
1895
|
+
{
|
|
1896
|
+
QueueUrl: ( auditConfig?.isCheckMinAfterCount ==1 && inputData.customerCount > auditConfig?.minAfterCount ) ? `${sqs.url}${sqs.feature_new}`: `${sqs.url}${sqs.feature}`,
|
|
1897
|
+
MessageBody: JSON.stringify( {
|
|
1898
|
+
store_id: inputData.storeId,
|
|
1899
|
+
store_date: inputData.fileDate,
|
|
1900
|
+
bucket_name: `${bucket.auditUploadBucket}`,
|
|
1901
|
+
zone_id: inputData.zoneName,
|
|
1902
|
+
process_type: 'audit',
|
|
1903
|
+
} ),
|
|
1904
|
+
};
|
|
1906
1905
|
logger.info( { sqsProduceQueue: sqsProduceQueue } );
|
|
1907
|
-
const sqsQueue = inputData.moduleType === 'track'? await sendMessageToFIFOQueue( sqsProduceQueue ) :
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
// sqsProduceQueue.MessageBody,
|
|
1906
|
+
const sqsQueue = inputData.moduleType === 'track'? await sendMessageToFIFOQueue( sqsProduceQueue ) : await sendMessageToQueue(
|
|
1907
|
+
sqsProduceQueue.QueueUrl,
|
|
1908
|
+
sqsProduceQueue.MessageBody,
|
|
1911
1909
|
|
|
1912
|
-
|
|
1910
|
+
);
|
|
1913
1911
|
|
|
1914
1912
|
logger.info( { sqsQueue: sqsQueue } );
|
|
1915
1913
|
if ( inputData.moduleType === 'track' ) {
|
|
@@ -229,6 +229,7 @@ export async function getList( req, res ) {
|
|
|
229
229
|
'Queue ID': element?._source?.queueId,
|
|
230
230
|
'Compliance Score': element?._source?.totalSteps>0 ? Math.round( ( element?._source?.coveredStepsAI/ element?._source?.totalSteps )*100 ): 0,
|
|
231
231
|
'Steps Covered By AI': element?._source?.coveredStepsAI || 0,
|
|
232
|
+
'trustScore': element?._source?.trustScore || 0,
|
|
232
233
|
'Visitor Type': element?._source?.visitorsType,
|
|
233
234
|
'Test Duration': duration || '',
|
|
234
235
|
'Audit Status': element?._source?.auditStatus || '',
|
|
@@ -242,8 +243,9 @@ export async function getList( req, res ) {
|
|
|
242
243
|
'Store ID': element?._source?.storeId || 'Un Assigned',
|
|
243
244
|
'Store Name': element?._source?.storeName ||'Un Assigned',
|
|
244
245
|
'Engagement ID': element?._source?.engagementId,
|
|
245
|
-
'Compliance Score': element?._source?.
|
|
246
|
+
'Compliance Score': element?._source?.totalSteps>0 ? Math.round( ( element?._source?.coveredStepsAI/ element?._source?.totalSteps )*100 ): 0,
|
|
246
247
|
'Steps Covered By AI': element?._source?.coveredStepsAI || 0,
|
|
248
|
+
'trustScore': element?._source?.trustScore ||0,
|
|
247
249
|
'Test Duration': duration || '',
|
|
248
250
|
'Audit Status': element?._source?.auditStatus || '',
|
|
249
251
|
'Audited By': userName?.userName || '',
|
|
@@ -1592,6 +1592,7 @@ export async function saveBinary( req, res ) {
|
|
|
1592
1592
|
formData.append( 'question', `Please upload the QR image pasted in this clinic-${req.userAudit?.streamName}` );
|
|
1593
1593
|
formData.append( 'scheduleDate', formattedDate );
|
|
1594
1594
|
formData.append( 'scheduleEndTime', '11:00 PM' );
|
|
1595
|
+
formData.append( 'streamId', req.userAudit?.streamName );
|
|
1595
1596
|
|
|
1596
1597
|
formData.append( 'referenceImage', img.Body );
|
|
1597
1598
|
const response = await axios.post( `${url.apiDomain}/v3/task/eyeTesttask`, formData, { headers: {
|