tango-app-api-infra 3.8.10 → 3.9.1

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-infra",
3
- "version": "3.8.10",
3
+ "version": "3.9.1",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -969,6 +969,7 @@ function mergeDuplicateImagesWithUncheck( existingData, inputData, status ) {
969
969
 
970
970
  export async function sendSqsMessage( inputData, tempId, getStoreType, storeId ) {
971
971
  const sqs = JSON.parse( process.env.SQS );
972
+ const openSearch = JSON.parse( process.env.OPENSEARCH );
972
973
  const sqsName = getStoreType > 0? sqs.revopTrackTicket: sqs.revopTicket;
973
974
  const sqsProduceQueue = getStoreType > 0 ? {
974
975
  QueueUrl: `${sqs.url}${sqsName}`,
@@ -1010,6 +1011,22 @@ export async function sendSqsMessage( inputData, tempId, getStoreType, storeId )
1010
1011
  } );
1011
1012
  return false;
1012
1013
  } else {
1014
+ const id =`${storeId}_${inputData.dateString.split( '-' ).reverse().join( '-' )}_${getStoreType > 0? "live":"reduction"}_${Date.now()}`
1015
+ const logs = {
1016
+ QueueUrl: sqsProduceQueue.QueueUrl,
1017
+ MessageBody: sqsProduceQueue.MessageBody,
1018
+ sqsQueue:sqsQueue,
1019
+ store_id: storeId,
1020
+ store_date: inputData.dateString.split( '-' ).reverse().join( '-' ),
1021
+ bucket_name: '',
1022
+ zone_id: 'traffic_zone',
1023
+ process_type: 'live',
1024
+ revop_type: 'footfall',
1025
+ temp_id: tempId,
1026
+ time: Date.now(),
1027
+ createdAt:new Date()
1028
+ }
1029
+ await insertWithId(openSearch.revopsLog,id,logs)
1013
1030
  return true;
1014
1031
  }
1015
1032
  }