tango-app-api-client 3.0.53-dev → 3.0.55-dev
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.0.
|
|
3
|
+
"version": "3.0.55-dev",
|
|
4
4
|
"description": "client",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
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.
|
|
28
|
+
"tango-api-schema": "^2.0.113",
|
|
29
29
|
"tango-app-api-middleware": "^1.0.73-test",
|
|
30
30
|
"winston": "^3.11.0",
|
|
31
31
|
"winston-daily-rotate-file": "^5.0.0"
|
|
@@ -1491,6 +1491,37 @@ export async function clientListV1( req, res ) {
|
|
|
1491
1491
|
},
|
|
1492
1492
|
},
|
|
1493
1493
|
);
|
|
1494
|
+
if ( inputData.filterByPaymentStatus ) {
|
|
1495
|
+
if ( inputData.filterByPaymentStatus.includes( 'paid' ) ) {
|
|
1496
|
+
inputData.filterByPaymentStatus.push( ...[ 'unbilled', 'due' ] );
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
clientQuery.push(
|
|
1500
|
+
{
|
|
1501
|
+
$match: {
|
|
1502
|
+
'PaymentPlan': { $in: inputData.filterByPaymentStatus },
|
|
1503
|
+
},
|
|
1504
|
+
},
|
|
1505
|
+
);
|
|
1506
|
+
}
|
|
1507
|
+
if ( inputData.filterBySubscription ) {
|
|
1508
|
+
clientQuery.push(
|
|
1509
|
+
{
|
|
1510
|
+
$match: {
|
|
1511
|
+
'subscriptionType': { $in: inputData.filterBySubscription },
|
|
1512
|
+
},
|
|
1513
|
+
},
|
|
1514
|
+
);
|
|
1515
|
+
}
|
|
1516
|
+
if ( inputData.filterByStatus ) {
|
|
1517
|
+
clientQuery.push(
|
|
1518
|
+
{
|
|
1519
|
+
$match: {
|
|
1520
|
+
status: { $in: inputData.filterByStatus },
|
|
1521
|
+
},
|
|
1522
|
+
},
|
|
1523
|
+
);
|
|
1524
|
+
}
|
|
1494
1525
|
if ( inputData.searchValue && inputData.searchValue != '' ) {
|
|
1495
1526
|
clientQuery.push( {
|
|
1496
1527
|
$match: {
|
|
@@ -1633,10 +1664,13 @@ export async function clientListV1( req, res ) {
|
|
|
1633
1664
|
},
|
|
1634
1665
|
{
|
|
1635
1666
|
$project: {
|
|
1636
|
-
clientId:
|
|
1667
|
+
clientId: { $toInt: '$clientId' },
|
|
1637
1668
|
onboardedStores: 1,
|
|
1638
1669
|
installedStore: 1,
|
|
1639
|
-
activeStores: { $
|
|
1670
|
+
activeStores: { $max: [
|
|
1671
|
+
{ $subtract: [ '$activeStores', '$installedPending' ] },
|
|
1672
|
+
0,
|
|
1673
|
+
] },
|
|
1640
1674
|
InactiveStores: 1,
|
|
1641
1675
|
ProcessingStatus: 1,
|
|
1642
1676
|
clientName: 1,
|
|
@@ -1676,6 +1710,22 @@ export async function clientListV1( req, res ) {
|
|
|
1676
1710
|
},
|
|
1677
1711
|
);
|
|
1678
1712
|
}
|
|
1713
|
+
clientQuery.push( {
|
|
1714
|
+
$project: {
|
|
1715
|
+
clientId: { $toString: '$clientId' },
|
|
1716
|
+
onboardedStores: 1,
|
|
1717
|
+
installedStore: 1,
|
|
1718
|
+
activeStores: 1,
|
|
1719
|
+
InactiveStores: 1,
|
|
1720
|
+
ProcessingStatus: 1,
|
|
1721
|
+
clientName: 1,
|
|
1722
|
+
subscriptionPlan: 1,
|
|
1723
|
+
PaymentPlan: 1,
|
|
1724
|
+
installedPending: 1,
|
|
1725
|
+
installedFailed: 1,
|
|
1726
|
+
ProgressBar: 1,
|
|
1727
|
+
},
|
|
1728
|
+
} );
|
|
1679
1729
|
if ( req.body.limit && req.body.offset && !req.body.isExport ) {
|
|
1680
1730
|
clientQuery.push(
|
|
1681
1731
|
{ $skip: ( req.body.offset - 1 ) * req.body.limit },
|
|
@@ -1690,11 +1740,12 @@ export async function clientListV1( req, res ) {
|
|
|
1690
1740
|
exportResult.push( {
|
|
1691
1741
|
'Brand Name': client.clientName,
|
|
1692
1742
|
'Brand Id': client.clientId,
|
|
1693
|
-
'
|
|
1743
|
+
'Onboarded Stores': client.onboardedStores||0,
|
|
1744
|
+
'Installed Stores': client.installedStore || 0,
|
|
1745
|
+
'Progress Bar': client.ProgressBar||0,
|
|
1694
1746
|
'Active Stores': client.activeStores || 0,
|
|
1695
|
-
'
|
|
1696
|
-
'
|
|
1697
|
-
'Pending Install': client.installedPending || 0,
|
|
1747
|
+
'In-Active Stores': client.activeStores || 0,
|
|
1748
|
+
'Pending Configuration': client.installedPending || 0,
|
|
1698
1749
|
'Payment Plan': client.PaymentPlan,
|
|
1699
1750
|
'Subscription Plan': client.subscriptionPlan,
|
|
1700
1751
|
'Processing Status': client.ProcessingStatus,
|