tango-app-api-infra 3.9.5-vms.55 → 3.9.5-vms.57

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-infra",
3
- "version": "3.9.5-vms.55",
3
+ "version": "3.9.5-vms.57",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -28,6 +28,7 @@
28
28
  "nodemon": "^3.1.0",
29
29
  "swagger-ui-express": "^5.0.0",
30
30
  "tango-api-schema": "^2.4.28",
31
+ "tango-app-api-infra": "^3.9.5-vms.56",
31
32
  "tango-app-api-middleware": "^3.1.93",
32
33
  "winston": "^3.12.0",
33
34
  "winston-daily-rotate-file": "^5.0.0"
@@ -2362,6 +2362,11 @@ export async function openTicketList( req, res ) {
2362
2362
  },
2363
2363
  _source: [ 'ticketId', 'storeName', 'storeId', 'dateString', 'revicedFootfall', 'footfallCount', 'revicedPerc', 'type' ],
2364
2364
  };
2365
+ // INSERT_YOUR_CODE
2366
+ // Add sorting by revicedPerc descending (highest revised accuracy first)
2367
+ openSearchQuery.sort = [
2368
+ { 'revicedPerc.keyword': { order: inputData?.sortOrder === 1? 'asc':'desc' } },
2369
+ ];
2365
2370
 
2366
2371
 
2367
2372
  // Assuming getOpenSearchData and openSearch.footfallDirectoryTagging are available
@@ -510,6 +510,7 @@ export const openTicketListSchema = Joi.object().keys( {
510
510
  Joi.string().required(),
511
511
  ).required(),
512
512
  type: Joi.string().required().allow( 'review', 'approve' ),
513
+ sortOrder: Joi.number().allow( 1, -1 ).optional(),
513
514
 
514
515
 
515
516
  } );