tango-app-api-client 3.3.1 → 3.3.2-beta.1
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-client",
|
|
3
|
-
"version": "3.3.1",
|
|
3
|
+
"version": "3.3.2-beta.1",
|
|
4
4
|
"description": "client",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"mongodb": "^6.3.0",
|
|
26
26
|
"nodemon": "^3.0.3",
|
|
27
27
|
"swagger-ui-express": "^5.0.0",
|
|
28
|
-
"tango-api-schema": "^2.1.
|
|
29
|
-
"tango-app-api-middleware": "^3.1.
|
|
28
|
+
"tango-api-schema": "^2.1.59",
|
|
29
|
+
"tango-app-api-middleware": "^3.1.43-alpha.8",
|
|
30
30
|
"winston": "^3.11.0",
|
|
31
31
|
"winston-daily-rotate-file": "^5.0.0"
|
|
32
32
|
},
|
|
@@ -515,7 +515,44 @@ export async function clientDetails( req, res ) {
|
|
|
515
515
|
}
|
|
516
516
|
export async function detailedAllClientCount( req, res ) {
|
|
517
517
|
try {
|
|
518
|
+
const field = { clientName: 1, clientId: 1 };
|
|
519
|
+
let Assinedclient = [];
|
|
520
|
+
if ( req?.user?.role === 'superadmin' ) {
|
|
521
|
+
Assinedclient = await findClient( {}, field );
|
|
522
|
+
Assinedclient = Assinedclient.map( ( data ) => data.clientId );
|
|
523
|
+
} else {
|
|
524
|
+
const clientQuery = [
|
|
525
|
+
{
|
|
526
|
+
$match: {
|
|
527
|
+
userEmail: req?.user?.email,
|
|
528
|
+
assignedType: { $eq: 'client' },
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
$group: {
|
|
533
|
+
_id: null,
|
|
534
|
+
clientId: { $addToSet: '$assignedValue' },
|
|
535
|
+
},
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
$project: {
|
|
539
|
+
_id: 0,
|
|
540
|
+
clientId: 1,
|
|
541
|
+
},
|
|
542
|
+
},
|
|
543
|
+
|
|
544
|
+
];
|
|
545
|
+
const clientList = await aggregateUserAssignedStore( clientQuery );
|
|
546
|
+
if ( clientList[0]?.clientId?.length != 0 ) {
|
|
547
|
+
Assinedclient= clientList[0]?.clientId;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
518
550
|
const query = [
|
|
551
|
+
{
|
|
552
|
+
$match: {
|
|
553
|
+
clientId: { $in: Assinedclient },
|
|
554
|
+
},
|
|
555
|
+
},
|
|
519
556
|
{
|
|
520
557
|
$project: {
|
|
521
558
|
activeClient: { $cond: [ { $eq: [ '$status', 'active' ] }, 1, 0 ] },
|
|
@@ -579,11 +616,14 @@ export async function detailedAllClientCount( req, res ) {
|
|
|
579
616
|
},
|
|
580
617
|
];
|
|
581
618
|
const result = await aggregateClient( query );
|
|
582
|
-
const activeStores = await findStore( {
|
|
619
|
+
const activeStores = await findStore( {
|
|
620
|
+
'clientId': { $in: Assinedclient },
|
|
621
|
+
'status': 'active' }, { storeId: 1 } );
|
|
583
622
|
let yettoInstallCount = await aggregateTickets( [
|
|
584
623
|
{
|
|
585
624
|
$match: {
|
|
586
625
|
$and: [
|
|
626
|
+
{ 'basicDetails.clientId': { $in: Assinedclient } },
|
|
587
627
|
{ issueType: 'installation' },
|
|
588
628
|
{ 'status': { $ne: 'closed' } },
|
|
589
629
|
],
|
|
@@ -867,7 +907,7 @@ export async function updateFeatureConfiguration( req, res ) {
|
|
|
867
907
|
conversionValue: req.body?.conversionValue, infraAlertCondition: req.body?.infraAlertCondition, infraAlertValue: req.body?.infraAlertValue, isFootfallDirectory: req.body?.isFootfallDirectory,
|
|
868
908
|
isNormalized: req.body?.isNormalized, isPasserByData: req.body?.isPasserByData, missedOpportunityCalculation: req.body?.missedOpportunityCalculation, open: req.body?.open,
|
|
869
909
|
isExcludedArea: req.body?.isExcludedArea, isCameraDisabled: req.body?.isCameraDisabled, isbillingDisabled: req.body?.isbillingDisabled, isNewDashboard: req.body?.isNewDashboard,
|
|
870
|
-
isFootfallAuditStores: req.body?.isFootfallAuditStores, isNewTraffic: req.body?.isNewTraffic, isNewZone: req.body?.isNewZone, isNewReports: req.body?.isNewReports, isNOB: req.body?.isNOB, isNewZoneV2: req.body?.isNewZoneV2,
|
|
910
|
+
isFootfallAuditStores: req.body?.isFootfallAuditStores, isNewTraffic: req.body?.isNewTraffic, isNewZone: req.body?.isNewZone, isNewReports: req.body?.isNewReports, isNOB: req.body?.isNOB, isNewZoneV2: req.body?.isNewZoneV2, isTrax: req.body?.isTrax,
|
|
871
911
|
} );
|
|
872
912
|
|
|
873
913
|
let updateKeys = [];
|
package/src/dtos/client.dtos.js
CHANGED
|
@@ -134,7 +134,7 @@ export function featureConfigurationUpdate( {
|
|
|
134
134
|
conversionValue, infraAlertCondition, infraAlertValue, isFootfallDirectory,
|
|
135
135
|
isNormalized, isPasserByData, missedOpportunityCalculation, open, isExcludedArea,
|
|
136
136
|
isCameraDisabled, isbillingDisabled, isNewDashboard, isFootfallAuditStores, isNewTraffic,
|
|
137
|
-
isNewZone, isNewReports, isNOB, isNewZoneV2,
|
|
137
|
+
isNewZone, isNewReports, isNOB, isNewZoneV2, isTrax,
|
|
138
138
|
} ) {
|
|
139
139
|
return clientModel.updateOne( { clientId: clientId },
|
|
140
140
|
{
|
|
@@ -164,6 +164,7 @@ export function featureConfigurationUpdate( {
|
|
|
164
164
|
'featureConfigs.isNewReports': isNewReports,
|
|
165
165
|
'featureConfigs.isNOB': isNOB,
|
|
166
166
|
'featureConfigs.isNewZoneV2': isNewZoneV2,
|
|
167
|
+
'featureConfigs.isTrax': isTrax,
|
|
167
168
|
},
|
|
168
169
|
} );
|
|
169
170
|
}
|