tango-app-api-store-zone 3.3.1-beta.21 → 3.3.1-beta.22

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-store-zone",
3
- "version": "3.3.1-beta.21",
3
+ "version": "3.3.1-beta.22",
4
4
  "description": "zone",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -544,6 +544,11 @@ export const customTagListv3 = async ( req, res ) => {
544
544
  count: 1,
545
545
  },
546
546
  },
547
+ {
548
+ $sort: {
549
+ count: -1,
550
+ },
551
+ },
547
552
 
548
553
  // Split grouped vs ungrouped
549
554
  {
@@ -1508,7 +1513,6 @@ export const getZoneTaggingDetails = async ( req, res ) => {
1508
1513
 
1509
1514
  const pipeline = [
1510
1515
  { $match: matchStage },
1511
-
1512
1516
  {
1513
1517
  $lookup: {
1514
1518
  from: 'taggings',
@@ -1520,15 +1524,21 @@ export const getZoneTaggingDetails = async ( req, res ) => {
1520
1524
  $and: [
1521
1525
  { $eq: [ '$tagName', '$$tagName' ] },
1522
1526
  { $eq: [ '$clientId', clientId ] },
1527
+ { $ne: [ '$coordinates', [] ] },
1523
1528
  ],
1524
1529
  },
1525
1530
  },
1526
1531
  },
1532
+ {
1533
+ $group: {
1534
+ _id: '$storeId',
1535
+ count: { $sum: 1 },
1536
+ },
1537
+ },
1527
1538
  ],
1528
1539
  as: 'tagsCount',
1529
1540
  },
1530
1541
  },
1531
-
1532
1542
  {
1533
1543
  $project: {
1534
1544
  clientId: 1,
@@ -1537,7 +1547,6 @@ export const getZoneTaggingDetails = async ( req, res ) => {
1537
1547
  storesTaggedCount: { $size: '$tagsCount' },
1538
1548
  },
1539
1549
  },
1540
-
1541
1550
  {
1542
1551
  $facet: {
1543
1552
  totalCount: [