tango-app-api-analysis-traffic 3.8.7-vms.17 → 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 //
|
|
@@ -311,6 +311,11 @@ export async function storeProcessedData( req, res ) {
|
|
|
311
311
|
{ term: { 'storeId.keyword': storeId } },
|
|
312
312
|
{ term: { 'dateString': currentDate } },
|
|
313
313
|
{ term: { 'ticketName.keyword': 'footfall-directory' } },
|
|
314
|
+
{
|
|
315
|
+
'term': {
|
|
316
|
+
'type.keyword': 'store',
|
|
317
|
+
},
|
|
318
|
+
},
|
|
314
319
|
],
|
|
315
320
|
},
|
|
316
321
|
},
|
|
@@ -412,6 +417,11 @@ export async function footFallImages( req, res ) {
|
|
|
412
417
|
'ticketName.keyword': 'footfall-directory',
|
|
413
418
|
},
|
|
414
419
|
},
|
|
420
|
+
{
|
|
421
|
+
'term': {
|
|
422
|
+
'type.keyword': 'store',
|
|
423
|
+
},
|
|
424
|
+
},
|
|
415
425
|
],
|
|
416
426
|
},
|
|
417
427
|
},
|
|
@@ -657,6 +667,34 @@ export async function tagTempId( req, res ) {
|
|
|
657
667
|
};
|
|
658
668
|
const id = `${inputData.storeId}_${inputData.dateString}_${inputData.timeRange}_${inputData.tempId}`;
|
|
659
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
|
+
}
|
|
660
698
|
if ( inputData?.duplicateImage?.length> 0 ) {
|
|
661
699
|
let bulkBody = [];
|
|
662
700
|
for ( let item of inputData?.duplicateImage ) {
|
|
@@ -18,7 +18,6 @@ revopRouter
|
|
|
18
18
|
.get( '/footfall-images', isAllowedSessionHandler, validate( footfallImagesValid ), getTaggingConfig, footFallImages )
|
|
19
19
|
.post( '/tag-tempId', isAllowedSessionHandler, validate( tagTempIdValid ), deleteTaggedDuplicate, mappingConfig, tagTempId )
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
.post( '/get-categorized-images', isAllowedSessionHandler, validate( getCategorizedImagesValid ), getCategorizedImages );
|
|
23
22
|
|
|
24
23
|
|