tango-app-api-analysis-traffic 3.8.2-alpha.6 → 3.8.3
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
|
@@ -1479,10 +1479,16 @@ export const summaryTableV3 = async ( req, res ) => {
|
|
|
1479
1479
|
if ( resultData.summaryData.length > 0 ) {
|
|
1480
1480
|
const exportdata = [];
|
|
1481
1481
|
resultData.summaryData.forEach( ( element ) => {
|
|
1482
|
+
const hasStoreCode = resultData.summaryData.some(
|
|
1483
|
+
( element ) => element.storeCode != null && element.storeCode !== '',
|
|
1484
|
+
);
|
|
1482
1485
|
if ( reqestData.clientId === '193' ) {
|
|
1483
1486
|
exportdata.push( {
|
|
1484
1487
|
'Store Name': element.storeName,
|
|
1485
1488
|
'Store ID': element.storeId,
|
|
1489
|
+
...( hasStoreCode ?
|
|
1490
|
+
{ 'Store Code': element.storeCode != null && element.storeCode !== '' ? element.storeCode : '-' } :
|
|
1491
|
+
{} ),
|
|
1486
1492
|
...( req.body.storeId.length ==1 ) ? { Date: dayjs( element['date'] ).format( 'MMM DD,YYYY' ) }:{},
|
|
1487
1493
|
'Footfall': element.footfallCount,
|
|
1488
1494
|
'Bounced Footfall': element.bouncedCount,
|
|
@@ -1507,6 +1513,9 @@ export const summaryTableV3 = async ( req, res ) => {
|
|
|
1507
1513
|
exportdata.push( {
|
|
1508
1514
|
'Store Name': element.storeName,
|
|
1509
1515
|
'Store ID': element.storeId,
|
|
1516
|
+
...( hasStoreCode ?
|
|
1517
|
+
{ 'Store Code': element.storeCode != null && element.storeCode !== '' ? element.storeCode : '-' } :
|
|
1518
|
+
{} ),
|
|
1510
1519
|
...( req.body.storeId.length ==1 ) ? { Date: dayjs( element['date'] ).format( 'MMM DD,YYYY' ) }:{},
|
|
1511
1520
|
'Footfall': element.footfallCount,
|
|
1512
1521
|
...( bouncedLabel ? { [bouncedLabel]: element.bouncedCount } : {} ),
|
|
@@ -1530,6 +1539,9 @@ export const summaryTableV3 = async ( req, res ) => {
|
|
|
1530
1539
|
exportdata.push( {
|
|
1531
1540
|
'Store Name': element.storeName,
|
|
1532
1541
|
'Store ID': element.storeId,
|
|
1542
|
+
...( hasStoreCode ?
|
|
1543
|
+
{ 'Store Code': element.storeCode != null && element.storeCode !== '' ? element.storeCode : '-' } :
|
|
1544
|
+
{} ),
|
|
1533
1545
|
...( req.body.storeId.length ==1 ) ? { Date: dayjs( element['date'] ).format( 'MMM DD,YYYY' ) }:{},
|
|
1534
1546
|
'Footfall': element.footfallCount,
|
|
1535
1547
|
'Avg Infra DownTime': element.avgInfraDowntime,
|
|
@@ -1538,6 +1550,9 @@ export const summaryTableV3 = async ( req, res ) => {
|
|
|
1538
1550
|
exportdata.push( {
|
|
1539
1551
|
'Store Name': element.storeName,
|
|
1540
1552
|
'Store ID': element.storeId,
|
|
1553
|
+
...( hasStoreCode ?
|
|
1554
|
+
{ 'Store Code': element.storeCode != null && element.storeCode !== '' ? element.storeCode : '-' } :
|
|
1555
|
+
{} ),
|
|
1541
1556
|
...( req.body.storeId.length ==1 ) ? { Date: dayjs( element['date'] ).format( 'MMM DD,YYYY' ) }:{},
|
|
1542
1557
|
'Footfall': element.footfallCount,
|
|
1543
1558
|
'Bounced Footfall': element.bouncedCount,
|
|
@@ -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,28 @@ 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
|
+
],
|
|
207
214
|
},
|
|
208
215
|
},
|
|
209
|
-
|
|
210
216
|
};
|
|
211
217
|
await deleteByQuery( openSearch.revop, getQuery );
|
|
212
218
|
next();
|
|
213
219
|
} catch ( error ) {
|
|
214
|
-
logger.error( { error: error, message: req.body, function: 'traffic-revop-
|
|
220
|
+
logger.error( { error: error, message: req.body, function: 'traffic-revop-deleteTaggedDuplicate' } );
|
|
215
221
|
next();
|
|
216
222
|
}
|
|
217
223
|
}
|