tango-app-api-audit 3.4.11-alpha.23 → 3.4.11-alpha.24

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-audit",
3
- "version": "3.4.11-alpha.23",
3
+ "version": "3.4.11-alpha.24",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -4535,39 +4535,42 @@ export async function save( req, res ) {
4535
4535
  if ( !getFilePath ) {
4536
4536
  return res.sendError( ' SQS is not sent due to Inserted Data is not there', 400 );
4537
4537
  }
4538
+ const [ getStore, getClient ] = await Promise.all( [ findOneStore( { storeId: inputData.storeId }, { storeName: 1, storeProfile: 1, spocDetails: 1 } ), findOneClient( { clientId: inputData.clientId }, { clientName: 1 } ) ] );
4539
+
4538
4540
  const tempId=[];
4539
4541
  if ( inputData.employeeCount > 0 ) {
4540
4542
  for ( let i =0; i<inputData?.employee.length; i++ ) {
4541
4543
  tempId.push( inputData?.employee[i].img_id );
4542
4544
  }
4543
- }
4544
- const [ getStore, getClient ] = await Promise.all( [ findOneStore( { storeId: inputData.storeId }, { storeName: 1, storeProfile: 1, spocDetails: 1 } ), findOneClient( { clientId: inputData.clientId }, { clientName: 1 } ) ] );
4545
- const sqsProduceQueue = {
4546
- QueueUrl: `${sqs.url}${sqs.uniformOutput}`,
4547
- MessageBody: JSON.stringify( {
4548
- storeId: inputData.storeId,
4549
- storeName: getStore?.storeName,
4550
- fileDate: inputData.fileDate,
4551
- moduleType: inputData.moduleType,
4552
- inputBucketName: getFilePath?.sqs?.Body?.inputBucketName,
4553
- tempId: tempId,
4554
- count: inputData.employeeCount,
4555
- folderPath: getFilePath?.sqs?.Body?.folderPath,
4556
- } ),
4557
- };
4558
- const sqsQueue = await sendMessageToQueue(
4559
- sqsProduceQueue.QueueUrl,
4560
- sqsProduceQueue.MessageBody,
4561
- );
4562
4545
 
4563
- if ( sqsQueue.statusCode ) {
4564
- logger.error( {
4565
- error: `${sqsQueue}`,
4566
- type: 'UPLOAD_ERROR',
4567
- } );
4568
- return res.sendError( 'SQS not sent', 500 );
4546
+ const sqsProduceQueue = {
4547
+ QueueUrl: `${sqs.url}${sqs.uniformOutput}`,
4548
+ MessageBody: JSON.stringify( {
4549
+ storeId: inputData.storeId,
4550
+ storeName: getStore?.storeName,
4551
+ fileDate: inputData.fileDate,
4552
+ moduleType: inputData.moduleType,
4553
+ inputBucketName: getFilePath?.sqs?.Body?.inputBucketName,
4554
+ tempId: tempId,
4555
+ count: inputData.employeeCount,
4556
+ folderPath: getFilePath?.sqs?.Body?.folderPath,
4557
+ } ),
4558
+ };
4559
+ const sqsQueue = await sendMessageToQueue(
4560
+ sqsProduceQueue.QueueUrl,
4561
+ sqsProduceQueue.MessageBody,
4562
+ );
4563
+
4564
+ if ( sqsQueue.statusCode ) {
4565
+ logger.error( {
4566
+ error: `${sqsQueue}`,
4567
+ type: 'UPLOAD_ERROR',
4568
+ } );
4569
+ return res.sendError( 'SQS not sent', 500 );
4570
+ }
4569
4571
  }
4570
4572
 
4573
+
4571
4574
  // trax output in open serach
4572
4575
  const output = {
4573
4576
  clientId: inputData.clientId,