tango-app-api-analysis-traffic 3.8.2-alpha.7 → 3.8.4
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,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-analysis-traffic",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.4",
|
|
4
4
|
"description": "Traffic Analysis",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "nodemon --exec \"eslint --fix . && node
|
|
8
|
+
"start": "nodemon --exec \"eslint --fix . && node app.js\""
|
|
9
9
|
},
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18.10.0"
|
|
@@ -3,7 +3,7 @@ import express from 'express';
|
|
|
3
3
|
import { storeProcessedData, getconfig, revoptagging, getrevoptagging, revoptaggingcount, footFallImages, tagTempId, getCategorizedImages } from '../controllers/revop.controller.js';
|
|
4
4
|
import { isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
5
5
|
import { footfallImagesValid, getCategorizedImagesValid, storeProcessedDataValid, tagTempIdValid } from '../dtos/revop.dtos.js';
|
|
6
|
-
import {
|
|
6
|
+
import { deleteTaggedDuplicate, getTaggingConfig, mappingConfig } from '../validations/revop.validation.js';
|
|
7
7
|
|
|
8
8
|
export const revopRouter = express.Router();
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ revopRouter
|
|
|
16
16
|
// new enhnacemnet (for footfall directory)
|
|
17
17
|
.get( '/store-processed-data', isAllowedSessionHandler, validate( storeProcessedDataValid ), storeProcessedData )
|
|
18
18
|
.get( '/footfall-images', isAllowedSessionHandler, validate( footfallImagesValid ), getTaggingConfig, footFallImages )
|
|
19
|
-
.post( '/tag-tempId', isAllowedSessionHandler, validate( tagTempIdValid ),
|
|
19
|
+
.post( '/tag-tempId', isAllowedSessionHandler, validate( tagTempIdValid ), deleteTaggedDuplicate, mappingConfig, tagTempId )
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
.post( '/get-categorized-images', isAllowedSessionHandler, validate( getCategorizedImagesValid ), getCategorizedImages );
|
|
@@ -196,22 +196,31 @@ export async function mappingConfig( req, res, next ) {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
export async function
|
|
199
|
+
export async function deleteTaggedDuplicate( req, res, next ) {
|
|
200
200
|
try {
|
|
201
201
|
const inputData = req.body;
|
|
202
202
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
203
203
|
const getQuery = {
|
|
204
|
-
query: {
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
'query': {
|
|
205
|
+
'bool': {
|
|
206
|
+
'must': [
|
|
207
|
+
{
|
|
208
|
+
'term': { parent: inputData?.tempId },
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
'term': { dateString: inputData?.dateString },
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
'term': { 'storeId.keyword': inputData?.storeId },
|
|
215
|
+
},
|
|
216
|
+
],
|
|
207
217
|
},
|
|
208
218
|
},
|
|
209
|
-
|
|
210
219
|
};
|
|
211
220
|
await deleteByQuery( openSearch.revop, getQuery );
|
|
212
221
|
next();
|
|
213
222
|
} catch ( error ) {
|
|
214
|
-
logger.error( { error: error, message: req.body, function: 'traffic-revop-
|
|
223
|
+
logger.error( { error: error, message: req.body, function: 'traffic-revop-deleteTaggedDuplicate' } );
|
|
215
224
|
next();
|
|
216
225
|
}
|
|
217
226
|
}
|