tango-app-api-client 3.1.16 → 3.1.18
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.1.
|
|
3
|
+
"version": "3.1.18",
|
|
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.0.
|
|
29
|
-
"tango-app-api-middleware": "^3.1.
|
|
28
|
+
"tango-api-schema": "^2.0.144",
|
|
29
|
+
"tango-app-api-middleware": "^3.1.26",
|
|
30
30
|
"winston": "^3.11.0",
|
|
31
31
|
"winston-daily-rotate-file": "^5.0.0"
|
|
32
32
|
},
|
|
@@ -526,7 +526,18 @@ export async function detailedAllClientCount( req, res ) {
|
|
|
526
526
|
},
|
|
527
527
|
];
|
|
528
528
|
const result = await aggregateClient( query );
|
|
529
|
-
const activeStores = await findStore( { 'status': 'active'
|
|
529
|
+
const activeStores = await findStore( { 'status': 'active' }, { storeId: 1 } );
|
|
530
|
+
let yettoInstallCount = await aggregateTickets( [
|
|
531
|
+
{
|
|
532
|
+
$match: {
|
|
533
|
+
$and: [
|
|
534
|
+
{ issueType: 'installation' },
|
|
535
|
+
{ 'status': { $ne: 'closed' } },
|
|
536
|
+
],
|
|
537
|
+
},
|
|
538
|
+
},
|
|
539
|
+
] );
|
|
540
|
+
|
|
530
541
|
let storesList = [];
|
|
531
542
|
for ( let store of activeStores ) {
|
|
532
543
|
storesList.push( store.storeId );
|
|
@@ -535,7 +546,7 @@ export async function detailedAllClientCount( req, res ) {
|
|
|
535
546
|
if ( result.length == 0 ) {
|
|
536
547
|
return res.sendError( 'No Data Found', 204 );
|
|
537
548
|
}
|
|
538
|
-
result[0].activeStoresCount = activeStores.length;
|
|
549
|
+
result[0].activeStoresCount = activeStores.length-yettoInstallCount.length;
|
|
539
550
|
result[0].activeCameraCount = activeCameras;
|
|
540
551
|
return res.sendSuccess( { result: result } );
|
|
541
552
|
} catch ( error ) {
|
|
@@ -802,7 +813,7 @@ export async function updateFeatureConfiguration( req, res ) {
|
|
|
802
813
|
close: req.body?.close, conversionCalculation: req.body?.conversionCalculation, conversionCondition: req.body?.conversionCondition,
|
|
803
814
|
conversionValue: req.body?.conversionValue, infraAlertCondition: req.body?.infraAlertCondition, infraAlertValue: req.body?.infraAlertValue, isFootfallDirectory: req.body?.isFootfallDirectory,
|
|
804
815
|
isNormalized: req.body?.isNormalized, isPasserByData: req.body?.isPasserByData, missedOpportunityCalculation: req.body?.missedOpportunityCalculation, open: req.body?.open,
|
|
805
|
-
isExcludedArea: req.body?.isExcludedArea,
|
|
816
|
+
isExcludedArea: req.body?.isExcludedArea, isCameraDisabled: req.body?.isCameraDisabled, isbillingDisabled: req.body?.isbillingDisabled,
|
|
806
817
|
} );
|
|
807
818
|
|
|
808
819
|
let updateKeys = [];
|
|
@@ -1732,32 +1743,44 @@ export async function clientListV1( req, res ) {
|
|
|
1732
1743
|
}
|
|
1733
1744
|
|
|
1734
1745
|
if ( inputData.sortColumName&&inputData.sortColumName!=''&& req.body.sortBy&&req.body.sortBy!='' ) {
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1746
|
+
if ( inputData.sortColumName==='clientName' ) {
|
|
1747
|
+
clientQuery.push(
|
|
1748
|
+
{
|
|
1749
|
+
$project: {
|
|
1750
|
+
clientId: 1,
|
|
1751
|
+
onboardedStores: 1,
|
|
1752
|
+
installedStore: 1,
|
|
1753
|
+
activeStores: 1,
|
|
1754
|
+
InactiveStores: 1,
|
|
1755
|
+
ProcessingStatus: 1,
|
|
1756
|
+
clientName: 1,
|
|
1757
|
+
subscriptionPlan: 1,
|
|
1758
|
+
PaymentPlan: 1,
|
|
1759
|
+
PaymentPlan: 1,
|
|
1760
|
+
installedPending: 1,
|
|
1761
|
+
installedFailed: 1,
|
|
1762
|
+
ProgressBar: 1,
|
|
1763
|
+
sortField: {
|
|
1764
|
+
'$toLower': `$${req.body.sortColumName}`,
|
|
1765
|
+
},
|
|
1766
|
+
},
|
|
1767
|
+
},
|
|
1768
|
+
{
|
|
1769
|
+
$sort: { sortField: req.body.sortBy },
|
|
1770
|
+
},
|
|
1771
|
+
);
|
|
1772
|
+
} else {
|
|
1773
|
+
clientQuery.push( {
|
|
1774
|
+
$sort: { [req.body.sortColumName]: req.body.sortBy },
|
|
1775
|
+
} );
|
|
1776
|
+
}
|
|
1739
1777
|
} else {
|
|
1740
1778
|
clientQuery.push( {
|
|
1741
1779
|
$sort: { activeStores: -1 },
|
|
1742
1780
|
},
|
|
1743
1781
|
);
|
|
1744
1782
|
}
|
|
1745
|
-
|
|
1746
|
-
$project: {
|
|
1747
|
-
clientId: { $toString: '$clientId' },
|
|
1748
|
-
onboardedStores: 1,
|
|
1749
|
-
installedStore: 1,
|
|
1750
|
-
activeStores: 1,
|
|
1751
|
-
InactiveStores: 1,
|
|
1752
|
-
ProcessingStatus: 1,
|
|
1753
|
-
clientName: 1,
|
|
1754
|
-
subscriptionPlan: 1,
|
|
1755
|
-
PaymentPlan: 1,
|
|
1756
|
-
installedPending: 1,
|
|
1757
|
-
installedFailed: 1,
|
|
1758
|
-
ProgressBar: 1,
|
|
1759
|
-
},
|
|
1760
|
-
} );
|
|
1783
|
+
|
|
1761
1784
|
if ( req.body.limit && req.body.offset && !req.body.isExport ) {
|
|
1762
1785
|
clientQuery.push(
|
|
1763
1786
|
{ $skip: ( req.body.offset - 1 ) * req.body.limit },
|
package/src/docs/client.docs.js
CHANGED
|
@@ -10,14 +10,6 @@ export const clientDocs = {
|
|
|
10
10
|
tags: [ 'Client' ],
|
|
11
11
|
description: 'lead appoved and create a new client',
|
|
12
12
|
operationId: 'create',
|
|
13
|
-
parameters: [ {
|
|
14
|
-
in: 'path',
|
|
15
|
-
name: 'id',
|
|
16
|
-
required: true,
|
|
17
|
-
schema: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
},
|
|
20
|
-
} ],
|
|
21
13
|
requestBody: {
|
|
22
14
|
content: {
|
|
23
15
|
'application/json': {
|
package/src/dtos/client.dtos.js
CHANGED
|
@@ -109,6 +109,8 @@ export const featureConfigurationSchemaBody = joi.object(
|
|
|
109
109
|
isPasserByData: joi.boolean().optional(),
|
|
110
110
|
isFootfallDirectory: joi.boolean().optional(),
|
|
111
111
|
isExcludedArea: joi.boolean().optional(),
|
|
112
|
+
isCameraDisabled: joi.boolean().optional(),
|
|
113
|
+
isbillingDisabled: joi.boolean().optional(),
|
|
112
114
|
},
|
|
113
115
|
);
|
|
114
116
|
|
|
@@ -133,6 +133,7 @@ export function featureConfigurationUpdate( {
|
|
|
133
133
|
close, conversionCalculation, conversionCondition,
|
|
134
134
|
conversionValue, infraAlertCondition, infraAlertValue, isFootfallDirectory,
|
|
135
135
|
isNormalized, isPasserByData, missedOpportunityCalculation, open, isExcludedArea,
|
|
136
|
+
isCameraDisabled, isbillingDisabled,
|
|
136
137
|
} ) {
|
|
137
138
|
return clientModel.updateOne( { clientId: clientId },
|
|
138
139
|
{
|
|
@@ -153,6 +154,8 @@ export function featureConfigurationUpdate( {
|
|
|
153
154
|
'featureConfigs.isFootfallDirectory': isFootfallDirectory,
|
|
154
155
|
'featureConfigs.isExcludedArea': isExcludedArea,
|
|
155
156
|
'featureConfigs.updateFeatureConfig': false,
|
|
157
|
+
'featureConfigs.isCameraDisabled': isCameraDisabled,
|
|
158
|
+
'featureConfigs.isbillingDisabled': isbillingDisabled,
|
|
156
159
|
},
|
|
157
160
|
} );
|
|
158
161
|
}
|