tango-app-api-audit 3.5.58 → 3.5.60
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
|
@@ -275,7 +275,7 @@ export async function getAuditFile( req, res ) {
|
|
|
275
275
|
const userAssign = await aggregateAssignAudit( query );
|
|
276
276
|
if ( userAssign.length > 0 ) {
|
|
277
277
|
// openSearch log
|
|
278
|
-
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.
|
|
278
|
+
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.email}_${Date.now()}`;
|
|
279
279
|
let temp = inputData;
|
|
280
280
|
temp.logType='audit';
|
|
281
281
|
temp.logSubType='get-audit-file';
|
|
@@ -321,7 +321,7 @@ export async function getAuditFile( req, res ) {
|
|
|
321
321
|
/* openSearch logs start*/
|
|
322
322
|
|
|
323
323
|
// declare basic details
|
|
324
|
-
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.
|
|
324
|
+
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.email}_${Date.now()}`;
|
|
325
325
|
let temp = inputData;
|
|
326
326
|
temp.logType='audit';
|
|
327
327
|
temp.logSubType='get-audit-file';
|
|
@@ -356,14 +356,13 @@ export async function getAuditFile( req, res ) {
|
|
|
356
356
|
case 'drafted':
|
|
357
357
|
logger.info( 'userDetails drafted', { inputData } );
|
|
358
358
|
/* openSearch logs start */
|
|
359
|
-
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.
|
|
359
|
+
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.email}_${Date.now()}`;
|
|
360
360
|
let temp = inputData;
|
|
361
361
|
temp.logType='audit';
|
|
362
362
|
temp.logSubType='get-audit-file';
|
|
363
363
|
temp.functionName='audit-controller-getAuditFile';
|
|
364
364
|
temp.messageType = 'log';
|
|
365
365
|
temp.message ='Hit in drafted file';
|
|
366
|
-
msg = JSON.parse( consumer );
|
|
367
366
|
temp.storeId =userDetails[0].storeId;
|
|
368
367
|
temp.fileDate =userDetails[0].fileDate;
|
|
369
368
|
temp.totalCount =userDetails[0].beforeCount;
|
|
@@ -476,7 +475,7 @@ export async function getAuditFile( req, res ) {
|
|
|
476
475
|
}
|
|
477
476
|
if ( msg.audit_type === 'ReAudit' && msg.zone_id !== 'track' ) {
|
|
478
477
|
/* openSearch logs start */
|
|
479
|
-
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.
|
|
478
|
+
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.email}_${Date.now()}`;
|
|
480
479
|
let temp = inputData;
|
|
481
480
|
temp.logType='audit';
|
|
482
481
|
temp.logSubType='get-audit-file';
|
|
@@ -669,7 +668,7 @@ export async function getAuditFile( req, res ) {
|
|
|
669
668
|
};
|
|
670
669
|
logger.info( { fetchData: fetchData, msg: msg, inputData: inputData, type: 'debug-bucketNameIssue' } );
|
|
671
670
|
/* openSearch logs start */
|
|
672
|
-
const _id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.
|
|
671
|
+
const _id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Info_${req?.user?.email}_${Date.now()}`;
|
|
673
672
|
let temp = inputData;
|
|
674
673
|
temp.logType='audit';
|
|
675
674
|
temp.logSubType='get-audit-file';
|
|
@@ -790,7 +789,7 @@ export async function getAuditFile( req, res ) {
|
|
|
790
789
|
insertData = userDetails[0];
|
|
791
790
|
} else {
|
|
792
791
|
/* openSearch logs start*/
|
|
793
|
-
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Error_${req?.user?.
|
|
792
|
+
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Error_${req?.user?.email}_${Date.now()}`;
|
|
794
793
|
let temp = inputData;
|
|
795
794
|
temp.logType='audit';
|
|
796
795
|
temp.logSubType='get-audit-file';
|
|
@@ -863,19 +862,19 @@ export async function getAuditFile( req, res ) {
|
|
|
863
862
|
} );
|
|
864
863
|
} catch ( error ) {
|
|
865
864
|
/* openSearch logs start*/
|
|
866
|
-
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Error_${req?.user?.
|
|
867
|
-
let temp =
|
|
865
|
+
const id = `${req.query.moduleType}_${req.query.queueName}_getAuditFile_Error_${req?.user?.email}_${Date.now()}`;
|
|
866
|
+
let temp = req.query;
|
|
868
867
|
temp.logType='audit';
|
|
869
868
|
temp.logSubType='get-audit-file';
|
|
870
869
|
temp.functionName='audit-controller-getAuditFile';
|
|
871
870
|
temp.messageType = 'error';
|
|
872
871
|
temp.message =error.message || 'Internal Server Error';
|
|
873
|
-
temp.storeId =msg?.store_id;
|
|
874
|
-
temp.fileDate =msg?.curr_date;
|
|
875
|
-
temp.totalCount =msg?.total_count;
|
|
876
|
-
temp.zoneName =msg?.zone_id;
|
|
877
|
-
temp.auditType = msg?.audit_type;
|
|
878
|
-
temp.indexName= msg?.index_name;
|
|
872
|
+
// temp.storeId =msg?.store_id;
|
|
873
|
+
// temp.fileDate =msg?.curr_date;
|
|
874
|
+
// temp.totalCount =msg?.total_count;
|
|
875
|
+
// temp.zoneName =msg?.zone_id;
|
|
876
|
+
// temp.auditType = msg?.audit_type;
|
|
877
|
+
// temp.indexName= msg?.index_name;
|
|
879
878
|
await openSearchLog( temp, req.user, id );
|
|
880
879
|
/* openSearch logs end*/
|
|
881
880
|
logger.error( {
|
|
@@ -903,7 +902,7 @@ export async function getFilterData( msg, user ) {
|
|
|
903
902
|
const mappingFile = await getJsonFileData( params );
|
|
904
903
|
if ( mappingFile.statusCode ) {
|
|
905
904
|
/* openSearch logs start*/
|
|
906
|
-
const id = `${msg.store_id}_${msg.zone_id}_${msg.curr_date}_${bucket.masterJsonFile}_getFilterData_Error_${user?.
|
|
905
|
+
const id = `${msg.store_id}_${msg.zone_id}_${msg.curr_date}_${bucket.masterJsonFile}_getFilterData_Error_${user?.email}_${Date.now()}`;
|
|
907
906
|
let temp = msg;
|
|
908
907
|
temp.logType='audit';
|
|
909
908
|
temp.logSubType='get-audit-file';
|
|
@@ -935,7 +934,7 @@ export async function getFilterData( msg, user ) {
|
|
|
935
934
|
}
|
|
936
935
|
} catch ( error ) {
|
|
937
936
|
/* openSearch logs start*/
|
|
938
|
-
const id = `${msg.store_id}_${msg.zone_id}_${msg.curr_date}_${bucket.masterJsonFile}_getFilterData_Error_${user?.
|
|
937
|
+
const id = `${msg.store_id}_${msg.zone_id}_${msg.curr_date}_${bucket.masterJsonFile}_getFilterData_Error_${user?.email}_${Date.now()}`;
|
|
939
938
|
let temp = msg;
|
|
940
939
|
temp.logType='audit';
|
|
941
940
|
temp.logSubType='get-audit-file';
|
|
@@ -972,7 +971,7 @@ export async function getAuditImage( msg, user ) {
|
|
|
972
971
|
const folderPath = await listFileWithoutLimit( fetchData );
|
|
973
972
|
if ( folderPath.statusCode == 404 ) {
|
|
974
973
|
/* openSearch logs start */
|
|
975
|
-
const id = `${fileDate}_${storeId}_${msg.zone_id}_${bucket.auditInput}_getAuditImage_Error_${user?.
|
|
974
|
+
const id = `${fileDate}_${storeId}_${msg.zone_id}_${bucket.auditInput}_getAuditImage_Error_${user?.email}_${Date.now()}`;
|
|
976
975
|
let temp = msg;
|
|
977
976
|
temp.logType='audit';
|
|
978
977
|
temp.logSubType='get-audit-file';
|
|
@@ -1021,7 +1020,7 @@ export async function getAuditImage( msg, user ) {
|
|
|
1021
1020
|
}
|
|
1022
1021
|
} catch ( error ) {
|
|
1023
1022
|
/* openSearch logs start*/
|
|
1024
|
-
const id = `${fileDate}_${storeId}_${msg.zone_id}_${bucket.auditInput}_getAuditImage_Error_${user?.
|
|
1023
|
+
const id = `${fileDate}_${storeId}_${msg.zone_id}_${bucket.auditInput}_getAuditImage_Error_${user?.email}_${Date.now()}`;
|
|
1025
1024
|
let temp = msg;
|
|
1026
1025
|
temp.logType='audit';
|
|
1027
1026
|
temp.logSubType='get-audit-file';
|
|
@@ -1598,7 +1597,7 @@ export async function save( req, res ) {
|
|
|
1598
1597
|
|
|
1599
1598
|
if ( fileData?.statusCode ) {
|
|
1600
1599
|
/* openSearch logs start*/
|
|
1601
|
-
const id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Error_${req?.user?.
|
|
1600
|
+
const id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Error_${req?.user?.email}_${Date.now()}`;
|
|
1602
1601
|
let temp = inputData;
|
|
1603
1602
|
temp.logType='audit';
|
|
1604
1603
|
temp.logSubType='get-audit-file';
|
|
@@ -1649,7 +1648,7 @@ export async function save( req, res ) {
|
|
|
1649
1648
|
|
|
1650
1649
|
if ( mappingUpload?.statusCode ) {
|
|
1651
1650
|
/* openSearch logs start*/
|
|
1652
|
-
const id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Error_${req?.user?.
|
|
1651
|
+
const id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Error_${req?.user?.email}_${Date.now()}`;
|
|
1653
1652
|
let temp = inputData;
|
|
1654
1653
|
temp.logType='audit';
|
|
1655
1654
|
temp.logSubType='get-audit-file';
|
|
@@ -2055,7 +2054,7 @@ export async function save( req, res ) {
|
|
|
2055
2054
|
await insertOpenSearchData( openSearch.auditLog, logData );
|
|
2056
2055
|
} else {
|
|
2057
2056
|
/* openSearch logs start*/
|
|
2058
|
-
let id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Info_${req?.user?.
|
|
2057
|
+
let id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Info_${req?.user?.email}_${Date.now()}`;
|
|
2059
2058
|
let temp = inputData;
|
|
2060
2059
|
temp.logType='audit';
|
|
2061
2060
|
temp.logSubType='get-audit-file';
|
|
@@ -2151,7 +2150,7 @@ export async function save( req, res ) {
|
|
|
2151
2150
|
|
|
2152
2151
|
);
|
|
2153
2152
|
/* openSearch logs start */
|
|
2154
|
-
id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Info_${req?.user?.
|
|
2153
|
+
id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Info_${req?.user?.email}_${Date.now()}`;
|
|
2155
2154
|
const message = {
|
|
2156
2155
|
getBody: getBody,
|
|
2157
2156
|
streams: streams,
|
|
@@ -2163,7 +2162,7 @@ export async function save( req, res ) {
|
|
|
2163
2162
|
/* openSearch logs end */
|
|
2164
2163
|
if ( inputData.moduleType === 'track' ) {
|
|
2165
2164
|
// declare id
|
|
2166
|
-
id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Info_${req?.user?.
|
|
2165
|
+
id = `${inputData.moduleType}_${inputData.auditId}_${inputData.storeId}_${inputData.moduleType}_${inputData.auditType}_save_Info_${req?.user?.email}_${Date.now()}`;
|
|
2167
2166
|
const query =
|
|
2168
2167
|
{
|
|
2169
2168
|
module: 'REID-TRACKER-V1',
|
|
@@ -10,7 +10,7 @@ export async function isExistsQueue( req, res, next ) {
|
|
|
10
10
|
const isExist = await getQueueUrl( inputData.queueName );
|
|
11
11
|
if ( isExist.statusCode ) {
|
|
12
12
|
/* openSearch logs start */
|
|
13
|
-
const id = `${inputData.moduleType}_${inputData.queueName}_isExistsQueue_Error_${req?.user?.
|
|
13
|
+
const id = `${inputData.moduleType}_${inputData.queueName}_isExistsQueue_Error_${req?.user?.email}_${Date.now()}`;
|
|
14
14
|
let temp = inputData;
|
|
15
15
|
temp.logType='audit';
|
|
16
16
|
temp.logSubType='get-audit-file';
|
|
@@ -25,7 +25,7 @@ export async function isExistsQueue( req, res, next ) {
|
|
|
25
25
|
}
|
|
26
26
|
} catch ( error ) {
|
|
27
27
|
/* openSearch logs start */
|
|
28
|
-
const id = `${req.query.moduleType}_${req.query.queueName}_isExistsQueue_Error_${req?.user?.
|
|
28
|
+
const id = `${req.query.moduleType}_${req.query.queueName}_isExistsQueue_Error_${req?.user?.email}_${Date.now()}`;
|
|
29
29
|
let temp = req.query;
|
|
30
30
|
temp.logType='audit';
|
|
31
31
|
temp.logSubType='get-audit-file';
|
|
@@ -443,7 +443,7 @@ export async function openSearchLog( inputData, user, id ) {
|
|
|
443
443
|
auditType: inputData.auditType || '',
|
|
444
444
|
folderPath: inputData.folderPath || '',
|
|
445
445
|
params: inputData.params||'',
|
|
446
|
-
|
|
446
|
+
|
|
447
447
|
},
|
|
448
448
|
createdAt: new Date(),
|
|
449
449
|
updatedAt: new Date(),
|
|
@@ -452,7 +452,7 @@ export async function openSearchLog( inputData, user, id ) {
|
|
|
452
452
|
await insertWithId( openSearch.auditedLogs, id, logs );
|
|
453
453
|
return true;
|
|
454
454
|
} catch ( error ) {
|
|
455
|
-
logger.error( { error: error, message: { logs:
|
|
455
|
+
logger.error( { error: error, message: { logs: inputData, id: id }, function: 'openSearchLog-audit.validation' } );
|
|
456
456
|
return false;
|
|
457
457
|
}
|
|
458
458
|
}
|