tango-app-api-analysis-traffic 3.8.7-vms.18 → 3.8.7-vms.19
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,7 +1,7 @@
|
|
|
1
1
|
import { logger, insertOpenSearchData, getOpenSearchData, updateOpenSearchData } from 'tango-app-api-middleware';
|
|
2
2
|
import { findOnerevopConfig } from '../services/revopConfig.service.js';
|
|
3
3
|
import * as clientService from '../services/clients.services.js';
|
|
4
|
-
import { bulkUpdate, upsertWithScript } from 'tango-app-api-middleware/src/utils/openSearch.js';
|
|
4
|
+
import { bulkUpdate, insertWithId, upsertWithScript } from 'tango-app-api-middleware/src/utils/openSearch.js';
|
|
5
5
|
import { findOneVmsStoreRequest } from '../services/vmsStoreRequest.service.js';
|
|
6
6
|
// import dayjs from 'dayjs';
|
|
7
7
|
// Lamda Service Call //
|
|
@@ -667,6 +667,34 @@ export async function tagTempId( req, res ) {
|
|
|
667
667
|
};
|
|
668
668
|
const id = `${inputData.storeId}_${inputData.dateString}_${inputData.timeRange}_${inputData.tempId}`;
|
|
669
669
|
await upsertWithScript( openSearch.revop, id, { script, upsert: upsertRecord } );
|
|
670
|
+
logger.info( { mas: '...........1', commnets: inputData?.comments } );
|
|
671
|
+
if ( inputData?.comments && inputData?.comments !== '' ) {
|
|
672
|
+
logger.info( { mas: '...........2', commnets: inputData?.comments } );
|
|
673
|
+
const id = `${inputData.storeId}_${inputData.dateString}_${Date.now()}`;
|
|
674
|
+
const logs = {
|
|
675
|
+
type: 'tagging',
|
|
676
|
+
parent: inputData?.revopsType == 'duplicate'? inputData.tempId : null,
|
|
677
|
+
id: `${inputData?.storeId}_${inputData?.dateString}_${inputData?.tempId}`,
|
|
678
|
+
tempId: inputData.tempId,
|
|
679
|
+
timeRange: inputData.timeRange,
|
|
680
|
+
storeId: inputData.storeId,
|
|
681
|
+
dateString: inputData.dateString,
|
|
682
|
+
processType: inputData.processType,
|
|
683
|
+
category: inputData.revopsType,
|
|
684
|
+
entryTime: inputData.entryTime,
|
|
685
|
+
exitTime: inputData.exitTime,
|
|
686
|
+
filePath: inputData.filePath,
|
|
687
|
+
status: inputData?.revopsType == 'non-tagging' ?'':'submitted',
|
|
688
|
+
description: inputData.comments || '',
|
|
689
|
+
isChecked: inputData.isChecked,
|
|
690
|
+
createdByEmail: req?.user?.email,
|
|
691
|
+
createdByUserName: req?.user?.userName,
|
|
692
|
+
createdByRole: req?.user?.role,
|
|
693
|
+
message: inputData.comments || '',
|
|
694
|
+
createdAt: new Date(),
|
|
695
|
+
};
|
|
696
|
+
await insertWithId( openSearch.vmsCommentsLog, id, logs );
|
|
697
|
+
}
|
|
670
698
|
if ( inputData?.duplicateImage?.length> 0 ) {
|
|
671
699
|
let bulkBody = [];
|
|
672
700
|
for ( let item of inputData?.duplicateImage ) {
|