tango-app-api-analysis-traffic 3.3.1-alpha.19 → 3.3.1-alpha.20
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
|
@@ -589,6 +589,19 @@ export const summaryTableV3 = async ( req, res ) => {
|
|
|
589
589
|
try {
|
|
590
590
|
let reqestData = req.body;
|
|
591
591
|
let getClientData = await getClientConfig( reqestData.clientId );
|
|
592
|
+
let featureConfigs = getClientData?.featureConfigs || {};
|
|
593
|
+
const engagersLabel = featureConfigs?.bouncedLimit?.value ?
|
|
594
|
+
`More than ${featureConfigs.bouncedLimit.value} mins` :
|
|
595
|
+
'Engagers';
|
|
596
|
+
const bouncedLabel = featureConfigs?.bouncedLimit?.value ?
|
|
597
|
+
`Less than ${featureConfigs.bouncedLimit.value} mins Footfall` :
|
|
598
|
+
'Bounced Footfall';
|
|
599
|
+
const conversionLabel = featureConfigs?.conversion?.value ?
|
|
600
|
+
`More than ${featureConfigs.conversion.value} mins Rate` :
|
|
601
|
+
'Conversion Rate';
|
|
602
|
+
const missedlabel = featureConfigs?.bouncedLimit?.value && featureConfigs?.conversion?.value ?
|
|
603
|
+
`${featureConfigs.bouncedLimit.value} - ${featureConfigs.conversion.value} mins` :
|
|
604
|
+
'Missed Opportunity';
|
|
592
605
|
if ( !getClientData ) {
|
|
593
606
|
return res.sendError( 'Invalid Client Id', 400 );
|
|
594
607
|
}
|
|
@@ -629,11 +642,10 @@ export const summaryTableV3 = async ( req, res ) => {
|
|
|
629
642
|
'Store ID': element.storeId,
|
|
630
643
|
...( req.body.storeId.length ==1 ) ? { Date: element['date'] }:{},
|
|
631
644
|
'Footfall': element.footfallCount,
|
|
632
|
-
'Bounced
|
|
645
|
+
'Bounced Footfall': element.bouncedCount,
|
|
633
646
|
'Engagers': element.engagersCount,
|
|
634
|
-
'
|
|
647
|
+
'Missed Opportunity': element.missedOpportunityCount,
|
|
635
648
|
'Potential Buyers': element.potentialBuyersCount,
|
|
636
|
-
'Conversion Rate': element.conversionRate,
|
|
637
649
|
'NOB Count': element.NOBCount,
|
|
638
650
|
'Avg.Dwell Time': element.avgDwellTime,
|
|
639
651
|
'Avg.Infra DownTime': element.avgInfraDowntime,
|
|
@@ -648,15 +660,38 @@ export const summaryTableV3 = async ( req, res ) => {
|
|
|
648
660
|
'Male': element.male,
|
|
649
661
|
'Female': element.female,
|
|
650
662
|
} );
|
|
663
|
+
} else if ( reqestData.clientId === '452' ) {
|
|
664
|
+
exportdata.push( {
|
|
665
|
+
'Store Name': element.storeName,
|
|
666
|
+
'Store ID': element.storeId,
|
|
667
|
+
...( req.body.storeId.length ==1 ) ? { Date: element['date'] }:{},
|
|
668
|
+
'Footfall': element.footfallCount,
|
|
669
|
+
...( bouncedLabel ? { [bouncedLabel]: element.bouncedCount } : {} ),
|
|
670
|
+
...( engagersLabel ? { [engagersLabel]: element.engagersCount } : {} ),
|
|
671
|
+
...( missedlabel ? { [missedlabel]: element.missedOpportunityCount } : {} ),
|
|
672
|
+
...( conversionLabel ? { [conversionLabel]: element.conversionRate } : {} ),
|
|
673
|
+
'NOB Count': element.NOBCount,
|
|
674
|
+
'Avg.Dwell Time': element.avgDwellTime,
|
|
675
|
+
'Avg.Infra DownTime': element.avgInfraDowntime,
|
|
676
|
+
...( element.passerBy_count !== undefined ? { 'Passer By': element.passerBy_count } : {} ),
|
|
677
|
+
'Below12': element.below12,
|
|
678
|
+
'13-19': element['13-19'],
|
|
679
|
+
'20-30': element['20-30'],
|
|
680
|
+
'31-45': element['31-45'],
|
|
681
|
+
'46-59': element['46-59'],
|
|
682
|
+
'60 above': element['60 above'],
|
|
683
|
+
'Male': element.male,
|
|
684
|
+
'Female': element.female,
|
|
685
|
+
} );
|
|
651
686
|
} else {
|
|
652
687
|
exportdata.push( {
|
|
653
688
|
'Store Name': element.storeName,
|
|
654
689
|
'Store ID': element.storeId,
|
|
655
690
|
...( req.body.storeId.length ==1 ) ? { Date: element['date'] }:{},
|
|
656
691
|
'Footfall': element.footfallCount,
|
|
657
|
-
'Bounced
|
|
692
|
+
'Bounced Footfall': element.bouncedCount,
|
|
658
693
|
'Engagers': element.engagersCount,
|
|
659
|
-
'
|
|
694
|
+
'Missed Opportunity': element.missedOpportunityCount,
|
|
660
695
|
'Potential Buyers': element.potentialBuyersCount,
|
|
661
696
|
'Conversion Rate': element.conversionRate,
|
|
662
697
|
'NOB Count': element.NOBCount,
|
|
@@ -2008,7 +2043,7 @@ async function getGroupStoresIds( userClientId, storeIds, getRole, getUserType,
|
|
|
2008
2043
|
|
|
2009
2044
|
async function getClientConfig( clientId ) {
|
|
2010
2045
|
try {
|
|
2011
|
-
let getClientData = await clientService.findOne( { clientId: clientId }, { 'paymentInvoice.currencyType': 1, 'averageTransactionValue': 1, 'featureConfigs.billableCalculation': 1, 'featureConfigs.missedOpportunityCalculation': 1, 'featureConfigs.conversionCalculation': 1, 'featureConfigs.open': 1, 'featureConfigs.close': 1, 'isFootfallAuditStores': 1 } );
|
|
2046
|
+
let getClientData = await clientService.findOne( { clientId: clientId }, { 'paymentInvoice.currencyType': 1, 'averageTransactionValue': 1, 'featureConfigs.billableCalculation': 1, 'featureConfigs.missedOpportunityCalculation': 1, 'featureConfigs.conversionCalculation': 1, 'featureConfigs.open': 1, 'featureConfigs.close': 1, 'isFootfallAuditStores': 1, 'featureConfigs.bouncedLimit': 1, 'featureConfigs.conversion': 1 } );
|
|
2012
2047
|
if ( !getClientData ) {
|
|
2013
2048
|
return false;
|
|
2014
2049
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import { getconfig, revoptagging, getrevoptagging } from '../controllers/revop.controller.js';
|
|
4
|
-
import { isAllowedSessionHandler
|
|
4
|
+
import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
5
5
|
|
|
6
6
|
export const revopRouter = express.Router();
|
|
7
7
|
|