tango-app-api-audit 1.0.70 → 3.3.0-alpha.0

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": "1.0.70",
3
+ "version": "3.3.0-alpha.0",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -403,7 +403,6 @@ export async function getAuditFile( req, res ) {
403
403
  queueName: inputData.queueName,
404
404
  beforeCount: reauditImg.length,
405
405
  auditStatus: 'inprogress',
406
- moduleType: 'traffic',
407
406
  fileDateISO: start,
408
407
  timeSpent: 0,
409
408
  startTime: new Date(),
@@ -416,22 +415,15 @@ export async function getAuditFile( req, res ) {
416
415
  fileDate: msg.curr_date,
417
416
  moduleType: inputData.moduleType,
418
417
  };
419
- const storeRecord = {
418
+ let storeRecord = {
420
419
  userId: req.user._id,
421
- storeId: msg.store_id,
422
- clientId: msg.store_id.split( '-' )[0],
423
420
  auditType: msg.audit_type || 'ReAudit',
424
- fileDate: msg.curr_date,
425
- queueName: inputData.queueName,
426
- beforeCount: reauditImg.length,
427
421
  status: 'inprogress',
428
- fileDateISO: start,
429
422
  timeSpent: 0,
430
- zoneName: msg.zone_id,
431
- moduleType: inputData.moduleType,
432
423
  };
433
424
  reauditInsert = await createUserAudit( record );
434
- await updateManyStoreAudit( query, storeRecord );
425
+
426
+ await updateOneStoreAudit( query, storeRecord );
435
427
  } else {
436
428
  reauditInsert = userDetails[0];
437
429
  }
@@ -677,7 +669,7 @@ export async function getAuditImage( msg ) {
677
669
  const files = [];
678
670
  const fetchData = {};
679
671
  fetchData.Bucket = `${bucket.auditInput}`;
680
- fetchData.filePath = `${fileDate}/${storeId}/${msg.zone_id}`;
672
+ fetchData.filePath = `${fileDate}/${storeId}/${msg.zone_id}/`;
681
673
  const folderPath = await listFileWithoutLimit( fetchData );
682
674
  if ( folderPath.statusCode == 404 ) {
683
675
  return folderPath;
@@ -708,6 +700,7 @@ export async function getAuditImage( msg ) {
708
700
  mappedid: [ mapimg ],
709
701
  } );
710
702
  }
703
+ logger.info( { files: files, level: 4 } );
711
704
  return files;
712
705
  }
713
706
  } catch ( error ) {
@@ -718,6 +711,8 @@ export async function getAuditImage( msg ) {
718
711
 
719
712
  export const getReauditImg = async ( filter, image ) => {
720
713
  const chunkedMappingData = await chunkArray( image, 10 );
714
+ logger.info( { chunkedMappingData: chunkedMappingData, level: 5 } );
715
+
721
716
  const promises = chunkedMappingData.map( async ( chunk ) => {
722
717
  return mapFunction( chunk, filter );
723
718
  } );