tango-app-api-audit 3.5.7-stage.1 → 3.5.7-stage.2
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}` :await signedUrl( fetchData );
|
|
614
|
+
const data =msg.zone_id === 'track' ? `${url.trackInput}${folderPath[i]?._source?.personPath}` : `${url.auditInput}${folderPath[i].Key}`; // 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,13 @@ 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}
|
|
1400
|
+
params.Key = `${inputData.storeId}/${inputData.zoneName}/${inputData.fileDate}/${bucket.srcMasterJsonFile}`;
|
|
1401
1401
|
}
|
|
1402
1402
|
const fileData = await getJsonFileData( params );
|
|
1403
1403
|
|
|
1404
1404
|
if ( fileData?.statusCode ) {
|
|
1405
1405
|
logger.error( {
|
|
1406
|
-
error: `ERROR IN
|
|
1406
|
+
error: `ERROR IN GET MAPPING FILE: ${params.Key}`,
|
|
1407
1407
|
type: 'UPLOAD_ERROR',
|
|
1408
1408
|
} );
|
|
1409
1409
|
return res.sendError( fileData, 500 );
|
|
@@ -1879,36 +1879,37 @@ export async function save( req, res ) {
|
|
|
1879
1879
|
const getBody = await aggregateAuditStoreData( getQuery );
|
|
1880
1880
|
const streams = getBody? getBody?.sqs?.streams : null;
|
|
1881
1881
|
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
|
-
|
|
1882
|
+
{
|
|
1883
|
+
QueueUrl: `${sqs.url}${sqs.trackOutput}`,
|
|
1884
|
+
MessageBody: JSON.stringify( {
|
|
1885
|
+
store_id: inputData.storeId,
|
|
1886
|
+
zone_id: [ 'traffic_zone' ],
|
|
1887
|
+
streams: streams || [],
|
|
1888
|
+
store_date: inputData.fileDate,
|
|
1889
|
+
bucket_name: 'tango-yolo-v2-output',
|
|
1890
|
+
time: '23:00',
|
|
1891
|
+
retry: 1,
|
|
1892
|
+
} ),
|
|
1893
|
+
MessageGroupId: 'my-group-1', // Required for FIFO queues
|
|
1894
|
+
MessageDeduplicationId: Date.now().toString(), // Or a UUID, if content-based deduplication is off
|
|
1895
|
+
}:
|
|
1896
|
+
{
|
|
1897
|
+
QueueUrl: ( auditConfig?.isCheckMinAfterCount ==1 && inputData.customerCount > auditConfig?.minAfterCount ) ? `${sqs.url}${sqs.feature_new}`: `${sqs.url}${sqs.feature}`,
|
|
1898
|
+
MessageBody: JSON.stringify( {
|
|
1899
|
+
store_id: inputData.storeId,
|
|
1900
|
+
store_date: inputData.fileDate,
|
|
1901
|
+
bucket_name: `${bucket.auditUploadBucket}`,
|
|
1902
|
+
zone_id: inputData.zoneName,
|
|
1903
|
+
process_type: 'audit',
|
|
1904
|
+
} ),
|
|
1905
|
+
};
|
|
1906
1906
|
logger.info( { sqsProduceQueue: sqsProduceQueue } );
|
|
1907
|
-
const sqsQueue = inputData.moduleType === 'track'? await sendMessageToFIFOQueue( sqsProduceQueue ) :
|
|
1908
|
-
|
|
1909
|
-
|
|
1907
|
+
const sqsQueue = inputData.moduleType === 'track'? await sendMessageToFIFOQueue( sqsProduceQueue ) : null;
|
|
1908
|
+
// await sendMessageToQueue(
|
|
1909
|
+
// sqsProduceQueue.QueueUrl,
|
|
1910
|
+
// sqsProduceQueue.MessageBody,
|
|
1910
1911
|
|
|
1911
|
-
);
|
|
1912
|
+
// );
|
|
1912
1913
|
|
|
1913
1914
|
logger.info( { sqsQueue: sqsQueue } );
|
|
1914
1915
|
if ( inputData.moduleType === 'track' ) {
|