tango-app-api-audit 3.6.0 → 3.6.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-audit",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -471,7 +471,8 @@ export async function isFeatureRunning( req, res, next ) {
471
471
  { term: { 'store_date.keyword': inputData.fileDate } },
472
472
  { term: { 'module.keyword': inputData.moduleType ==='track'? 'live_features_retrigger':'features_retrigger' } },
473
473
  { term: { 'zone_id.keyword': inputData.moduleType === 'zone'? inputData.zoneName :'traffic_zone' } },
474
- { term: { 'completed_st': true } },
474
+ { term: { 'completed_st': false } },
475
+ { term: { 'initiated_st': true } },
475
476
  ],
476
477
  },
477
478
  },
@@ -479,9 +480,9 @@ export async function isFeatureRunning( req, res, next ) {
479
480
 
480
481
  const getId = await getOpenSearchData( openSearch.tangoEyeLargeLogs, getQuery );
481
482
  if ( getId?.body?.hits?.hits?.length > 0 ) {
482
- next();
483
+ return res.sendError( `This store is already being processed for the selected date. Please try again later.`, 400 );
483
484
  } else {
484
- return res.sendError( `Access denied, due to running features for this store ${inputData.storeId} and for this ${inputData.fileDate}`, 400 );
485
+ next();
485
486
  }
486
487
  } catch ( error ) {
487
488
  const err = error.message || 'Internal Server Error';