tango-app-api-trax 3.7.41 → 3.7.43

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-trax",
3
- "version": "3.7.41",
3
+ "version": "3.7.43",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "mongodb": "^6.8.0",
28
28
  "nodemon": "^3.1.4",
29
29
  "path": "^0.12.7",
30
- "tango-api-schema": "^2.5.32",
30
+ "tango-api-schema": "^2.5.52",
31
31
  "tango-app-api-middleware": "^3.5.2",
32
32
  "url": "^0.11.4",
33
33
  "winston": "^3.13.1",
@@ -307,7 +307,7 @@ export async function PCLconfigCreation( req, res ) {
307
307
  },
308
308
  } );
309
309
  let getSections = await CLquestions.aggregate( sectionQuery );
310
- if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
310
+ if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) {
311
311
  if ( getSections.length ) {
312
312
  for ( let element3 of getSections ) {
313
313
  let collectQuestions = {};
@@ -631,11 +631,11 @@ export async function PCLconfigCreation( req, res ) {
631
631
  // }
632
632
  }
633
633
  } else {
634
- if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
634
+ if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) {
635
635
  let storeNameList = allQuestion.map( ( item ) => item.store_id );
636
- let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
636
+ let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
637
637
  let storeList = storeDetails.map( ( store ) => store.storeId );
638
- if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
638
+ if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) {
639
639
  allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
640
640
  } else {
641
641
  allQuestion = storeDetails.map( ( item ) => {
@@ -669,7 +669,7 @@ export async function PCLconfigCreation( req, res ) {
669
669
  client_id: getCLconfig.client_id,
670
670
  aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
671
671
  };
672
- if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
672
+ if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) {
673
673
  let processData = {
674
674
  aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
675
675
  return { storeName: store.storeName, storeId: store.store_id, events: store.events };
@@ -910,7 +910,7 @@ async function insertData( requestData ) {
910
910
  },
911
911
  } );
912
912
  let getSections = await CLquestions.aggregate( sectionQuery );
913
- if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
913
+ if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) {
914
914
  if ( getSections.length ) {
915
915
  for ( let element3 of getSections ) {
916
916
  let collectQuestions = {};
@@ -1205,11 +1205,11 @@ async function insertData( requestData ) {
1205
1205
  // }
1206
1206
  }
1207
1207
  } else {
1208
- if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
1208
+ if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) {
1209
1209
  let storeNameList = allQuestion.map( ( item ) => item.store_id );
1210
- let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
1210
+ let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
1211
1211
  let storeList = storeDetails.map( ( store ) => store.storeId );
1212
- if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
1212
+ if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) {
1213
1213
  allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
1214
1214
  } else {
1215
1215
  allQuestion = storeDetails.map( ( item ) => {
@@ -1243,7 +1243,7 @@ async function insertData( requestData ) {
1243
1243
  client_id: getCLconfig.client_id,
1244
1244
  aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
1245
1245
  };
1246
- if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
1246
+ if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( getCLconfig.checkListType ) ) {
1247
1247
  let processData = {
1248
1248
  aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
1249
1249
  return { storeName: store.storeName, storeId: store.store_id, events: store.events };
@@ -2987,7 +2987,7 @@ export async function checklistv1( req, res ) {
2987
2987
 
2988
2988
  const [ checklistResult, taskResult ] = await Promise.allSettled( [
2989
2989
  processedchecklist.aggregate( buildPipeline( [ { checkListType: 'custom' } ], { isPlano: 1, planoId: 1, planoType: 1, floorId: 1 } ) ),
2990
- processedTask.aggregate( taskBuildPipeline( [], { isPlano: 1, planoId: 1, planoType: 1, floorId: 1, refTaskId: 1, store_id: 1 } ) ),
2990
+ processedTask.aggregate( taskBuildPipeline( [], { isPlano: 1, planoId: 1, planoType: 1, floorId: 1, refTaskId: 1, store_id: 1, fixtureNewUI: 1 } ) ),
2991
2991
  ] );
2992
2992
 
2993
2993
  const checklistData = checklistResult.status === 'fulfilled' ? checklistResult.value : [];
@@ -606,7 +606,7 @@ export const flagCardsV1 = async ( req, res ) => {
606
606
  {
607
607
  client_id: clientId,
608
608
  publish: true,
609
- checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] },
609
+ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ] },
610
610
  },
611
611
  { checkListType: 1 },
612
612
  );
@@ -2738,7 +2738,7 @@ export const checklistDropdownV1 = async ( req, res ) => {
2738
2738
  $or: [
2739
2739
  { questionFlag: { $gte: 1 } },
2740
2740
  { timeFlag: { $gte: 1 } },
2741
- { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] } },
2741
+ { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ] } },
2742
2742
  {
2743
2743
  runAIQuestionCount: { $gte: 1 },
2744
2744
  },
@@ -2940,7 +2940,7 @@ export const flagComparisonCardsV2 = async ( req, res ) => {
2940
2940
  {
2941
2941
  client_id: requestData.clientId,
2942
2942
  publish: true,
2943
- checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] },
2943
+ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ] },
2944
2944
  },
2945
2945
  { checkListType: 1 },
2946
2946
  );
@@ -3042,7 +3042,7 @@ export const flagTablesV2 = async ( req, res ) => {
3042
3042
  }
3043
3043
 
3044
3044
  if ( requestData?.filter === 'all' ) {
3045
- findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] } } ] } );
3045
+ findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ] } } ] } );
3046
3046
  } else if ( requestData?.filter === 'question' ) {
3047
3047
  findAndQuery.push( { checkListType: 'custom' } );
3048
3048
  findAndQuery.push( { questionFlag: { $gte: 1 } } );
@@ -3050,7 +3050,7 @@ export const flagTablesV2 = async ( req, res ) => {
3050
3050
  findAndQuery.push( { checkListType: 'custom' } );
3051
3051
  findAndQuery.push( { timeFlag: { $gte: 1 } } );
3052
3052
  } else if ( requestData?.filter === 'detection' ) {
3053
- findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] } } );
3053
+ findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ] } } );
3054
3054
  } else if ( requestData?.filter === 'runAI' ) {
3055
3055
  if ( req.body.runAIChecklistName ) {
3056
3056
  findAndQuery.push( { checkListName: { $in: req.body.runAIChecklistName } } );
@@ -4073,7 +4073,7 @@ async function updateOpenSearch( user, data ) {
4073
4073
  export const aiChecklist = async ( req, res ) => {
4074
4074
  try {
4075
4075
  let storeDetails = await storeService.count( { clientId: req.query.clientId, status: 'active' } );
4076
- let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ];
4076
+ let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ];
4077
4077
  let checklistDetails = [];
4078
4078
  let publishList = [];
4079
4079
  let unpublishList = [];
@@ -4086,7 +4086,7 @@ export const aiChecklist = async ( req, res ) => {
4086
4086
  checklistDetails = [ ...publishList, ...unpublishList ];
4087
4087
 
4088
4088
  checklistDetails.forEach( ( item ) => {
4089
- if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( item.checkListType ) ) {
4089
+ if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering' ].includes( item.checkListType ) ) {
4090
4090
  item.storeCount = storeDetails;
4091
4091
  }
4092
4092
  } );